mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haifeng Xu <haifeng.xu@shopee.com>
To: brauner@kernel.org
Cc: ebiederm@xmission.com, tglx@linutronix.de, luto@kernel.org,
	bigeasy@linutronix.de, akpm@linux-foundation.org,
	fenghua.yu@intel.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org, Haifeng Xu <haifeng.xu@shopee.com>
Subject: [PATCH] fork: Avoid inherit PF_IO_WORKER flag
Date: Thu, 15 Dec 2022 02:01:22 +0000	[thread overview]
Message-ID: <20221215020122.762684-1-haifeng.xu@shopee.com> (raw)

copy_process examines arguments in kernel_clone_args to see if
PF_IO_WORKER need to be set, so the flag should not inherit from
parent process.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
 kernel/fork.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/fork.c b/kernel/fork.c
index 947eb1a6399a..50498e5d10dd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2088,6 +2088,7 @@ static __latent_entropy struct task_struct *copy_process(
 	p->flags &= ~PF_KTHREAD;
 	if (args->kthread)
 		p->flags |= PF_KTHREAD;
+	p->flags &= ~PF_IO_WORKER;
 	if (args->io_thread) {
 		/*
 		 * Mark us an IO worker, and block any signal that isn't
-- 
2.25.1


                 reply	other threads:[~2022-12-15  2:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221215020122.762684-1-haifeng.xu@shopee.com \
    --to=haifeng.xu@shopee.com \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®