lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090421193924.GA24404@elte.hu>
Date:	Tue, 21 Apr 2009 21:39:24 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Paul Mackerras <paulus@...ba.org>, paulmck@...ux.vnet.ibm.com,
	Eric Dumazet <dada1@...mosbay.com>,
	Evgeniy Polyakov <zbr@...emap.net>,
	David Miller <davem@...emloft.net>, kaber@...sh.net,
	jeff.chua.linux@...il.com, laijs@...fujitsu.com,
	jengelh@...ozas.de, r000n@...0n.net, linux-kernel@...r.kernel.org,
	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
	benh@...nel.crashing.org, mathieu.desnoyers@...ymtl.ca
Subject: Re: [PATCH] netfilter: use per-cpu recursive lock (v11)


* Stephen Hemminger <shemminger@...tta.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ