[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080714183734.GB3960@localhost>
Date: Mon, 14 Jul 2008 21:37:34 +0300
From: eduard.munteanu@...ux360.ro
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: cl@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [RESEND PATCH] kmemtrace: SLAB hooks.
On Mon, Jul 14, 2008 at 09:19:48PM +0300, Pekka Enberg wrote:
> Hi Eduard-Gabriel,
>
> On Mon, 2008-07-14 at 20:42 +0300, Eduard - Gabriel Munteanu wrote:
> > This adds hooks for the SLAB allocator, to allow tracing with
> > kmemtrace.
> >
> > Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
> > @@ -28,8 +29,20 @@ extern struct cache_sizes malloc_sizes[];
> > void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
> > void *__kmalloc(size_t size, gfp_t flags);
> >
> > +#ifdef CONFIG_KMEMTRACE
> > +extern void *__kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags);
> > +#else
> > +static inline void *__kmem_cache_alloc(struct kmem_cache *cachep,
> > + gfp_t flags)
> > +{
> > + return kmem_cache_alloc(cachep, flags);
> > +}
> > +#endif
> > +
>
> I'm okay with this approach but then you need to do
> s/__kmem_cache_alloc/kmem_cache_alloc_trace/ or similar. In the kernel,
> it's always the *upper* level function that doesn't have the
> underscores.
Hmm, doesn't really make sense:
1. This should be called kmem_cache_alloc_notrace, not *_trace.
__kmem_cache_alloc() _disables_ tracing.
2. __kmem_cache_alloc is not really upper level now, since it's called
only in kmalloc. So it's an internal function which is not supposed to
be used by other kernel code.
Are you sure I should do this?
Eduard
--
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