Messages in this thread | | | Date | Sun, 8 Mar 2020 04:50:07 -0700 | From | Matthew Wilcox <> | 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@gmail.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@infradead.org>
| |