Re: [PATCH 1/3] RCU: Move some definitions to minimal headers.

From: Ingo Molnar
Date: Mon Dec 29 2008 - 09:57:00 EST



* Eduard - Gabriel Munteanu <eduard.munteanu@xxxxxxxxxxx> wrote:

> linux/rcupdate.h used to include SLAB headers, which got in the way of
> switching kmemtrace to use tracepoints instead of markers. The circular
> header inclusion pattern that appeared was making it impossible to use
> tracepoints in SLAB allocator inlines.
>
> This moves some header code into separate files. As an added bonus,
> preprocessing is faster if care is taken to use these minimal headers,
> since no effort is spent on including SLAB headers.
>
> Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@xxxxxxxxxxx>
> ---
> include/linux/rcuclassic.h | 40 +--------
> include/linux/rcuclassic_min.h | 77 +++++++++++++++
> include/linux/rcupdate.h | 160 +-------------------------------
> include/linux/rcupdate_min.h | 205 ++++++++++++++++++++++++++++++++++++++++
> include/linux/rcupreempt.h | 32 +------
> include/linux/rcupreempt_min.h | 68 +++++++++++++
> 6 files changed, 353 insertions(+), 229 deletions(-)
> create mode 100644 include/linux/rcuclassic_min.h
> create mode 100644 include/linux/rcupdate_min.h
> create mode 100644 include/linux/rcupreempt_min.h

ok, i like the idea - i'm just not sure this is the best approach. If we
want to do a splitup, it should be along the lines of spinlock.h and
spinlock_types.h.

The principle there is that the type declarations and inline function
definitions kept separate. The 'type' headers are lightweight with minimal
dependencies - the 'inline function' headers are more heavyweight.

For RCU ... cannot we get away much simpler, by removing the headers from
rcupdate.h that cause the SLAB dependency hell? Does rcupdate.h really
need to include all of:

#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/threads.h>
#include <linux/percpu.h>
#include <linux/cpumask.h>
#include <linux/seqlock.h>
#include <linux/lockdep.h>
#include <linux/completion.h>

AFAICS it should be able to get away with spinlock_types.h and i'm not
sure it needs cache.h. The other headers are 'data type' headers mostly.

Which one is causing the trouble for you - cache.h ? If you do a patch
that removes that trouble include file i can make wide build coverage
tests to make sure it's OK to remove it.

but rcu_types.h would be nice to have too - i'm just not sure it's really
what you need. (you seem to need certain RCU functions too, right?)

Ingo
--
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/