All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: Christoph Lameter <cl@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm 2/3] slab: zap kmem_cache_shrink return value
Date: Mon, 26 Jan 2015 23:43:18 +0300	[thread overview]
Message-ID: <20150126204318.GB3317@esperanza> (raw)
In-Reply-To: <alpine.DEB.2.11.1501261427310.17468@gentwo.org>

On Mon, Jan 26, 2015 at 02:28:33PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
> 
> > Right, but I just don't see why a subsystem using a kmem_cache would
> > need to check whether there are any objects left in the cache. I mean,
> > it should somehow keep track of the objects it's allocated anyway, e.g.
> > by linking them in a list. That means it must already have a way to
> > check if it is safe to destroy its cache or not.
> 
> The acpi subsystem did that at some point.
> 
> > Suppose we leave the return value as is. A subsystem, right before going
> > to destroy a cache, calls kmem_cache_shrink, which returns 1 (slab is
> > not empty). What is it supposed to do then?
> 
> That is up to the subsystem. If it has a means of tracking down the
> missing object then it can deal with it. If not then it cannot shutdown
> the cache and do a proper recovery action.

Hmm, we could make kmem_cache_destroy return EBUSY for the purpose.
However, since it spits warnings on failure, which is reasonable, we
have this check in kmem_cache_shrink...

Anyways, I see your point now, thank you for pointing it out. I will fix
SLUB's __kmem_cache_shrink retval instead of removing it altogether in
the next iteration.

Thanks,
Vladimir

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@parallels.com>
To: Christoph Lameter <cl@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm 2/3] slab: zap kmem_cache_shrink return value
Date: Mon, 26 Jan 2015 23:43:18 +0300	[thread overview]
Message-ID: <20150126204318.GB3317@esperanza> (raw)
In-Reply-To: <alpine.DEB.2.11.1501261427310.17468@gentwo.org>

On Mon, Jan 26, 2015 at 02:28:33PM -0600, Christoph Lameter wrote:
> On Mon, 26 Jan 2015, Vladimir Davydov wrote:
> 
> > Right, but I just don't see why a subsystem using a kmem_cache would
> > need to check whether there are any objects left in the cache. I mean,
> > it should somehow keep track of the objects it's allocated anyway, e.g.
> > by linking them in a list. That means it must already have a way to
> > check if it is safe to destroy its cache or not.
> 
> The acpi subsystem did that at some point.
> 
> > Suppose we leave the return value as is. A subsystem, right before going
> > to destroy a cache, calls kmem_cache_shrink, which returns 1 (slab is
> > not empty). What is it supposed to do then?
> 
> That is up to the subsystem. If it has a means of tracking down the
> missing object then it can deal with it. If not then it cannot shutdown
> the cache and do a proper recovery action.

Hmm, we could make kmem_cache_destroy return EBUSY for the purpose.
However, since it spits warnings on failure, which is reasonable, we
have this check in kmem_cache_shrink...

Anyways, I see your point now, thank you for pointing it out. I will fix
SLUB's __kmem_cache_shrink retval instead of removing it altogether in
the next iteration.

Thanks,
Vladimir

  reply	other threads:[~2015-01-26 20:43 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 12:55 [PATCH -mm 0/3] slub: make dead caches discard free slabs immediately Vladimir Davydov
2015-01-26 12:55 ` Vladimir Davydov
2015-01-26 12:55 ` [PATCH -mm 1/3] slub: don't fail kmem_cache_shrink if slab placement optimization fails Vladimir Davydov
2015-01-26 12:55   ` Vladimir Davydov
2015-01-26 15:48   ` Christoph Lameter
2015-01-26 15:48     ` Christoph Lameter
2015-01-26 17:01     ` Vladimir Davydov
2015-01-26 17:01       ` Vladimir Davydov
2015-01-26 18:24       ` Christoph Lameter
2015-01-26 18:24         ` Christoph Lameter
2015-01-26 19:36         ` Vladimir Davydov
2015-01-26 19:36           ` Vladimir Davydov
2015-01-26 19:53           ` Christoph Lameter
2015-01-26 19:53             ` Christoph Lameter
2015-01-27 12:58             ` Vladimir Davydov
2015-01-27 12:58               ` Vladimir Davydov
2015-01-27 17:02               ` Christoph Lameter
2015-01-27 17:02                 ` Christoph Lameter
2015-01-28 15:00                 ` Vladimir Davydov
2015-01-28 15:00                   ` Vladimir Davydov
2015-01-26 12:55 ` [PATCH -mm 2/3] slab: zap kmem_cache_shrink return value Vladimir Davydov
2015-01-26 12:55   ` Vladimir Davydov
2015-01-26 15:49   ` Christoph Lameter
2015-01-26 15:49     ` Christoph Lameter
2015-01-26 17:04     ` Vladimir Davydov
2015-01-26 17:04       ` Vladimir Davydov
2015-01-26 18:26       ` Christoph Lameter
2015-01-26 18:26         ` Christoph Lameter
2015-01-26 19:48         ` Vladimir Davydov
2015-01-26 19:48           ` Vladimir Davydov
2015-01-26 19:55           ` Christoph Lameter
2015-01-26 19:55             ` Christoph Lameter
2015-01-26 20:16             ` Vladimir Davydov
2015-01-26 20:16               ` Vladimir Davydov
2015-01-26 20:28               ` Christoph Lameter
2015-01-26 20:28                 ` Christoph Lameter
2015-01-26 20:43                 ` Vladimir Davydov [this message]
2015-01-26 20:43                   ` Vladimir Davydov
2015-01-26 12:55 ` [PATCH -mm 3/3] slub: make dead caches discard free slabs immediately Vladimir Davydov
2015-01-26 12:55   ` Vladimir Davydov
2015-01-27  8:00   ` Joonsoo Kim
2015-01-27  8:00     ` Joonsoo Kim
2015-01-27  8:23     ` Vladimir Davydov
2015-01-27  8:23       ` Vladimir Davydov
2015-01-27  9:21       ` Joonsoo Kim
2015-01-27  9:21         ` Joonsoo Kim
2015-01-27  9:28         ` Vladimir Davydov
2015-01-27  9:28           ` Vladimir Davydov

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=20150126204318.GB3317@esperanza \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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.