[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.14] memory: bail from page scrubbing when CPU is no longer online



commit 17810630a023631c7baa7b45ba2cde006304d694
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Mar 5 15:28:30 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Mar 5 15:28:30 2021 +0100

    memory: bail from page scrubbing when CPU is no longer online
    
    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@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 3c9fd69416f8ffc611705fb24dfb383203ddc84f
    master date: 2021-01-29 11:34:37 +0100
---
 xen/common/page_alloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index d9578abb7c..8859fa4fd1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1328,9 +1328,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;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.