From: Christoph Lameter <clameter@sgi.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Ingo Molnar <mingo@elte.hu>, Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] slub: add hooks for kmemcheck
Date: Fri, 18 Apr 2008 15:12:54 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0804181507130.31394@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20080418220339.GC16586@damson.getinternet.no>
On Sat, 19 Apr 2008, Vegard Nossum wrote:
> index f62caaa..d5505b1 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -29,6 +29,13 @@
> #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
> #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
>
> +#ifdef CONFIG_KMEMCHECK
> +/* Don't track use of uninitialized memory */
> +# define SLAB_NOTRACK 0x00400000UL
> +#else
> +# define SLAB_NOTRACK 0
> +#endif
> +
It maybe easier to just avoid the #ifdef. The other debug flags also only
have a function if certain kernel config options are set.
> +#ifdef CONFIG_KMEMCHECK
> +struct page *kmemcheck_allocate_slab(struct kmem_cache *s,
> + gfp_t flags, int node, int pages);
> +void kmemcheck_free_slab(struct kmem_cache *s, struct page *page, int pages);
> +
> +void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object);
> +void kmemcheck_slab_free(struct kmem_cache *s, void *object);
> +#else
> +static inline struct page *kmemcheck_allocate_slab(struct kmem_cache *s,
> + gfp_t flags, int node, int pages) { return NULL; }
> +static inline void kmemcheck_free_slab(struct kmem_cache *s,
> + struct page *page, int pages) { }
> +static inline void kmemcheck_slab_alloc(struct kmem_cache *s,
> + gfp_t gfpflags, void *object) { }
> +static inline void kmemcheck_slab_free(struct kmem_cache *s, void *object) { }
> +#endif /* CONFIG_KMEMCHECK */
> +
Should this not go into some kmemcheck.h file?
> }
>
> + if (kmemcheck_page_is_tracked(page) && !(s->flags & SLAB_NOTRACK)) {
> + kmemcheck_free_slab(s, page, pages);
> + return;
> + }
> +
> + __ClearPageSlab(page);
> +
Why is __ClearPageSlab moved?
> @@ -2449,12 +2462,10 @@ static int __init setup_slub_nomerge(char *str)
> __setup("slub_nomerge", setup_slub_nomerge);
>
> static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s,
> - const char *name, int size, gfp_t gfp_flags)
> + const char *name, int size, gfp_t gfp_flags, unsigned int flags)
The second flags parameter is always 0?
next prev parent reply other threads:[~2008-04-18 22:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 22:03 Vegard Nossum
2008-04-18 22:12 ` Christoph Lameter [this message]
2008-04-18 22:27 ` Vegard Nossum
2008-04-18 23:06 ` Christoph Lameter
2008-04-18 23:21 ` Pekka Enberg
-- strict thread matches above, loose matches on Subject: below --
2008-04-04 13:44 [ANNOUNCE] kmemcheck v7 Vegard Nossum
2008-04-04 13:47 ` [PATCH 3/3] slub: add hooks for kmemcheck Vegard Nossum
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=Pine.LNX.4.64.0804181507130.31394@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=vegard.nossum@gmail.com \
/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
all inboxes | Powered by JetHome®