mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Tejun Heo <tj@home-tj.org>
Cc: mochel@osdl.org,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>
Subject: Re: Per-device parameter new interface and issues to be resolved
Date: Thu, 28 Oct 2004 16:32:27 +1000	[thread overview]
Message-ID: <1098945148.9349.17.camel@localhost.localdomain> (raw)
In-Reply-To: <20041027063204.GA11887@home-tj.org>

On Wed, 2004-10-27 at 15:32 +0900, Tejun Heo wrote: 
>  4. sysfs directory "params" renamed to "parameters"

Probably a good idea, but I'm reluctant to endorse userspace-visible
breakage.  We've already done that once 8)

>  2. module_param_*_ranged() stuff
> 
>  I've looked at a number of places where module param is used, and
> most parameters need range checking.  Only a few parameters actually
> accept full range of the designated type.  For example, maxbatch in
> kernel/rcupdate.c is currently of type int but values smaller than 1
> doesn't make much sense.  All ports array parameter in
> net/ipv4/netfilter/*.c should be in the range of 0-65535 and most
> device driver parameters need range-checking too.  I think
> incorporating range into moduleparam can reduce duplicate codes and
> improve consistency regarding handling of out-of-range parameters.
> 
>  Yes, the number of functions in module/devparam is increased but
> they're straightforward and it's not like actual code is bloated.

Well, netfilter ports should be a u16, so it's naturally contrained
(although 0 would be very unusual).  If max_batch were unsigned, rcu
would be fixed too (although we have 0 again as the odd case).

I don't really want the churn of making them all take range args
and adding "#define PARAM_NO_RANGE 0, -1".  Perhaps doubling the number
of macros is the right approach.

>  3. In array parameters, discarding the number of set array elements
> instead of using param_array's max field to store it when nump isn't
> supplied.
> 
>  I think that it's fair and clear to require the user to supply nump
> field to param_array() when the number of set array element matters
> either to the driver or the user space reading the value off sysfs
> node.

Fortunately sprintf("%s") handles NULL, which was my main concern, so
this is OK IMHO.

I think my bigger question is: is this going in the right direction?
Should we instead be doing something like eg. "block/hda/dev=3:0", and
trying to connect the pipes so the driver's sysfs entries are
initialized by the parameter parsing code?

Should we be using module parameters to control device settings at all?

I don't know the answers here, but I share your discomfort over the
current module parameter <-> device parameter mapping.

(Hoping Greg KH will have an opinion here...)

Thanks!
Rusty.
-- 


      reply	other threads:[~2004-10-28  7:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  6:32 Tejun Heo
2004-10-28  6:32 ` Rusty Russell [this message]

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=1098945148.9349.17.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=tj@home-tj.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

all inboxes | Powered by JetHome®