linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai Krakow <kai@kaishome.de>
To: linux-bcache@vger.kernel.org
Cc: Kai Krakow <kai@kaishome.de>, Coly Li <colyli@suse.de>
Subject: [PATCH v4 2/3] bcache: Give btree_io_wq correct semantics again
Date: Fri, 29 Jan 2021 17:40:06 +0100	[thread overview]
Message-ID: <20210129164007.188468-2-kai@kaishome.de> (raw)
In-Reply-To: <20210129164007.188468-1-kai@kaishome.de>

Before killing `btree_io_wq`, the queue was allocated using
`create_singlethread_workqueue()` which has `WQ_MEM_RECLAIM`. After
killing it, it no longer had this property but `system_wq` is not
single threaded.

Let's combine both worlds and make it multi threaded but able to
reclaim memory.

Cc: Coly Li <colyli@suse.de>
Signed-off-by: Kai Krakow <kai@kaishome.de>
---
 drivers/md/bcache/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 952f022db5a5f..fe6dce125aba2 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -2775,7 +2775,7 @@ void bch_btree_exit(void)
 
 int __init bch_btree_init(void)
 {
-	btree_io_wq = create_singlethread_workqueue("bch_btree_io");
+	btree_io_wq = alloc_workqueue("bch_btree_io", WQ_MEM_RECLAIM, 0);
 	if (!btree_io_wq)
 		return -ENOMEM;
 
-- 
2.26.2


  reply	other threads:[~2021-01-29 16:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 13:23 Fix degraded system performance due to workqueue overload Kai Krakow
2021-01-27 13:23 ` [PATCH 1/2] Revert "bcache: Kill btree_io_wq" Kai Krakow
2021-01-27 16:28   ` Kai Krakow
2021-01-27 13:23 ` [PATCH 2/2] bcache: Move journal work to new background wq Kai Krakow
2021-01-27 16:28   ` Kai Krakow
2021-01-27 15:27 ` Fix degraded system performance due to workqueue overload Coly Li
2021-01-27 16:39 ` [PATCH 1/2] Revert "bcache: Kill btree_io_wq" Kai Krakow
2021-01-27 16:39   ` [PATCH 2/2] bcache: Move journal work to new background wq Kai Krakow
2021-01-28 10:09 ` Fix degraded system performance due to workqueue overload Kai Krakow
2021-01-28 10:50 ` [PATCH v2 1/2] Revert "bcache: Kill btree_io_wq" Kai Krakow
2021-01-28 10:50   ` [PATCH v2 2/2] bcache: Move journal work to new background wq Kai Krakow
2021-01-28 16:37     ` Kai Krakow
2021-01-28 16:41       ` Kai Krakow
     [not found]         ` <988ba514-c607-688b-555d-18fbbb069f48@suse.de>
2021-01-29 16:36           ` Kai Krakow
2021-01-28 23:28 ` [PATCH v3 1/3] Revert "bcache: Kill btree_io_wq" Kai Krakow
2021-01-28 23:28   ` [PATCH v3 2/3] bcache: Give btree_io_wq correct semantics again Kai Krakow
2021-01-28 23:28   ` [PATCH v3 3/3] bcache: Move journal work to new background wq Kai Krakow
     [not found]     ` <a52b9107-7e84-0fea-6095-84a9576d7cc4@suse.de>
2021-01-29 16:37       ` Kai Krakow
     [not found]   ` <4fe07714-e5bf-4be3-6023-74b507ee54be@suse.de>
2021-01-29 16:59     ` [PATCH v3 1/3] Revert "bcache: Kill btree_io_wq" Kai Krakow
2021-01-29 16:40 ` [PATCH v4 " Kai Krakow
2021-01-29 16:40   ` Kai Krakow [this message]
2021-01-29 16:40   ` [PATCH v4 3/3] bcache: Move journal work to new flush wq Kai Krakow

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=20210129164007.188468-2-kai@kaishome.de \
    --to=kai@kaishome.de \
    --cc=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    /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).