diff options
author | Mateusz Nosek <mateusznosek0@gmail.com> | 2020-04-02 06:09:53 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-02 18:35:31 +0200 |
commit | 97ce86f93cf3f885063d919499903d08aa390942 (patch) | |
tree | b5b8c84ba784be99712ffc219fbbac970b8406b5 /mm | |
parent | mm/page_alloc.c: use free_area_empty() instead of open-coding (diff) | |
download | linux-97ce86f93cf3f885063d919499903d08aa390942.tar.xz linux-97ce86f93cf3f885063d919499903d08aa390942.zip |
mm/page_alloc.c: micro-optimisation Remove unnecessary branch
Previously if branch condition was false, the assignment was not executed.
The assignment can be safely executed even when the condition is false
and it is not incorrect as it assigns the value of 'nodemask' to
'ac.nodemask' which already has the same value.
So as the assignment can be executed unconditionally, the branch can be
removed.
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: http://lkml.kernel.org/r/20200307225335.31300-1-mateusznosek0@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2a7d77b01604..43a405c4c16e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4751,8 +4751,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * Restore the original nodemask if it was potentially replaced with * &cpuset_current_mems_allowed to optimize the fast-path attempt. */ - if (unlikely(ac.nodemask != nodemask)) - ac.nodemask = nodemask; + ac.nodemask = nodemask; page = __alloc_pages_slowpath(alloc_mask, order, &ac); |