Re: [PATCH] Cpuset: rcu optimization of page alloc hook

From: Andrew Morton
Date: Mon Dec 12 2005 - 05:12:58 EST


Paul Jackson <pj@xxxxxxx> wrote:
>
> > Please do use __read_mostly for new kmem_cache :
> >
> > static kmem_cache_t *cpuset_cache __read_mostly;
>
> Is there any downside to this? I ask because accesses through
> this 'cpuset_cache' pointer are rather infrequent - only when
> the sysadmin or the batch scheduler is creating or removing
> cpusets, which for the purposes of 'back of the envelope'
> estimates, might be once a minute or less. Further, it is
> not at all a performance critical path.
>
> So I really don't give a dang if it takes a few milliseconds
> to pick up this pointer, at least so far as cpusets matters.

There's no downside, really. It just places the storage into a different
section. There's a small downside to having __read_mostly at all: up to a
page more memory used. But once it's there, adding to it is just moving
things around in memory.

__read_mostly is simply a new (page-aligned) section into we put things
which are considered to not be written to very often.

> That said, would you still advise marking this __read_mostly?

Not at this stage - it'd be better if someone did a big sweep and changed
all kmem_cache_t's in one hit.

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