linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Biao <benbjiang@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Jiang Biao <benbjiang@tencent.com>,
	Bin Lai <robinlai@tencent.com>
Subject: [PATCH] mm/vmstat.c: erase latency in vmstat_shepherd
Date: Mon, 11 Jan 2021 11:55:26 +0800	[thread overview]
Message-ID: <20210111035526.1511-1-benbjiang@tencent.com> (raw)

From: Jiang Biao <benbjiang@tencent.com>

Many 100us+ latencies have been deteceted in vmstat_shepherd()
on CPX platform which has 208 logic cpus. And vmstat_shepherd is
queued every second, which could make the case worse.

Add schedule point in vmstat_shepherd() to erase the latency.

Signed-off-by: Jiang Biao <benbjiang@tencent.com>
Reported-by: Bin Lai <robinlai@tencent.com>
---
 mm/vmstat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index f8942160fc95..b538199883b5 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1953,6 +1953,8 @@ static void vmstat_shepherd(struct work_struct *w)
 
 		if (!delayed_work_pending(dw) && need_update(cpu))
 			queue_delayed_work_on(cpu, mm_percpu_wq, dw, 0);
+
+		cond_resched();
 	}
 	put_online_cpus();
 
-- 
2.21.0



                 reply	other threads:[~2021-01-11  3:56 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=20210111035526.1511-1-benbjiang@tencent.com \
    --to=benbjiang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=benbjiang@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=robinlai@tencent.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