Re: [RFC] module: add per-module params lock

From: Rusty Russell
Date: Thu Jun 04 2015 - 22:58:35 EST


Dan Streetman <ddstreet@xxxxxxxx> writes:
> I sent this as part of a patch series a few days ago, which I was asked to
> break up, so I'm sending only this patch as a RFC now, until I work out
> the details of the zswap patch that needs this. I'd like to get comments
> on this early, since it changes the way module param locking is done.

OK, it's not insane, but I'm not entirely convinced.

1) The difference between blocking sysfs for read vs write is mainly
documentation. In theory, it allows a rwsem, though in practice it's
not been a bottleneck to now.

2) Implicit is bad: implying the module rather than the parameter is
weird, and skips the BUG_ON() check which was there before.

And finally, why are you loading a module from a param callback? That's
a first!

Thanks,
Rusty.
--
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/