From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [rfc][patch 1/2] mnt_want_write speedup 1
Date: Mon, 29 Dec 2008 15:00:37 -0800 [thread overview]
Message-ID: <1230591637.19452.129.camel@nimitz> (raw)
In-Reply-To: <20081222043526.GC13406@wotan.suse.de>
On Mon, 2008-12-22 at 05:35 +0100, Nick Piggin wrote:
> > Is there a real good reason to allocate the percpu counters dynamically?
> > Might as well stick them in the vfsmount and let the one
> > kmem_cache_zalloc() in alloc_vfsmnt() do a bit larger of an allocation.
> > Did you think that was going to bloat it to a compound allocation or
> > something? I hate the #ifdefs. :)
>
> Distros want to ship big NR_CPUS kernels and have them run reasonably on
> small num_possible_cpus() systems. But also, it would help to avoid
> cacheline bouncing from false sharing (allocpercpu.c code can also mess
> this bug for small objects like these counters, but that's a problem
> with the allocpercpu code which should be fixed anyway).
I guess we could also play the old trick:
struct vfsmount
{
...
int mnt_writers[0];
};
And just
void __init mnt_init(void)
{
...
int size = sizeof(struct vfsmount) + num_possible_cpus() * sizeof(int)
- mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount),
+ mnt_cache = kmem_cache_create("mnt_cache", size,
0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
That should save us the dereference from the pointer and still let it be
pretty flexible.
-- Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-12-29 23:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-19 6:19 Nick Piggin
2008-12-19 6:20 ` [rfc][patch 2/2] mnt_want_write speedup 2 Nick Piggin
2008-12-19 6:34 ` [rfc][patch 1/2] mnt_want_write speedup 1 Dave Hansen
2008-12-19 6:52 ` Nick Piggin
2008-12-19 6:56 ` Nick Piggin
2008-12-19 6:54 ` Dave Hansen
2008-12-19 7:03 ` Nick Piggin
2008-12-19 15:32 ` Dave Hansen
2008-12-22 4:35 ` Nick Piggin
2008-12-29 23:00 ` Dave Hansen [this message]
2008-12-30 4:02 ` Nick Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230591637.19452.129.camel@nimitz \
--to=dave@linux.vnet.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox