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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1324051285.25554.37.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date:	Fri, 16 Dec 2011 17:01:25 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>, Robin Holt <holt@....com>
Subject: Re: [PATCH] module: struct module_ref should contains long fields

Le vendredi 16 décembre 2011 à 07:54 -0800, Tejun Heo a écrit :
> Hello, Eric.
> 
> On Fri, Dec 16, 2011 at 06:07:37AM +0100, Eric Dumazet wrote:
> > +struct module_ref {
> > +	unsigned long incs;
> > +	unsigned long decs;
> > +} __attribute((aligned(2 * sizeof(unsigned long))));
> 
> Why not ____cacheline_aligned?  Another thing is that for percpu
> memory, packing could be better or at least shouldn't be worse.
> Percpu area usages are likely to be local so one major benefit of
> cacheline alignment - avoiding cacheline pingpong - goes away.  The
> constant is called SMP_CACHE_BYTES after all.

Its percpu data, there is no need to waste a full cache line per cpu for
this.

This is only a hint to make sure one single cache line is touched if a
thread increments/decrements a module refcount, with no memory extra
cost : We play with the alignement of this 8 or 16 bytes block.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ