linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: qiwuchen55@gmail.com
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	chenqiwu <chenqiwu@xiaomi.com>
Subject: [RESEND PATCH] fput: Use unbound workqueue for scheduling delayed fput works
Date: Tue, 17 Dec 2019 23:11:12 +0800	[thread overview]
Message-ID: <1576595472-27341-1-git-send-email-qiwuchen55@gmail.com> (raw)

From: chenqiwu <chenqiwu@xiaomi.com>

There is a potential starvation that the number of delayed fput works
increase rapidly if task exit storm or fs unmount issue happens.

Since the delayed fput works are expected to be executed as soon as
possible. The commonly accepted wisdom that the measurements of scheduling
works via the unbound workqueue show lowered worst-case latency responses
of up to 5x over bound workqueue.

Work items queued to an unbound wq are not bound to any specific CPU, not
concurrency managed. All queued works are executed immediately as long as
max_active limit is not reached and resources are available.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 fs/file_table.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index 30d55c9..472ad92 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -348,7 +348,8 @@ void fput_many(struct file *file, unsigned int refs)
 		}
 
 		if (llist_add(&file->f_u.fu_llist, &delayed_fput_list))
-			schedule_delayed_work(&delayed_fput_work, 1);
+			queue_delayed_work(system_unbound_wq,
+					&delayed_fput_work, 1);
 	}
 }
 
-- 
1.9.1


             reply	other threads:[~2019-12-17 15:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 15:11 qiwuchen55 [this message]
2019-12-17 15:30 ` [RESEND PATCH] fput: Use unbound workqueue for scheduling delayed fput works Al Viro

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=1576595472-27341-1-git-send-email-qiwuchen55@gmail.com \
    --to=qiwuchen55@gmail.com \
    --cc=chenqiwu@xiaomi.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).