linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: David Rientjes <rientjes@google.com>
Cc: devel@driverdev.osuosl.org, Rik van Riel <riel@redhat.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Mel Gorman <mgorman@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Cody P Schafer <cody@linux.vnet.ibm.com>
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.

  reply	other threads:[~2014-06-05  0:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1399166883-514-1-git-send-email-green@linuxhacker.ru>
     [not found] ` <alpine.DEB.2.02.1406021837490.13072@chino.kir.corp.google.com>
     [not found]   ` <B549468A-10FC-4897-8720-7C9FEC6FD03A@linuxhacker.ru>
     [not found]     ` <alpine.DEB.2.02.1406022056300.20536@chino.kir.corp.google.com>
     [not found]       ` <2C763027-307F-4BC0-8C0A-7E3D5957A4DA@linuxhacker.ru>
2014-06-04  1:22         ` [patch] " 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=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