From: Oleg Drokin <green@linuxhacker.ru>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
Cody P Schafer <cody@linux.vnet.ibm.com>,
Randy Dunlap <rdunlap@infradead.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-doc@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [patch v2] mm, pcp: allow restoring percpu_pagelist_fraction default
Date: Wed, 4 Jun 2014 20:46:05 -0400 [thread overview]
Message-ID: <FB428F94-91FA-4E4F-8DA3-060C3C41F261@linuxhacker.ru> (raw)
In-Reply-To: <alpine.DEB.2.02.1406041734150.17045@chino.kir.corp.google.com>
Hello!
On Jun 4, 2014, at 8:34 PM, David Rientjes wrote:
> @@ -5850,23 +5851,39 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write,
> void __user *buffer, size_t *length, loff_t *ppos)
> {
> struct zone *zone;
> - unsigned int cpu;
> + int old_percpu_pagelist_fraction;
> int ret;
>
> + mutex_lock(&pcp_batch_high_lock);
> + old_percpu_pagelist_fraction = percpu_pagelist_fraction;
> +
> ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
> - if (!write || (ret < 0))
> - return ret;
> + if (!write || ret < 0)
> + goto out;
> +
> + /* Sanity checking to avoid pcp imbalance */
> + if (percpu_pagelist_fraction &&
> + percpu_pagelist_fraction < MIN_PERCPU_PAGELIST_FRACTION) {
> + percpu_pagelist_fraction = old_percpu_pagelist_fraction;
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + ret = 0;
Minor nitpick I guess, but ret cannot be anything but 0 here I think (until somebody changes the way proc_dointvec_minmax for write=true operates)?
The patch is good otherwise.
Thanks.
next prev parent reply other threads:[~2014-06-05 0:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 1:28 [PATCH] sysctl: Fix division by zero in percpu_pagelist_fraction handler Oleg Drokin
2014-05-04 2:32 ` Greg Kroah-Hartman
2014-06-03 1:40 ` David Rientjes
2014-06-03 2:12 ` Oleg Drokin
2014-06-03 3:57 ` David Rientjes
2014-06-03 4:17 ` Oleg Drokin
2014-06-04 1:22 ` [patch] mm, pcp: allow restoring percpu_pagelist_fraction default David Rientjes
2014-06-04 2:19 ` Oleg Drokin
2014-06-05 0:34 ` [patch v2] " David Rientjes
2014-06-05 0:46 ` Oleg Drokin [this message]
2014-06-05 20:55 ` David Rientjes
2014-06-12 0:47 ` [patch v3] " David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FB428F94-91FA-4E4F-8DA3-060C3C41F261@linuxhacker.ru \
--to=green@linuxhacker.ru \
--cc=akpm@linux-foundation.org \
--cc=cody@linux.vnet.ibm.com \
--cc=devel@driverdev.osuosl.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=rdunlap@infradead.org \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®