[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200308115007.GE31215@bombadil.infradead.org>
Date: Sun, 8 Mar 2020 04:50:07 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: mateusznosek0@...il.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] mm/page_alloc.c: Micro-optimisation Remove
unnecessary branch
On Sat, Mar 07, 2020 at 03:15:42PM -0800, Andrew Morton wrote:
> On Sat, 7 Mar 2020 23:53:35 +0100 mateusznosek0@...il.com wrote:
> > - if (unlikely(ac.nodemask != nodemask))
> > - ac.nodemask = nodemask;
> > + ac.nodemask = nodemask;
>
> This will now unconditionally dirty the ac.nodemask cacheline, which
> means that cacheline will need to be written back. If it is truly
> unlikely that the write was needed then the thinking goes that the
> test-and-branch is worthwhile, by saving on memory traffic.
>
> At least, I assume that's why the code is the way it is.
The line immediately before this hunk is:
ac.spread_dirty_pages = false;
ac is on-stack and is only 32 bytes. I don't see a reason not to do this.
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Powered by blists - more mailing lists