Re: Writable module parameters - should be volatile?

From: Duncan Sands
Date: Thu Sep 16 2004 - 17:22:57 EST


Hi Rusty,

> > 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.

except for the compiler warnings...

> 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.

Ah ha! - you can supply your own "set" and "get" methods. Yes, that solves it.

Ciao,

Duncan.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/