linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: ioprio: Replace GFP_ATOMIC with GFP_KERNEL in set_task_ioprio()
@ 2018-07-23  2:21 Jia-Ju Bai
  2018-07-23  7:18 ` Christoph Hellwig
  2018-07-24  7:47 ` [LKP] [block] 8448e82606: WARNING:suspicious_RCU_usage kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Jia-Ju Bai @ 2018-07-23  2:21 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, Jia-Ju Bai

set_task_ioprio() is only called by SYSCALL_DEFINE3(), ext4_fill_super(),
ext4_remount() and reada_start_machine_worker().
And these functions are not called in atomic context.

set_task_ioprio() calls get_task_io_context with GFP_ATOMIC, which is
unnecessary. GFP_ATOMIC can be replaced with GFP_KERNEL.

This is found by a static analysis tool named DCNS written by myself.
I also manually check the kernel code before reporting it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 block/ioprio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/ioprio.c b/block/ioprio.c
index 6f5d0b6625e3..42d91ee7080f 100644
--- a/block/ioprio.c
+++ b/block/ioprio.c
@@ -51,7 +51,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio)
 	if (err)
 		return err;
 
-	ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
+	ioc = get_task_io_context(task, GFP_KERNEL, NUMA_NO_NODE);
 	if (ioc) {
 		ioc->ioprio = ioprio;
 		put_io_context(ioc);
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-24  7:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23  2:21 [PATCH] block: ioprio: Replace GFP_ATOMIC with GFP_KERNEL in set_task_ioprio() Jia-Ju Bai
2018-07-23  7:18 ` Christoph Hellwig
2018-07-23 12:59   ` Jia-Ju Bai
2018-07-23 21:49   ` Tetsuo Handa
2018-07-24  1:42     ` Jia-Ju Bai
2018-07-24  7:47 ` [LKP] [block] 8448e82606: WARNING:suspicious_RCU_usage kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).