All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive.patch added to -mm tree
@ 2020-04-18  0:14 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-04-18  0:14 UTC (permalink / raw)
  To: akpm, mm-commits, richard.weiyang, tim.c.chen


The patch titled
     Subject: mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive
has been added to the -mm tree.  Its filename is
     mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive.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: Wei Yang <richard.weiyang@gmail.com>
Subject: mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive

The code shows if this is ssd, it will jump to specific tag and skip the
following code for non-ssd.

Let's use "else if" to explicitly show the mutually exclusion for
ssd/non-ssd to reduce ambiguity.

Link: http://lkml.kernel.org/r/20200328060520.31449-3-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swapfile.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- a/mm/swapfile.c~mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive
+++ a/mm/swapfile.c
@@ -763,9 +763,7 @@ static int scan_swap_map_slots(struct sw
 			goto checks;
 		else
 			goto scan;
-	}
-
-	if (unlikely(!si->cluster_nr--)) {
+	} else if (unlikely(!si->cluster_nr--)) {
 		if (si->pages - si->inuse_pages < SWAPFILE_CLUSTER) {
 			si->cluster_nr = SWAPFILE_CLUSTER - 1;
 			goto checks;
@@ -873,10 +871,8 @@ checks:
 			goto checks;
 		else
 			goto done;
-	}

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

only message in thread, other threads:[~2020-04-18  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18  0:14 + mm-swapfilec-explicitly-show-ssd-non-ssd-is-handled-mutually-exclusive.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.