netdev
[Top] [All Lists]

Re: [IPV4] Fix ip_rt_gc_min_interval_ms procfs/sysctl

To: akpm@xxxxxxxx
Subject: Re: [IPV4] Fix ip_rt_gc_min_interval_ms procfs/sysctl
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Fri, 18 Feb 2005 19:59:13 +0900 (JST)
Cc: torvalds@xxxxxxxx, davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx
In-reply-to: <20050218024917.2e5c19ec.akpm@xxxxxxxx>
Organization: USAGI Project
References: <20050218.192430.98634850.yoshfuji@xxxxxxxxxxxxxx> <20050218024917.2e5c19ec.akpm@xxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
In article <20050218024917.2e5c19ec.akpm@xxxxxxxx> (at Fri, 18 Feb 2005 
02:49:17 -0800), Andrew Morton <akpm@xxxxxxxx> says:

> YOSHIFUJI Hideaki / ____________ <yoshfuji@xxxxxxxxxxxxxx> wrote:
> >
> > Recently, we added gc_min_interval_ms procfs/sysctl.
> > 
> >  Because type of ip_rt_gc_min_interval is int, 
> >  use of ulong helpers is inappropriate and unsafe.
> >  I believe it breaks some archs that the size of unsigned long
> >  is not equal to one of int.
> > 
> >  So, let's add new sysctl helpers and use them instead.
> >  This also fixes inconsistency between procfs and sysctl.
> 
> I disagree.  ip_rt_gc_min_interval is an `int' and does not need to be
> changed to `long' - note how is is always used as a time delta.

I'm not suggesting to use ulong helpers.

The type of variable (ip_rt_gc_min_interval) is int,
and we erroneously started using ulong helpers for it.
This break memory.

So, I suggest to use appropriate helpers.

> A better approach wold be to rework ip_rt_gc_min_interval so that its
> userspace-visible units are milliseconds.

My patch add a sysctl/procfs helpers to convert units
between milliseconds and jiffies.

Do you still disagree?

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

<Prev in Thread] Current Thread [Next in Thread>