From: Rafael Aquini <aquini@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Waiman Long <longman@redhat.com>,
Rafael Aquini <raquini@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/slab_common: fix slab_caches list corruption after kmem_cache_destroy()
Date: Fri, 8 Sep 2023 21:51:21 -0400 [thread overview]
Message-ID: <ZPvPmU9vBXQoFBm4@x1-fbsd.aquini.net> (raw)
In-Reply-To: <ZPvHUK95S6Dgl86v@casper.infradead.org>
On Sat, Sep 09, 2023 at 02:16:00AM +0100, Matthew Wilcox wrote:
> On Fri, Sep 08, 2023 at 07:06:49PM -0400, Rafael Aquini wrote:
> > This patch fixes this issue by properly checking shutdown_cache()'s
> > return value before taking the kmem_cache_release() branch.
>
> Is this the right way to fix this problem? If the module destroys the
> slab cache, it's not going to be possible to free any of the objects
> still allocated from the cache. I feel that we should treat this as
> implicitly freeing all the objects that were allocated from the cache
> rather than saying the cache is still busy.
>
Leaving the cache with the unfreeable slabs "alone" is how it was historically
done, and we have to fix this corner case opened by 0495e337b703 this way to
address the corruption on stable releases without changing their established
and expected behavior.
I think your proposal for a different behavior upon cache destruction is
something we should discuss for future releases, but it is orthogonal to
this required follow-up fix.
next prev parent reply other threads:[~2023-09-09 1:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 23:06 [PATCH] mm/slab_common: fix slab_caches list corruption after kmem_cache_destroy() Rafael Aquini
2023-09-08 23:21 ` Waiman Long
2023-09-09 1:16 ` Matthew Wilcox
2023-09-09 1:51 ` Rafael Aquini [this message]
2023-09-11 15:06 ` Vlastimil Babka
2023-09-11 16:47 ` Rafael Aquini
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=ZPvPmU9vBXQoFBm4@x1-fbsd.aquini.net \
--to=aquini@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=raquini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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.