From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 3/6] fs: Introduce a per_cpu last_ino allocator Date: Thu, 27 Nov 2008 04:46:15 -0500 Message-ID: <20081127094615.GC13860@infradead.org> References: <20081121083044.GL16242@elte.hu> <49267694.1030506@cosmosbay.com> <20081121.010508.40225532.davem@davemloft.net> <4926AEDB.10007@cosmosbay.com> <4926D022.5060008@cosmosbay.com> <20081121152148.GA20388@elte.hu> <4926D39D.9050603@cosmosbay.com> <20081121153453.GA23713@elte.hu> <492DDC88.2050305@cosmosbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ingo Molnar , David Miller , "Rafael J. Wysocki" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mike Galbraith , Peter Zijlstra , Linux Netdev List , Christoph Lameter , Christoph Hellwig To: Eric Dumazet Return-path: Content-Disposition: inline In-Reply-To: <492DDC88.2050305-fPLkHRcR87vqlBn2x/YWAg@public.gmane.org> Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Thu, Nov 27, 2008 at 12:32:24AM +0100, Eric Dumazet wrote: > new_inode() dirties a contended cache line to get inode numbers. > > Solve this problem by providing to each cpu a per_cpu variable, > feeded by the shared last_ino, but once every 1024 allocations. > > This reduce contention on the shared last_ino. > > Note : last_ino_get() method must be called with preemption > disabled on SMP. Looks a little clumsy. One idea might be to have a special slab for synthetic inodes using new_inode and only assign it on the first allocation and after that re-use it.