[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fda44f45fe5aea109ccc3e20c7e583b4b649a728.camel@gmx.de>
Date: Wed, 30 Oct 2024 07:30:24 +0100
From: Mike Galbraith <efault@....de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Ryan Roberts <ryan.roberts@....com>
Subject: Re: regression: mm: vmscan: - size XL irqoff time increase v6.10+
On Tue, 2024-10-29 at 13:03 +0100, Mike Galbraith wrote:
> Greetings,
>
> I've noticed size XL cyclictest -Smp99 wakeup latency spikes for some
> time now, but due to bandwidth etc (ie laziness), never got around to
> taking a peek until today.
isolate_lru_folios() dropped off the irqsoff radar with the below.
mm: vmscan: Limit isolate_lru_folios() IRQ holdoff latency impact.
While examining an RT latency regression beginning at v6.10, it was
discovered that isolate_lru_folios() runtimes could cause IRQ holdoff
to easily span several ticks.
Given it's called with IRQs disabled, cap its runtme to around a ms.
Signed-off-by: Mike Galbraith <efault@....de>
---
mm/vmscan.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -63,6 +63,7 @@
#include <linux/swapops.h>
#include <linux/balloon_compaction.h>
#include <linux/sched/sysctl.h>
+#include <linux/sched/clock.h>
#include "internal.h"
#include "swap.h"
@@ -1656,6 +1657,8 @@ static unsigned long isolate_lru_folios(
unsigned long nr_skipped[MAX_NR_ZONES] = { 0, };
unsigned long skipped = 0;
unsigned long scan, total_scan, nr_pages;
+ int cpu = raw_smp_processor_id(), iter = 0;
+ u64 then = cpu_clock(cpu);
LIST_HEAD(folios_skipped);
total_scan = 0;
@@ -1709,6 +1712,15 @@ static unsigned long isolate_lru_folios(
move_to = dst;
move:
list_move(&folio->lru, move_to);
+
+ /*
+ * IRQs are disabled, cap holdoff at a millisecond or so.
+ */
+ if (iter++ < 1000)
+ continue;
+ if (cpu_clock(cpu) - then > NSEC_PER_MSEC)
+ break;
+ iter = 0;
}
/*
Powered by blists - more mailing lists