public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sven Wegener <sven.wegener@stealer.net>
Cc: David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dave Chinner <david@fromorbit.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches
Date: Sun, 01 Feb 2009 10:19:39 +0100	[thread overview]
Message-ID: <1233479979.4787.64.camel@laptop> (raw)
In-Reply-To: <alpine.LNX.2.00.0902010218350.6140@titan.stealer.net>

On Sun, 2009-02-01 at 02:22 +0100, Sven Wegener wrote:
> We need to pass an unsigned long as the minimum, because it gets casted
> to an unsigned long in the sysctl handler. If we pass an int, we'll
> access four more bytes on 64bit arches, resulting in a random minimum
> value.

If that's so, how can any of those other limit values still be good?

> Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
> ---
>  kernel/sysctl.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 790f9d7..c5ef44f 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -101,6 +101,7 @@ static int two = 2;
>  
>  static int zero;
>  static int one = 1;
> +static unsigned long one_ul = 1;
>  static int one_hundred = 100;
>  
>  /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
> @@ -974,7 +975,7 @@ static struct ctl_table vm_table[] = {
>  		.mode		= 0644,
>  		.proc_handler	= &dirty_background_bytes_handler,
>  		.strategy	= &sysctl_intvec,
> -		.extra1		= &one,
> +		.extra1		= &one_ul,
>  	},
>  	{
>  		.ctl_name	= VM_DIRTY_RATIO,
> @@ -995,7 +996,7 @@ static struct ctl_table vm_table[] = {
>  		.mode		= 0644,
>  		.proc_handler	= &dirty_bytes_handler,
>  		.strategy	= &sysctl_intvec,
> -		.extra1		= &one,
> +		.extra1		= &one_ul,
>  	},
>  	{
>  		.procname	= "dirty_writeback_centisecs",


  reply	other threads:[~2009-02-01  9:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-23 18:55 [patch 1/2] mm: change dirty limit type specifiers to unsigned long David Rientjes
2008-11-23 18:55 ` [patch 2/2] mm: add dirty_background_bytes and dirty_bytes sysctls David Rientjes
2008-11-24 19:15   ` Peter Zijlstra
2008-11-24 23:38   ` Andrew Morton
2008-11-25  0:52     ` Randy Dunlap
2008-11-25  1:05       ` David Rientjes
2008-11-25  1:00     ` David Rientjes
2009-02-01  1:22   ` [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches Sven Wegener
2009-02-01  9:19     ` Peter Zijlstra [this message]
2009-02-01 10:22       ` Sven Wegener
2009-02-02  0:26     ` David Rientjes
2008-11-24 19:16 ` [patch 1/2] mm: change dirty limit type specifiers to unsigned long Peter Zijlstra
2008-11-24 19:49   ` 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=1233479979.4787.64.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=sven.wegener@stealer.net \
    /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