All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] memsw-handle-swapaccount-kernel-parameter-correctly.patch removed from -mm tree
@ 2011-02-03 19:45 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2011-02-03 19:45 UTC (permalink / raw)
  To: mhocko, kamezawa.hiroyu, nishimura, stable, mm-commits


The patch titled
     memsw: handle swapaccount kernel parameter correctly
has been removed from the -mm tree.  Its filename was
     memsw-handle-swapaccount-kernel-parameter-correctly.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: memsw: handle swapaccount kernel parameter correctly
From: Michal Hocko <mhocko@suse.cz>

__setup based kernel command line parameters handlers which are handled in
obsolete_checksetup are provided with the parameter value including =
(more precisely everything right after the parameter name).

This means that the current implementation of swapaccount[=1|0] doesn't
work at all because if there is a value for the parameter then we are
testing for "0" resp.  "1" but we are getting "=0" resp.  "=1" and if
there is no parameter value we are getting an empty string rather than
NULL.

The original noswapccount parameter, which doesn't care about the value,
works correctly.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memcontrol.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN mm/memcontrol.c~memsw-handle-swapaccount-kernel-parameter-correctly mm/memcontrol.c
--- a/mm/memcontrol.c~memsw-handle-swapaccount-kernel-parameter-correctly
+++ a/mm/memcontrol.c
@@ -5024,9 +5024,9 @@ struct cgroup_subsys mem_cgroup_subsys =
 static int __init enable_swap_account(char *s)
 {
 	/* consider enabled if no parameter or 1 is given */
-	if (!s || !strcmp(s, "1"))
+	if (!(*s) || !strcmp(s, "=1"))
 		really_do_swap_account = 1;
-	else if (!strcmp(s, "0"))
+	else if (!strcmp(s, "=0"))
 		really_do_swap_account = 0;
 	return 1;
 }
@@ -5034,7 +5034,7 @@ __setup("swapaccount", enable_swap_accou
 
 static int __init disable_swap_account(char *s)
 {
-	enable_swap_account("0");
+	enable_swap_account("=0");
 	return 1;
 }
 __setup("noswapaccount", disable_swap_account);
_

Patches currently in -mm which might be from mhocko@suse.cz are

origin.patch
memsw-remove-noswapaccount-kernel-parameter.patch


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

only message in thread, other threads:[~2011-02-03 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 19:45 [merged] memsw-handle-swapaccount-kernel-parameter-correctly.patch removed from -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.