mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: linux-mm@kvack.org, Baoquan He <bhe@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>, Dev Jain <dev.jain@arm.com>,
	lirongqing <lirongqing@baidu.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH RESEND] mm/vmalloc: Use dedicated unbound workqueues for vmap drain
Date: Wed, 16 Sep 2026 08:12:27 +0800	[thread overview]
Message-ID: <20260916001228.644-1-hdanton@sina.com> (raw)
In-Reply-To: <aqgnOoOjWxRtaqxZ@milan>

On Mon, 14 Sep 2026 18:56:26 +0200 "Uladzislau Rezki (Sony)" wrote:
> This patch does not use queue_work_on() semantic thus i do not want to
> queue all helpers on current CPU. Instead scheduler does balancing and
> that is it.
> 
[Fair queue in the Eric Dumazet accent]

+static bool
+schedule_drain_vmap_work(struct workqueue_struct *wq,
+		struct work_struct *work)
+{
+	if (wq)
+		return queue_work(wq, work);
+
+	return false;
+}
+

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/workqueue.h#n697

static inline bool queue_work(struct workqueue_struct *wq,
			      struct work_struct *work)
{
	return queue_work_on(WORK_CPU_UNBOUND, wq, work);
}

queue_work_on
  __queue_work
	if (req_cpu == WORK_CPU_UNBOUND) {
		if (wq->flags & WQ_UNBOUND)
			cpu = wq_select_unbound_cpu(raw_smp_processor_id());
		else
			cpu = raw_smp_processor_id();
	}
/*
 * When queueing an unbound work item to a wq, prefer local CPU if allowed
 * by wq_unbound_cpumask.  Otherwise, round robin among the allowed ones to
 * avoid perturbing sensitive tasks.
 */
static int wq_select_unbound_cpu(int cpu)
{
 	pr_warn_once("workqueue: round-robin CPU selection forced, expect performance impact\n");
}

> Or you prefer to tight all helpers on local CPUs? What is you concern?

Who blamed kswapd when it became a cpu hog, given it behaves the same way as
a UNBOUND workqueue worker, regarding cpu affinity? Given kswapd is acceptable,
why is vmap work blamed? Unfair.

  reply	other threads:[~2026-09-16  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05 15:27 Uladzislau Rezki (Sony)
2026-09-05 22:37 ` Andrew Morton
2026-09-08 14:23   ` Uladzislau Rezki
2026-09-06  3:50 ` Hillf Danton
2026-09-08 14:21   ` Uladzislau Rezki
2026-09-09  1:08     ` Hillf Danton
2026-09-14 16:56       ` Uladzislau Rezki
2026-09-16  0:12         ` Hillf Danton [this message]
2026-09-10  8:33 ` Ye Liu

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=20260916001228.644-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lirongqing@baidu.com \
    --cc=urezki@gmail.com \
    /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®