[<prev] [next>] [day] [month] [year] [list]
Message-ID: <691578e1e0844c7c876a54c6ff9c2f0a@huawei.com>
Date: Thu, 17 Sep 2020 11:54:43 +0000
From: linmiaohe <linmiaohe@...wei.com>
To: Matthew Wilcox <willy@...radead.org>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: avoid possible multiple call to swap_node()
Matthew Wilcox <willy@...radead.org> wrote:
> On Thu, Sep 17, 2020 at 07:44:49AM -0400, Miaohe Lin wrote:
>> Cache the swap_node() in a local variable to avoid possible multiple
>> call to swap_node(), though compiler may do this for us.
>
>Why don't you find out? Compare the assembly before and after, see what the compiler did.
In fact, I don't care if the compiler can really do this for us. I think it's better to do this explicity. I think this can improve the readability.
Thanks.
Powered by blists - more mailing lists