[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2E63E088-10D8-4343-BB78-27D2ABFB95E7@vmware.com>
Date: Thu, 24 Aug 2023 15:28:54 +0000
From: Nadav Amit <namit@...are.com>
To: Qi Zheng <zhengqi.arch@...edance.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
"david@...morbit.com" <david@...morbit.com>,
"tkhai@...ru" <tkhai@...ru>, "vbabka@...e.cz" <vbabka@...e.cz>,
"roman.gushchin@...ux.dev" <roman.gushchin@...ux.dev>,
"djwong@...nel.org" <djwong@...nel.org>,
"brauner@...nel.org" <brauner@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
"tytso@....edu" <tytso@....edu>,
"steven.price@....com" <steven.price@....com>,
"cel@...nel.org" <cel@...nel.org>,
"senozhatsky@...omium.org" <senozhatsky@...omium.org>,
"yujie.liu@...el.com" <yujie.liu@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Muchun Song <muchun.song@...ux.dev>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Muchun Song <songmuchun@...edance.com>,
Pv-drivers <Pv-drivers@...are.com>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v5 27/45] vmw_balloon: dynamically allocate the
vmw-balloon shrinker
> On Aug 23, 2023, at 8:42 PM, Qi Zheng <zhengqi.arch@...edance.com> wrote:
>
> In preparation for implementing lockless slab shrink, use new APIs to
> dynamically allocate the vmw-balloon shrinker, so that it can be freed
> asynchronously via RCU. Then it doesn't need to wait for RCU read-side
> critical section when releasing the struct vmballoon.
>
> And we can simply exit vmballoon_init() when registering the shrinker
> fails. So the shrinker_registered indication is redundant, just remove it.
...
Ugh. We should have already moved to OOM notifier instead...
> static void vmballoon_unregister_shrinker(struct vmballoon *b)
> {
> - if (b->shrinker_registered)
> - unregister_shrinker(&b->shrinker);
> - b->shrinker_registered = false;
> + shrinker_free(b->shrinker);
> }
If the patch goes through another iteration, please add:
b->shrinker = NULL;
Not that this is a real issue, but I prefer it so in order to more easily
identify UAF if the function is called elsewhere.
Otherwise, LGTM. Thanks.
Powered by blists - more mailing lists