diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 22:57:31 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 22:57:31 -0500 |
| commit | ab2d92ad881da11331280aedf612d82e61cb6d41 (patch) | |
| tree | ea1bc914b9dfc510b7ea7ec21219f0f831c442cc /include/uapi/linux | |
| parent | 4b0dda4f86c5c87698f7228a4f65ef834dc79252 (diff) | |
| parent | 82845079160817cc6ac64e5321bbd935e0a47b3a (diff) | |
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
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/membarrier.h | 74 |
1 files changed, 66 insertions, 8 deletions
diff --git a/include/uapi/linux/membarrier.h b/include/uapi/linux/membarrier.h index 4e01ad7ffe98..5891d7614c8c 100644 --- a/include/uapi/linux/membarrier.h +++ b/include/uapi/linux/membarrier.h | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | * enum membarrier_cmd - membarrier system call command | 31 | * enum membarrier_cmd - membarrier system call command |
| 32 | * @MEMBARRIER_CMD_QUERY: Query the set of supported commands. It returns | 32 | * @MEMBARRIER_CMD_QUERY: Query the set of supported commands. It returns |
| 33 | * a bitmask of valid commands. | 33 | * a bitmask of valid commands. |
| 34 | * @MEMBARRIER_CMD_SHARED: Execute a memory barrier on all running threads. | 34 | * @MEMBARRIER_CMD_GLOBAL: Execute a memory barrier on all running threads. |
| 35 | * Upon return from system call, the caller thread | 35 | * Upon return from system call, the caller thread |
| 36 | * is ensured that all running threads have passed | 36 | * is ensured that all running threads have passed |
| 37 | * through a state where all memory accesses to | 37 | * through a state where all memory accesses to |
| @@ -40,6 +40,28 @@ | |||
| 40 | * (non-running threads are de facto in such a | 40 | * (non-running threads are de facto in such a |
| 41 | * state). This covers threads from all processes | 41 | * state). This covers threads from all processes |
| 42 | * running on the system. This command returns 0. | 42 | * running on the system. This command returns 0. |
| 43 | * @MEMBARRIER_CMD_GLOBAL_EXPEDITED: | ||
| 44 | * Execute a memory barrier on all running threads | ||
| 45 | * of all processes which previously registered | ||
| 46 | * with MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED. | ||
| 47 | * Upon return from system call, the caller thread | ||
| 48 | * is ensured that all running threads have passed | ||
| 49 | * through a state where all memory accesses to | ||
| 50 | * user-space addresses match program order between | ||
| 51 | * entry to and return from the system call | ||
| 52 | * (non-running threads are de facto in such a | ||
| 53 | * state). This only covers threads from processes | ||
| 54 | * which registered with | ||
| 55 | * MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED. | ||
| 56 | * This command returns 0. Given that | ||
| 57 | * registration is about the intent to receive | ||
| 58 | * the barriers, it is valid to invoke | ||
| 59 | * MEMBARRIER_CMD_GLOBAL_EXPEDITED from a | ||
| 60 | * non-registered process. | ||
| 61 | * @MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: | ||
| 62 | * Register the process intent to receive | ||
| 63 | * MEMBARRIER_CMD_GLOBAL_EXPEDITED memory | ||
| 64 | * barriers. Always returns 0. | ||
| 43 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED: | 65 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED: |
| 44 | * Execute a memory barrier on each running | 66 | * Execute a memory barrier on each running |
| 45 | * thread belonging to the same process as the current | 67 | * thread belonging to the same process as the current |
| @@ -51,7 +73,7 @@ | |||
| 51 | * to and return from the system call | 73 | * to and return from the system call |
| 52 | * (non-running threads are de facto in such a | 74 | * (non-running threads are de facto in such a |
| 53 | * state). This only covers threads from the | 75 | * state). This only covers threads from the |
| 54 | * same processes as the caller thread. This | 76 | * same process as the caller thread. This |
| 55 | * command returns 0 on success. The | 77 | * command returns 0 on success. The |
| 56 | * "expedited" commands complete faster than | 78 | * "expedited" commands complete faster than |
| 57 | * the non-expedited ones, they never block, | 79 | * the non-expedited ones, they never block, |
| @@ -64,18 +86,54 @@ | |||
| 64 | * Register the process intent to use | 86 | * Register the process intent to use |
| 65 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED. Always | 87 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED. Always |
| 66 | * returns 0. | 88 | * returns 0. |
| 89 | * @MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: | ||
| 90 | * In addition to provide memory ordering | ||
| 91 | * guarantees described in | ||
| 92 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED, ensure | ||
| 93 | * the caller thread, upon return from system | ||
| 94 | * call, that all its running threads siblings | ||
| 95 | * have executed a core serializing | ||
| 96 | * instruction. (architectures are required to | ||
| 97 | * guarantee that non-running threads issue | ||
| 98 | * core serializing instructions before they | ||
| 99 | * resume user-space execution). This only | ||
| 100 | * covers threads from the same process as the | ||
| 101 | * caller thread. This command returns 0 on | ||
| 102 | * success. The "expedited" commands complete | ||
| 103 | * faster than the non-expedited ones, they | ||
| 104 | * never block, but have the downside of | ||
| 105 | * causing extra overhead. If this command is | ||
| 106 | * not implemented by an architecture, -EINVAL | ||
| 107 | * is returned. A process needs to register its | ||
| 108 | * intent to use the private expedited sync | ||
| 109 | * core command prior to using it, otherwise | ||
| 110 | * this command returns -EPERM. | ||
| 111 | * @MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: | ||
| 112 | * Register the process intent to use | ||
| 113 | * MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE. | ||
| 114 | * If this command is not implemented by an | ||
| 115 | * architecture, -EINVAL is returned. | ||
| 116 | * Returns 0 on success. | ||
| 117 | * @MEMBARRIER_CMD_SHARED: | ||
| 118 | * Alias to MEMBARRIER_CMD_GLOBAL. Provided for | ||
| 119 | * header backward compatibility. | ||
| 67 | * | 120 | * |
| 68 | * Command to be passed to the membarrier system call. The commands need to | 121 | * Command to be passed to the membarrier system call. The commands need to |
| 69 | * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to | 122 | * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to |
| 70 | * the value 0. | 123 | * the value 0. |
| 71 | */ | 124 | */ |
| 72 | enum membarrier_cmd { | 125 | enum membarrier_cmd { |
| 73 | MEMBARRIER_CMD_QUERY = 0, | 126 | MEMBARRIER_CMD_QUERY = 0, |
| 74 | MEMBARRIER_CMD_SHARED = (1 << 0), | 127 | MEMBARRIER_CMD_GLOBAL = (1 << 0), |
| 75 | /* reserved for MEMBARRIER_CMD_SHARED_EXPEDITED (1 << 1) */ | 128 | MEMBARRIER_CMD_GLOBAL_EXPEDITED = (1 << 1), |
| 76 | /* reserved for MEMBARRIER_CMD_PRIVATE (1 << 2) */ | 129 | MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED = (1 << 2), |
| 77 | MEMBARRIER_CMD_PRIVATE_EXPEDITED = (1 << 3), | 130 | MEMBARRIER_CMD_PRIVATE_EXPEDITED = (1 << 3), |
| 78 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4), | 131 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = (1 << 4), |
| 132 | MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 5), | ||
| 133 | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6), | ||
| 134 | |||
| 135 | /* Alias for header backward compatibility. */ | ||
| 136 | MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL, | ||
| 79 | }; | 137 | }; |
| 80 | 138 | ||
| 81 | #endif /* _UAPI_LINUX_MEMBARRIER_H */ | 139 | #endif /* _UAPI_LINUX_MEMBARRIER_H */ |
