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]
Date:	Thu, 27 Feb 2014 18:34:15 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	brouer@...hat.com
Cc:	netfilter-devel@...r.kernel.org, eric.dumazet@...il.com,
	pablo@...filter.org, netdev@...r.kernel.org, fw@...len.de,
	kaber@...sh.net
Subject: Re: [nf-next PATCH 0/5] (repost) netfilter: conntrack:
 optimization, remove central spinlock

From: Jesper Dangaard Brouer <brouer@...hat.com>
Date: Thu, 27 Feb 2014 19:23:24 +0100

> (Repost to netfilter-devel list)
> 
> This patchset change the conntrack locking and provides a huge
> performance improvements.
> 
> This patchset is based upon Eric Dumazet's proposed patch:
>   http://thread.gmane.org/gmane.linux.network/268758/focus=47306
> I have in agreement with Eric Dumazet, taken over this patch (and
> turned it into a entire patchset).
> 
> Primary focus is to remove the central spinlock nf_conntrack_lock.
> This requires several steps to be acheived.

I only worry about the raw_smp_processor_id()'s.

If preemption will be disabled in these contexts, then it's safe and
we can just use plain smp_processor_id().

If preemption is not necessarily disabled in these spots, the use
is not correct.  We'll need to use get_cpu/put_cpu sequences, or
(considering what these patches are doing) something like:

	struct ct_pcpu *pcpu;

	/* add this conntrack to the (per cpu) unconfirmed list */
	local_bh_disable();
	ct->cpu = smp_processor_id();
	pcpu = per_cpu_ptr(nf_ct_net(ct)->ct.pcpu_lists, ct->cpu);

	spin_lock(&pcpu->lock);
	hlist_nulls_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
			     &pcpu->unconfirmed);
	spin_unlock_bh(&pcpu->lock);
--
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