All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Zdenek Kabelac <zdenek.kabelac@gmail.com>,
	Patrick McHardy <kaber@trash.net>, Robin Holt <holt@sgi.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jesper Dangaard Brouer <hawk@comx.dk>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Netfilter Developers <netfilter-devel@vger.kernel.org>,
	paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH] slub: fix slab_pad_check()
Date: Thu, 03 Sep 2009 17:02:10 +0200	[thread overview]
Message-ID: <4A9FDA72.8060001@gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.10.0909031335430.29881@V090114053VZO-1>

Christoph Lameter a écrit :
> On Thu, 3 Sep 2009, Eric Dumazet wrote:
> 
>> Christoph Lameter a ?crit :
>>> On Thu, 3 Sep 2009, Eric Dumazet wrote:
>>>
>>>> on a SLAB_DESTROY_BY_RCU cache, there is no need to try to optimize this
>>>> rcu_barrier() call, unless we want superfast reboot/halt sequences...
>>> I stilll think that the action to quiesce rcu is something that the caller
>>> of kmem_cache_destroy must take care of.
>> Do you mean :
>>
>> if (kmem_cache_shrink(s) == 0) {
>> 	rcu_barrier();
>> 	kmem_cache_destroy_no_rcu_barrier(s);
>> } else {
>> 	kmem_cache_destroy_with_rcu_barrier_because_SLAB_DESTROY_BY_RCU_cache(s);
>> }
>>
>> What would be the point ?
> 
> The above is port of slub?

No, I am trying to code what you suggest, and I could not find a clean way with
current API (SLAB/SLUB/SLOB)

> 
> I mean that (in this case) the net subsystem would have to deal with RCU quietness
> before disposing of the slab cache. There may be multiple ways of dealing
> with RCU. The RCU barrier may be unnecessary for future uses. Typically
> one would expect that all deferred handling of structures must be complete
> for correctness before disposing of the whole cache.

Point is we cannot deal with RCU quietness before disposing the slab cache,
(if SLAB_DESTROY_BY_RCU was set on the cache) since this disposing *will* 
make call_rcu() calls when a full slab is freed/purged.
And when RCU grace period is elapsed, the callback *will* need access to 
the cache we want to dismantle. Better to not have kfreed()/poisoned it...

I believe you mix two RCU uses here.

1) The one we all know, is use normal caches (!SLAB_DESTROY_BY_RCU) 
(or kmalloc()), and use call_rcu(... kfree_something)

   In this case, you are 100% right that the subsystem itself has
   to call rcu_barrier() (or respect whatever self-synchro) itself,
   before calling kmem_cache_destroy()

2) The SLAB_DESTROY_BY_RCU one.

   Part of cache dismantle needs to call rcu_barrier() itself.
   Caller doesnt have to use rcu_barrier(). It would be a waste of time,
   as kmem_cache_destroy() will refill rcu wait queues with its own stuff.






  parent reply	other threads:[~2009-09-03 15:02 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 12:42 System freeze on reboot - general protection fault Zdenek Kabelac
2009-08-11 14:34 ` Christoph Lameter
2009-08-11 14:52   ` Zdenek Kabelac
2009-08-11 15:03     ` Christoph Lameter
2009-08-11 15:32       ` Zdenek Kabelac
2009-08-11 15:48         ` Robin Holt
2009-08-11 21:10           ` Zdenek Kabelac
2009-08-12 22:16             ` Zdenek Kabelac
2009-08-12 22:21               ` Christoph Lameter
2009-08-13 17:09                 ` Zdenek Kabelac
2009-08-14  9:33                   ` Zdenek Kabelac
2009-08-16  9:16                     ` Eric Dumazet
2009-08-17 14:03                       ` Patrick McHardy
2009-09-02 21:45                         ` Zdenek Kabelac
2009-09-02 22:17                           ` Eric Dumazet
2009-09-02 22:31                             ` Zdenek Kabelac
2009-09-03  1:04                               ` [PATCH] slub: fix slab_pad_check() and SLAB_DESTROY_BY_RCU Eric Dumazet
2009-09-03  6:31                                 ` Pekka Enberg
2009-09-03  6:31                                   ` Pekka Enberg
2009-09-03  7:38                                   ` Eric Dumazet
2009-09-03  7:38                                     ` Eric Dumazet
2009-09-03  7:51                                     ` Pekka Enberg
2009-09-03 17:50                                       ` Christoph Lameter
2009-09-03 14:05                                         ` Pekka Enberg
2009-09-03 14:18                                           ` [PATCH] slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU Eric Dumazet
2009-09-03 19:48                                             ` Pekka Enberg
2009-09-03 19:56                                               ` Eric Dumazet
2009-09-03 19:56                                                 ` Eric Dumazet
2009-09-03 17:45                                     ` [PATCH] slub: fix slab_pad_check() and SLAB_DESTROY_BY_RCU Christoph Lameter
2009-09-03 14:08                                       ` [PATCH] slub: fix slab_pad_check() Eric Dumazet
2009-09-03 18:38                                         ` Christoph Lameter
2009-09-03 15:01                                           ` Paul E. McKenney
2009-09-03 15:02                                           ` Eric Dumazet [this message]
2009-09-03 19:24                                             ` Christoph Lameter
2009-09-03 17:44                                               ` Paul E. McKenney
2009-09-03 22:43                                                 ` Christoph Lameter
2009-09-03 22:03                                                   ` Paul E. McKenney
2009-09-04 15:33                                                     ` Christoph Lameter
2009-09-03 22:08                                                   ` Eric Dumazet
2009-09-03 22:08                                                     ` Eric Dumazet
2009-09-03 22:17                                                     ` Eric Dumazet
2009-09-04 15:39                                                       ` Christoph Lameter
2009-09-04 20:42                                                       ` Paul E. McKenney
2009-09-04 20:42                                                         ` Paul E. McKenney
2009-09-04 15:38                                                     ` Christoph Lameter
2009-09-03 17:59                                               ` Eric Dumazet
2009-09-03 17:59                                                 ` Eric Dumazet
2009-09-03 19:00                                                 ` Pekka Enberg
2009-09-03 22:44                                                 ` Christoph Lameter
2009-09-03 23:17                                                   ` Paul E. McKenney
2009-09-04 15:42                                                     ` Christoph Lameter
2009-09-04 20:43                                                       ` Paul E. McKenney
2009-09-08 19:57                                                         ` Christoph Lameter
2009-09-08 22:20                                                           ` Paul E. McKenney
2009-09-08 22:41                                                             ` Christoph Lameter
2009-09-08 22:59                                                               ` Paul E. McKenney
2009-09-09 14:04                                                                 ` Christoph Lameter
2009-09-09 14:42                                                                   ` Paul E. McKenney
2009-09-09 14:53                                                                     ` Christoph Lameter
2009-09-09 15:09                                                                       ` Paul E. McKenney
2009-09-03 19:34                                         ` Pekka Enberg
2009-09-03 15:00                                       ` [PATCH] slub: fix slab_pad_check() and SLAB_DESTROY_BY_RCU Paul E. McKenney
2009-09-03 13:42                                   ` Paul E. McKenney
2009-09-03 13:42                                     ` Paul E. McKenney
2009-09-03 13:28                                 ` Zdenek Kabelac
2009-09-03 13:46                                   ` Eric Dumazet
2009-09-03 13:46                                     ` Eric Dumazet
2009-09-03 14:35                                     ` Zdenek Kabelac
2009-09-03 14:35                                       ` Zdenek Kabelac
2009-09-03 18:17                             ` System freeze on reboot - general protection fault Paul E. McKenney
2009-09-03 18:17                               ` Paul E. McKenney

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=4A9FDA72.8060001@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=cl@linux-foundation.org \
    --cc=hawk@comx.dk \
    --cc=holt@sgi.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=zdenek.kabelac@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.