Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-core: remove repeated wq flags
@ 2024-10-30  6:47 Chaitanya Kulkarni
  2024-10-30 13:52 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2024-10-30  6:47 UTC (permalink / raw)
  To: linux-nvme; +Cc: kbusch, hch, sagi, Chaitanya Kulkarni

In nvme_core_init() nvme_wq, nvme_reset_wq, nvme_delete_wq share same
flags :- WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS.

Insated of repeating these flags in each call use the common variable.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/host/core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 84cb859a911d..e9aac07f4c26 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -5009,22 +5009,20 @@ static inline void _nvme_check_size(void)
 
 static int __init nvme_core_init(void)
 {
+	unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS;
 	int result = -ENOMEM;
 
 	_nvme_check_size();
 
-	nvme_wq = alloc_workqueue("nvme-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_wq = alloc_workqueue("nvme-wq", wq_flags, 0);
 	if (!nvme_wq)
 		goto out;
 
-	nvme_reset_wq = alloc_workqueue("nvme-reset-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_reset_wq = alloc_workqueue("nvme-reset-wq", wq_flags, 0);
 	if (!nvme_reset_wq)
 		goto destroy_wq;
 
-	nvme_delete_wq = alloc_workqueue("nvme-delete-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_delete_wq = alloc_workqueue("nvme-delete-wq", wq_flags, 0);
 	if (!nvme_delete_wq)
 		goto destroy_reset_wq;
 
-- 
2.40.0



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

* Re: [PATCH] nvme-core: remove repeated wq flags
  2024-10-30  6:47 [PATCH] nvme-core: remove repeated wq flags Chaitanya Kulkarni
@ 2024-10-30 13:52 ` Christoph Hellwig
  2024-10-30 18:34   ` Chaitanya Kulkarni
  2024-10-31  7:03 ` Christoph Hellwig
  2024-11-05 16:44 ` Keith Busch
  2 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2024-10-30 13:52 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, kbusch, hch, sagi

Looks fine, let's hope the flags actually stay the same in the long run :)



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

* Re: [PATCH] nvme-core: remove repeated wq flags
  2024-10-30 13:52 ` Christoph Hellwig
@ 2024-10-30 18:34   ` Chaitanya Kulkarni
  0 siblings, 0 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2024-10-30 18:34 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-nvme@lists.infradead.org, kbusch@kernel.org,
	Chaitanya Kulkarni, sagi@grimberg.me

On 10/30/24 06:52, Christoph Hellwig wrote:
> Looks fine, let's hope the flags actually stay the same in the long run :)
>

Yeah, it will be nice to get rb tag ...

-ck



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

* Re: [PATCH] nvme-core: remove repeated wq flags
  2024-10-30  6:47 [PATCH] nvme-core: remove repeated wq flags Chaitanya Kulkarni
  2024-10-30 13:52 ` Christoph Hellwig
@ 2024-10-31  7:03 ` Christoph Hellwig
  2024-11-05 16:44 ` Keith Busch
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-10-31  7:03 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, kbusch, hch, sagi

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>



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

* Re: [PATCH] nvme-core: remove repeated wq flags
  2024-10-30  6:47 [PATCH] nvme-core: remove repeated wq flags Chaitanya Kulkarni
  2024-10-30 13:52 ` Christoph Hellwig
  2024-10-31  7:03 ` Christoph Hellwig
@ 2024-11-05 16:44 ` Keith Busch
  2 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2024-11-05 16:44 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, sagi

On Tue, Oct 29, 2024 at 11:47:37PM -0700, Chaitanya Kulkarni wrote:
> In nvme_core_init() nvme_wq, nvme_reset_wq, nvme_delete_wq share same
> flags :- WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS.
> 
> Insated of repeating these flags in each call use the common variable.

Thanks, applied to nvme-6.13.


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

end of thread, other threads:[~2024-11-05 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30  6:47 [PATCH] nvme-core: remove repeated wq flags Chaitanya Kulkarni
2024-10-30 13:52 ` Christoph Hellwig
2024-10-30 18:34   ` Chaitanya Kulkarni
2024-10-31  7:03 ` Christoph Hellwig
2024-11-05 16:44 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox