-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm…
…/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: - membarrier updates (Mathieu Desnoyers) - SMP balancing optimizations (Mel Gorman) - stats update optimizations (Peter Zijlstra) - RT scheduler race fixes (Steven Rostedt) - misc fixes and updates * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Use a recently used CPU as an idle candidate and the basis for SIS sched/fair: Do not migrate if the prev_cpu is idle sched/fair: Restructure wake_affine*() to return a CPU id sched/fair: Remove unnecessary parameters from wake_affine_idle() sched/rt: Make update_curr_rt() more accurate sched/rt: Up the root domain ref count when passing it around via IPIs sched/rt: Use container_of() to get root domain in rto_push_irq_work_func() sched/core: Optimize update_stats_*() sched/core: Optimize ttwu_stat() membarrier/selftest: Test private expedited sync core command membarrier/arm64: Provide core serializing command membarrier/x86: Provide core serializing command membarrier: Provide core serializing command, *_SYNC_CORE lockin/x86: Implement sync_core_before_usermode() locking: Introduce sync_core_before_usermode() membarrier/selftest: Test global expedited command membarrier: Provide GLOBAL_EXPEDITED command membarrier: Document scheduler barrier requirements powerpc, membarrier: Skip memory barrier in switch_mm() membarrier/selftest: Test private expedited command
- Loading branch information
Showing
25 changed files
with
750 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef _ASM_POWERPC_MEMBARRIER_H | ||
#define _ASM_POWERPC_MEMBARRIER_H | ||
|
||
static inline void membarrier_arch_switch_mm(struct mm_struct *prev, | ||
struct mm_struct *next, | ||
struct task_struct *tsk) | ||
{ | ||
/* | ||
* Only need the full barrier when switching between processes. | ||
* Barrier when switching from kernel to userspace is not | ||
* required here, given that it is implied by mmdrop(). Barrier | ||
* when switching from userspace to kernel is not needed after | ||
* store to rq->curr. | ||
*/ | ||
if (likely(!(atomic_read(&next->membarrier_state) & | ||
(MEMBARRIER_STATE_PRIVATE_EXPEDITED | | ||
MEMBARRIER_STATE_GLOBAL_EXPEDITED)) || !prev)) | ||
return; | ||
|
||
/* | ||
* The membarrier system call requires a full memory barrier | ||
* after storing to rq->curr, before going back to user-space. | ||
*/ | ||
smp_mb(); | ||
} | ||
|
||
#endif /* _ASM_POWERPC_MEMBARRIER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_X86_SYNC_CORE_H | ||
#define _ASM_X86_SYNC_CORE_H | ||
|
||
#include <linux/preempt.h> | ||
#include <asm/processor.h> | ||
#include <asm/cpufeature.h> | ||
|
||
/* | ||
* Ensure that a core serializing instruction is issued before returning | ||
* to user-mode. x86 implements return to user-space through sysexit, | ||
* sysrel, and sysretq, which are not core serializing. | ||
*/ | ||
static inline void sync_core_before_usermode(void) | ||
{ | ||
/* With PTI, we unconditionally serialize before running user code. */ | ||
if (static_cpu_has(X86_FEATURE_PTI)) | ||
return; | ||
/* | ||
* Return from interrupt and NMI is done through iret, which is core | ||
* serializing. | ||
*/ | ||
if (in_irq() || in_nmi()) | ||
return; | ||
sync_core(); | ||
} | ||
|
||
#endif /* _ASM_X86_SYNC_CORE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _LINUX_SYNC_CORE_H | ||
#define _LINUX_SYNC_CORE_H | ||
|
||
#ifdef CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE | ||
#include <asm/sync_core.h> | ||
#else | ||
/* | ||
* This is a dummy sync_core_before_usermode() implementation that can be used | ||
* on all architectures which return to user-space through core serializing | ||
* instructions. | ||
* If your architecture returns to user-space through non-core-serializing | ||
* instructions, you need to write your own functions. | ||
*/ | ||
static inline void sync_core_before_usermode(void) | ||
{ | ||
} | ||
#endif | ||
|
||
#endif /* _LINUX_SYNC_CORE_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.