All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memory: bail from page scrubbing when CPU is no longer online
@ 2021-01-28 10:35 Jan Beulich
  2021-01-28 10:37 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2021-01-28 10:35 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, George Dunlap, Ian Jackson, Julien Grall,
	Stefano Stabellini, Wei Liu

Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
because of booting into in smt=0 mode), to a degree that the "CPU <n>
still not dead..." messages logged on x86 in 1s intervals can be seen
multiple times. There are no softirqs involved in this process, so
extend the existing preemption check in the scrubbing logic to also exit
when the CPU is no longer observed online.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1324,9 +1324,11 @@ bool scrub_free_pages(void)
                      * Scrub a few (8) pages before becoming eligible for
                      * preemption. But also count non-scrubbing loop iterations
                      * so that we don't get stuck here with an almost clean
-                     * heap.
+                     * heap. Consider the CPU no longer being seen as online as
+                     * a request to preempt immediately, to not unduly delay
+                     * its offlining.
                      */
-                    if ( cnt > 800 && softirq_pending(cpu) )
+                    if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending(cpu)) )
                     {
                         preempt = true;
                         break;


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

* Re: [PATCH] memory: bail from page scrubbing when CPU is no longer online
  2021-01-28 10:35 [PATCH] memory: bail from page scrubbing when CPU is no longer online Jan Beulich
@ 2021-01-28 10:37 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2021-01-28 10:37 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: George Dunlap, Ian Jackson, Julien Grall, Stefano Stabellini, Wei Liu

On 28/01/2021 10:35, Jan Beulich wrote:
> Scrubbing can significantly delay the offlining (parking) of a CPU (e.g.
> because of booting into in smt=0 mode), to a degree that the "CPU <n>
> still not dead..." messages logged on x86 in 1s intervals can be seen
> multiple times. There are no softirqs involved in this process, so
> extend the existing preemption check in the scrubbing logic to also exit
> when the CPU is no longer observed online.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


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

end of thread, other threads:[~2021-01-28 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 10:35 [PATCH] memory: bail from page scrubbing when CPU is no longer online Jan Beulich
2021-01-28 10:37 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.