[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker
- To: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
- From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- Date: Mon, 24 Jul 2023 14:25:49 +0200
- Cc: akpm@xxxxxxxxxxxxxxxxxxxx, david@xxxxxxxxxxxxx, tkhai@xxxxx, vbabka@xxxxxxx, roman.gushchin@xxxxxxxxx, djwong@xxxxxxxxxx, brauner@xxxxxxxxxx, paulmck@xxxxxxxxxx, tytso@xxxxxxx, steven.price@xxxxxxx, cel@xxxxxxxxxx, senozhatsky@xxxxxxxxxxxx, yujie.liu@xxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, muchun.song@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, x86@xxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-erofs@xxxxxxxxxxxxxxxx, linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, rcu@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-raid@xxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx
- Delivery-date: Mon, 24 Jul 2023 12:26:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote:
> +void shrinker_unregister(struct shrinker *shrinker)
> +{
> + struct dentry *debugfs_entry;
> + int debugfs_id;
> +
> + if (!shrinker || !(shrinker->flags & SHRINKER_REGISTERED))
> + return;
> +
> + down_write(&shrinker_rwsem);
> + list_del(&shrinker->list);
> + shrinker->flags &= ~SHRINKER_REGISTERED;
> + if (shrinker->flags & SHRINKER_MEMCG_AWARE)
> + unregister_memcg_shrinker(shrinker);
> + debugfs_entry = shrinker_debugfs_detach(shrinker, &debugfs_id);
> + up_write(&shrinker_rwsem);
> +
> + shrinker_debugfs_remove(debugfs_entry, debugfs_id);
Should there not be an rcu_barrier() right about here?
> +
> + kfree(shrinker->nr_deferred);
> + shrinker->nr_deferred = NULL;
> +
> + kfree(shrinker);
> +}
> +EXPORT_SYMBOL(shrinker_unregister);
|