Andrey Tsyvarev <tsyvarev@xxxxxxxxx> writes:Do you mean that scenario:
21.01.2015 4:40, Rusty Russell ÐÐÑÐÑ:What happens if you later register another lock at that address, since
Andrey Tsyvarev <tsyvarev@xxxxxxxxx> writes:Compiler warns about sections mismatch, but the test works.
20.01.2015 9:37, Rusty Russell ÐÐÑÐÑ:I don't know that we have any __initdata locks; it would be really
Andrey Tsyvarev <tsyvarev@xxxxxxxxx> writes:As I understand, locks are not allowed to be defined in the module init
parse_args call module parameters' .set handlers, which may use locks defined in the module.Thanks, this seems right. Applied.
So, these classes should be freed in case parse_args returns error(e.g. due to incorrect parameter passed).
But this makes me ask: where is lockdep_free_key_range() called on the
module init code? It doesn't seem to be at all...
section. So, no needs to call lockdep_free_key_range() for it.
This has a sense: objects from that section are allowed to be used only
by module->init() function. But a single function call doesn't require
any synchronization wrt itself.
weird.
But change 'static DEFINE_MUTEX(mutex_param);' to 'static __initdata
DEFINE_MUTEX(mutex_param);' to test.
According to lockdep_free_key_range() code, lock class is cleared not
only according to
its key(which is equal to lock address in the case of static lock) but
also according to its name.
the memory is freed?