Search Linux Wireless

Re: [PATCH v2 2/3] compat: backport kfree_rcu()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 17, 2011 at 3:05 PM, Hauke Mehrtens <hauke@xxxxxxxxxx> wrote:
> This adds a nested function everywhere kfree_rcu() was called. This
> function frees the memory and is given as a function to call_rcu().
> The kfree_rcu define was made by Johannes Berg.
> The rcu callback could happen every time also after the module was
> unloaded and this will cause problems.
> A rcu_barrier() was added into every module_exit so that this will not
> be called after the module was unloaded.
>
> The define overwriting module_exit is based on the original module_exit
> which looks like this:
> /* This is only required if you want to be unloadable. */
> /#define module_exit(exitfn)                                    \
>        static inline exitcall_t __exittest(void)               \
>        { return exitfn; }                                      \
>        void cleanup_module(void) __attribute__((alias(#exitfn)));
>
> We replaced the call to the actual function exitfn() with a call to our
> function which calls the original exitfn() and then rcu_barrier()
>
> As a module will not be unloaded that ofter it should not have a big
> performance impact when rcu_barrier() is called on every module exit,
> also when no kfree_rcu() backport is used in that module.
>
> Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
> CC: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> ---
> v2: remove compile check for exitfn
>    make function static

Wow, that's pretty fucking hairy, good stuff though, thanks! Applied and pushed!

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux