netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: David Miller <davem@davemloft.net>,
	paul.moore@hp.com, kaber@trash.net, netdev@vger.kernel.org,
	acme@ghostprotocols.net
Subject: Re: Run-time kfree check for correct cache [was Re: [NET]: Fix kfree(skb)]
Date: Wed, 28 Feb 2007 11:10:54 +0100	[thread overview]
Message-ID: <200702281110.54619.dada1@cosmosbay.com> (raw)
In-Reply-To: <20070228090258.GA28336@2ka.mipt.ru>

On Wednesday 28 February 2007 10:02, Evgeniy Polyakov wrote:
> Attached patch detects in run-time things like:
> skb = alloc_skb();
> kfree(skb);
>
> where provided to kfree pointer does not belong to kmalloc caches.
> It is turned on when slab debug config option is enabled.
>
> When problem is detected, following warning is printed with hint to
> what cache/function should be used instead:

It would be less expensive to add a flag 
#define SLAB_KFREE_NOWARNING 0x00200000UL

And OR this flags into cs->flags of all standard caches created by 
kmem_cache_init() from malloc_sizes[]/cache_names[]

kfree() would then just test this flag.


  reply	other threads:[~2007-02-28 10:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 17:06 [NET]: Fix kfree(skb) Patrick McHardy
2007-02-27 17:35 ` Paul Moore
2007-02-27 18:00   ` David Miller
2007-02-27 18:14     ` Evgeniy Polyakov
2007-02-27 18:20       ` Evgeniy Polyakov
2007-02-27 18:24         ` David Miller
2007-02-27 22:24           ` Arnaldo Carvalho de Melo
2007-02-28  9:02           ` Run-time kfree check for correct cache [was Re: [NET]: Fix kfree(skb)] Evgeniy Polyakov
2007-02-28 10:10             ` Eric Dumazet [this message]
2007-02-28 14:16               ` Run-time kfree check for correct cache [plus x86_64 APIC troubles] Evgeniy Polyakov
2007-03-01 16:17                 ` Additional run-tme check [Run-time kfree check for correct cache] Evgeniy Polyakov
2007-02-27 18:01 ` [NET]: Fix kfree(skb) David Miller

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=200702281110.54619.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=paul.moore@hp.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;
as well as URLs for NNTP newsgroup(s).