mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch added to -mm tree
@ 2020-09-12 23:52 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-12 23:52 UTC (permalink / raw)
  To: mm-commits, akpm, mateusznosek0


The patch titled
     Subject: mm/page_alloc.c: micro-optimization remove unnecessary branch
has been added to the -mm tree.  Its filename is
     mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: mateusznosek0@gmail.com
Subject: mm/page_alloc.c: micro-optimization remove unnecessary branch


Previously flags check was separated into two separated checks with two
separated branches. In case of presence of any of two mentioned flags,
the same effect on flow occurs. Therefore checks can be merged and one
branch can be avoided.

Link: https://lkml.kernel.org/r/20200911092310.31136-1-mateusznosek0@gmail.com
Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/mm/page_alloc.c~mm-page_allocc-micro-optimization-remove-unnecessary-branch
+++ a/mm/page_alloc.c
@@ -3972,8 +3972,10 @@ __alloc_pages_may_oom(gfp_t gfp_mask, un
 	 * success so it is time to admit defeat. We will skip the OOM killer
 	 * because it is very likely that the caller has a more reasonable
 	 * fallback than shooting a random task.
+	 *
+	 * The OOM killer may not free memory on a specific node.
 	 */
-	if (gfp_mask & __GFP_RETRY_MAYFAIL)
+	if (gfp_mask & (__GFP_RETRY_MAYFAIL | __GFP_THISNODE))
 		goto out;
 	/* The OOM killer does not needlessly kill tasks for lowmem */
 	if (ac->highest_zoneidx < ZONE_NORMAL)
@@ -3990,10 +3992,6 @@ __alloc_pages_may_oom(gfp_t gfp_mask, un
 	 * failures more gracefully we should just bail out here.
 	 */
 
-	/* The OOM killer may not free memory on a specific node */
-	if (gfp_mask & __GFP_THISNODE)
-		goto out;
-
 	/* Exhausted what can be done so it's blame time */
 	if (out_of_memory(&oc) || WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL)) {
 		*did_some_progress = 1;
_

Patches currently in -mm which might be from mateusznosek0@gmail.com are

mm-page_allocc-clean-code-by-removing-unnecessary-initialization.patch
mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-12 23:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12 23:52 + mm-page_allocc-micro-optimization-remove-unnecessary-branch.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).