From: "David S. Miller" <davem@redhat.com>
To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" <yoshfuji@linux-ipv6.org>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code
Date: Mon, 10 Nov 2003 23:02:33 -0800 [thread overview]
Message-ID: <20031110230233.254061da.davem@redhat.com> (raw)
In-Reply-To: <20031110.104536.79654717.yoshfuji@linux-ipv6.org>
On Mon, 10 Nov 2003 10:45:36 -0600 (CST)
YOSHIFUJI Hideaki / _$B5HF#1QL@ <yoshfuji@linux-ipv6.org> wrote:
> more jiffies normalizations reported to userspace, in core/neighbour.c.
...
> +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
> + void __user *, size_t *);
This function is huge and it reuses a lot of existing logic.
Cannot you implement it simply like this:
int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
void __user *, size_t *)
{
return do_proc_dointvec(table,write,filp,buffer,lenp,HZ/USER_HZ,OP_SET);
}
Right?
Linus, what we need here is a function that converts to/from
USER_HZ and HZ jiffies for a few sysctl knobs in core/neighbour.c
Yoshfuji copied all of the logic of routines such as do_proc_dointvec()
replacing the "conv" conversion multiplies and divides with calls to
jiffies_to_clock_t() and friends. While this is the cleanest implementation
it sure wastes a lot of code for such a minor difference in behavior.
Won't my above idea work?
Another idea is to change do_proc_dointvec() to take a conversion function
pointer instead of this "conv" thing. Maybe even proc_dointvec_minmax()
could be implemented in terms of do_proc_dointvec() with such a scheme.
next prev parent reply other threads:[~2003-11-11 7:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-10 16:45 [PATCH] NET: Normalize jiffies reported to userspace, in neighbor management code YOSHIFUJI Hideaki / 吉藤英明
2003-11-11 7:02 ` David S. Miller [this message]
2003-11-11 22:31 ` YOSHIFUJI Hideaki / 吉藤英明
2003-11-12 0:02 ` David S. Miller
2003-11-12 3:36 ` YOSHIFUJI Hideaki / 吉藤英明
2003-12-18 6:42 ` YOSHIFUJI Hideaki / 吉藤英明
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=20031110230233.254061da.davem@redhat.com \
--to=davem@redhat.com \
--cc=netdev@oss.sgi.com \
--cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).