public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Duncan Sands <baldrick@free.fr>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Writable module parameters - should be volatile?
Date: Tue, 14 Sep 2004 03:54:26 +1000	[thread overview]
Message-ID: <1095098065.25641.38.camel@bach> (raw)
In-Reply-To: <200409121357.25915.baldrick@free.fr>

On Sun, 2004-09-12 at 21:57, Duncan Sands wrote:
> I declare a writable module parameter as follows:
> 
> static unsigned int num_rcv_urbs = UDSL_DEFAULT_RCV_URBS;
> 
> module_param (num_rcv_urbs, uint, S_IRUGO | S_IWUSR);
> 
> Shouldn't I declare num_rcv_urbs volatile?  Otherwise compiler
> optimizations could (for example) stick it in a register and miss
> any changes made by someone writing to it...

Sure.  If it really matters, you're going to need something stronger
than that, eg module_param_call().  For debugging, it's not usually a
problem.  For more complex parameters, you usually need locks anyway.

Cheers,
Rusty.
-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


  parent reply	other threads:[~2004-09-13 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-12 11:57 Writable module parameters - should be volatile? Duncan Sands
2004-09-12 12:52 ` Arnd Bergmann
2004-09-13 11:58   ` Duncan Sands
2004-09-13 17:54 ` Rusty Russell [this message]
2004-09-16 19:02   ` Duncan Sands

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=1095098065.25641.38.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=baldrick@free.fr \
    --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