lkml.org 
[lkml]   [2009]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netfilter: use per-cpu recursive lock (v11)

* Stephen Hemminger <shemminger@vyatta.com> wrote:

> +void xt_info_wrunlock_bh(void)
> + __releases(xt_info_lock)
> +{
> + unsigned int i;
> +
> + for_each_possible_cpu(i) {
> +#if NR_CPUS > (PREEMPT_MASK - 1)
> + /*
> + * Spin_unlock calls preempt_enable, but since we had
> + * to adjust the count in xt_info_wrlock_bh, do it again
> + */
> + preempt_disable();
> +#endif
> + write_unlock(&per_cpu(xt_info_locks, i));
> + }
> + local_bh_enable();
> +}

In the global/local lock scheme i proposed this would become:

global_write_unlock(void)
{
write_unlock(&global_lock);
}

As we dont hold the local locks during the write-locked critical
section. No loop needed over CPUs, no preempt nesting complications,
no lockdep complications, etc.

Ingo


\
 
 \ /
  Last update: 2009-04-21 21:43    [W:0.262 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site