• C
    locking/core, stop_machine: Yield the CPU during stop machine() · bf0d31c0
    Christian Borntraeger 提交于
    Some time ago the following commit:
    
      57f2ffe1 ("s390: remove diag 44 calls from cpu_relax()")
    
    ... stopped cpu_relax() on s390 yielding to the hypervisor.
    
    As it turns out this made stop_machine() run really slow on virtualized
    overcommited systems. For example the kprobes test during bootup took
    several seconds instead of just running unnoticed with large guests.
    
    Therefore, yielding was reintroduced with commit:
    
      4d92f502 ("s390: reintroduce diag 44 calls for cpu_relax()")
    
    ... but in fact the stop machine code seems to be the only place where
    this yielding was really necessary. This place is probably the most
    important one as it makes all but one guest CPUs wait for one guest CPU.
    
    As we now have cpu_relax_yield(), we can use this in multi_cpu_stop().
    For now lets only add it here. We can add it later in other places
    when necessary.
    Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: Noam Camus <noamc@ezchip.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Russell King <linux@armlinux.org.uk>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: virtualization@lists.linux-foundation.org
    Cc: xen-devel@lists.xenproject.org
    Link: http://lkml.kernel.org/r/1477386195-32736-3-git-send-email-borntraeger@de.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
    bf0d31c0
stop_machine.c 17.1 KB