From: Coly Li Date: Thu, 9 Apr 2020 14:17:23 +0000 (+0800) Subject: md: remove redundant memalloc scope API usage X-Git-Tag: v5.15~3749^2~23^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3024ba2d6c5573b4797e62006d98f17f47f7d103;p=platform%2Fkernel%2Flinux-starfive.git md: remove redundant memalloc scope API usage In mddev_create_serial_pool(), memalloc scope APIs memalloc_noio_save() and memalloc_noio_restore() are used when allocating memory by calling mempool_create_kmalloc_pool(). After adding the memalloc scope APIs in raid array suspend context, it is unncessary to explicitly call them around mempool_create_kmalloc_pool() any longer. This patch removes the redundant memalloc scope APIs in mddev_create_serial_pool(). Signed-off-by: Coly Li Cc: Guoqing Jiang Signed-off-by: Song Liu --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 1b3316c..7b2ac5f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -228,13 +228,13 @@ void mddev_create_serial_pool(struct mddev *mddev, struct md_rdev *rdev, goto abort; if (mddev->serial_info_pool == NULL) { - unsigned int noio_flag; - - noio_flag = memalloc_noio_save(); + /* + * already in memalloc noio context by + * mddev_suspend() + */ mddev->serial_info_pool = mempool_create_kmalloc_pool(NR_SERIAL_INFOS, sizeof(struct serial_info)); - memalloc_noio_restore(noio_flag); if (!mddev->serial_info_pool) { rdevs_uninit_serial(mddev); pr_err("can't alloc memory pool for serialization\n");