public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Samwel <bart@samwel.tk>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] Fix overflow issues with sysctl values in centiseconds/seconds
Date: Sat, 28 Jan 2006 03:46:27 +0100	[thread overview]
Message-ID: <43DADB03.7080606@samwel.tk> (raw)

Hi Andrew,

Here's a threesome of patches to fix up some issues with the following 
sysctl values:

/proc/sys/vm/laptop_mode
/proc/sys/vm/dirty_writeback_centisecs
/proc/sys/vm/dirty_expire_centisecs

The issues:
1. The values are not range checked when they are set. They all have
a range smaller than the full integer range.
2. Conversion from these centisecond/second values is done on-the-fly 
wherever they are used. This wastes some resources.
3. The conversions are done badly. Conversion from USER_HZ to HZ is done 
by doing "value * USER_HZ / HZ". One day expressed in centiseconds 
already causes an overflow at HZ = 250. This should use 
clock_t_to_jiffies() instead.

The approach:
1. Represent everything in jiffies internally.
2. Do the conversion and range checking in the sysctl interface.

Cheers,
Bart

             reply	other threads:[~2006-01-28  2:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-28  2:46 Bart Samwel [this message]
2006-01-28  3:55 ` [PATCH 0/3] Fix overflow issues with sysctl values in centiseconds/seconds Andrew Morton
2006-01-28  4:04   ` Randy.Dunlap
2006-01-28 13:08     ` Ingo Oeser
2006-01-28  4:09   ` Nish Aravamudan
2006-01-28  4:39   ` Paul Jackson
2006-01-28 11:37   ` Bart Samwel

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=43DADB03.7080606@samwel.tk \
    --to=bart@samwel.tk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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