[PATCH v8 -tip 06/26] sched: Add core wide task selection and scheduling.

2020-10-19 Thread Joel Fernandes (Google)
. This can confuse the logic. Add a retry logic if smt_mask changes between the loops. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Julien Desfossez Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Joel Fernandes (Google) Signed-off-by: Aaron Lu Signed

[PATCH v8 -tip 03/26] sched: Core-wide rq->lock

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Introduce the basic infrastructure to have a core wide rq->lock. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Julien Desfossez Signed-off-by: Vineeth Remanan Pillai --- kernel/Kconfig.preempt | 6 +++ kernel/sched/core.c| 109

[PATCH v8 -tip 10/26] sched: migration changes for core scheduling

2020-10-19 Thread Joel Fernandes (Google)
From: Aubrey Li - Don't migrate if there is a cookie mismatch Load balance tries to move task from busiest CPU to the destination CPU. When core scheduling is enabled, if the task's cookie does not match with the destination CPU's core cookie, this task will be skipped by

[PATCH v8 -tip 04/26] sched/fair: Add a few assertions

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bd6aed63f5e3..b4bc82f46fe7 100644 ---

[PATCH v8 -tip 13/26] kernel/entry: Add support for core-wide protection of kernel-mode

2020-10-19 Thread Joel Fernandes (Google)
-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/kernel-parameters.txt | 7 + include/linux/entry-common.h | 2 +- include/linux/sched.h | 12 + kernel/entry/common.c | 25 +- kernel/sched/core.c

[PATCH v8 -tip 05/26] sched: Basic tracking of matching tasks

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra Introduce task_struct::core_cookie as an opaque identifier for core scheduling. When enabled; core scheduling will only allow matching task to be on the core; where idle matches everything. When task_struct::core_cookie is set (and core scheduling is enabled) these tasks

[PATCH v8 -tip 08/26] sched/fair: Snapshot the min_vruntime of CPUs on force idle

2020-10-19 Thread Joel Fernandes (Google)
usecase. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 33 - kernel/sched/fair.c | 40 kernel/sched/sched.h | 5 + 3 files changed, 65 insertions(+), 13 deletions(-) diff

[PATCH v8 -tip 14/26] entry/idle: Enter and exit kernel protection during idle entry and exit

2020-10-19 Thread Joel Fernandes (Google)
Add a generic_idle_{enter,exit} helper function to enter and exit kernel protection when entering and exiting idle, respectively. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- include/linux/entry-common.h | 18 ++ kernel/sched/idle.c | 11

[PATCH v8 -tip 12/26] arch/x86: Add a new TIF flag for untrusted tasks

2020-10-19 Thread Joel Fernandes (Google)
. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- arch/x86/include/asm/thread_info.h | 2 ++ kernel/sched/sched.h | 6 ++ 2 files changed, 8 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index c448fcfa1b82

[PATCH v8 -tip 07/26] sched/fair: Fix forced idle sibling starvation corner case

2020-10-19 Thread Joel Fernandes (Google)
From: Vineeth Pillai If there is only one long running local task and the sibling is forced idle, it might not get a chance to run until a schedule event happens on any cpu in the core. So we check for this condition during a tick to see if a sibling is starved and then give it a chance to

[PATCH v8 -tip 02/26] sched: Introduce sched_class::pick_task()

2020-10-19 Thread Joel Fernandes (Google)
(Intel) Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/deadline.c | 16 ++-- kernel/sched/fair.c | 32 +++- kernel/sched/idle.c | 8 kernel/sched/rt.c

[PATCH v8 -tip 01/26] sched: Wrap rq::lock access

2020-10-19 Thread Joel Fernandes (Google)
From: Peter Zijlstra In preparation of playing games with rq->lock, abstract the thing using an accessor. Tested-by: Julien Desfossez Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Julien Desfossez --- kernel/sched/core.c | 46

[PATCH v8 -tip 00/26] Core scheduling

2020-10-19 Thread Joel Fernandes (Google)
- Fix for 32bit build - Aubrey Li Aubrey Li (1): sched: migration changes for core scheduling Joel Fernandes (Google) (13): sched/fair: Snapshot the min_vruntime of CPUs on force idle arch/x86: Add a new TIF flag for untrusted tasks kernel/entry: Add support for core-wide protection of kernel-mode

[PATCH v7 0/6] Add support for length of each segment in the segcblist

2020-10-14 Thread Joel Fernandes (Google)
ues. Fixed minor nit from Davidlohr. v1->v3: minor nits. (https://lore.kernel.org/lkml/20200719034210.2382053-1-joel@xxxxx/) Joel Fernandes (Google) (6): rcu/tree: Make rcu_do_batch count how many callbacks were executed rcu/segcblist: Add counters to segcblist datastructure rcu/trac

[PATCH v7 2/6] rcu/segcblist: Add counters to segcblist datastructure

2020-10-14 Thread Joel Fernandes (Google)
related to using donecbs's ->len field as a temporary variable to save the segmented callback list's length. This cannot be done anymore and is not needed. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c|

[PATCH v7 1/6] rcu/tree: Make rcu_do_batch count how many callbacks were executed

2020-10-14 Thread Joel Fernandes (Google)
from 0 is confusing and error-prone IMHO. This commit therefore explicitly counts how many callbacks were executed in rcu_do_batch() itself, and uses that to update the per-CPU segcb list's ->len field, without relying on the negativity of rcl->len. Signed-off-by: Joel Fernandes (Googl

[PATCH v7 4/6] rcu/segcblist: Remove useless rcupdate.h include

2020-10-14 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c index 2dccbd29cd3a..271d5d9d7f60 100644 --- a/kernel/rcu/rcu_segcblist.c +++ b/kernel/rcu/rcu_segcblist.c @@ -10,7

[PATCH v7 6/6] rcu/segcblist: Add additional comments to explain smp_mb()

2020-10-14 Thread Joel Fernandes (Google)
Memory barriers are needed when updating the full length of the segcblist, however it is not fully clearly why one is needed before and after. This patch therefore adds additional comments to the function header to explain it. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu

[PATCH v7 3/6] rcu/trace: Add tracing for how segcb list changes

2020-10-14 Thread Joel Fernandes (Google)
in the respective segment. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25 + kernel/rcu/rcu_segcblist.c | 31 +++ kernel/rcu/rcu_segcblist.h | 5 + kernel/rcu/tree.c | 9 + 4 files changed, 70 insertions

[PATCH v7 5/6] rcu/tree: Remove redundant smp_mb() in rcu_do_batch

2020-10-14 Thread Joel Fernandes (Google)
This memory barrier is not needed as rcu_segcblist_add_len() already includes a memory barrier. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 346a05506935..6c6d3c7036e6 100644

[tip: core/rcu] rcu/segcblist: Prevent useless GP start if no CBs to accelerate

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 53922270d21de707a1a0ffaf1e07644e77fcb8db Gitweb: https://git.kernel.org/tip/53922270d21de707a1a0ffaf1e07644e77fcb8db Author:Joel Fernandes (Google) AuthorDate:Thu, 18 Jun 2020 16:29:49 -04:00

[tip: core/rcu] rcutorture: Output number of elapsed grace periods

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 959954df0ca7da2111c3fb67a81798d15b9d Gitweb: https://git.kernel.org/tip/959954df0ca7da2111c3fb67a81798d15b9d Author:Joel Fernandes (Google) AuthorDate:Thu, 18 Jun 2020 16:29:55 -04:00

[tip: core/rcu] rcu/trace: Use gp_seq_req in acceleration's rcu_grace_period tracepoint

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: a7886e899fd8334a03d37e66ad10295d175725ea Gitweb: https://git.kernel.org/tip/a7886e899fd8334a03d37e66ad10295d175725ea Author:Joel Fernandes (Google) AuthorDate:Thu, 18 Jun 2020 21:36:40 -04:00

[tip: core/rcu] rcu/trace: Print negative GP numbers correctly

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: c30068f41a0e899f870e0158a2c69c68d738bf96 Gitweb: https://git.kernel.org/tip/c30068f41a0e899f870e0158a2c69c68d738bf96 Author:Joel Fernandes (Google) AuthorDate:Thu, 18 Jun 2020 21:36:39 -04:00

[tip: core/rcu] rcu: Make FQS more aggressive in complaining about offline CPUs

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 666ca2907e6b75960ce2f0fe50afc5d8a46f296d Gitweb: https://git.kernel.org/tip/666ca2907e6b75960ce2f0fe50afc5d8a46f296d Author:Joel Fernandes (Google) AuthorDate:Fri, 07 Aug 2020 13:07:20 -04:00

[tip: core/rcu] rcu: Clarify comments about FQS loop reporting quiescent states

2020-10-09 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: f37599e6f06da47e49c3408afe66c5b6e83a90bd Gitweb: https://git.kernel.org/tip/f37599e6f06da47e49c3408afe66c5b6e83a90bd Author:Joel Fernandes (Google) AuthorDate:Fri, 07 Aug 2020 13:07:19 -04:00

[PATCH v2] rcu/tree: nocb: Avoid raising softirq when there are ready to execute CBs

2020-10-04 Thread Joel Fernandes (Google)
when ready cbs were present, to when the ready callbacks were invoked by the rcuop thread. This also further confirms that there is no need to raise the softirq for ready cbs in the first place. Cc: neer...@codeaurora.org Signed-off-by: Joel Fernandes (Google) --- v1->v2: Also cleaned up anot

[PATCH 1/2] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-09-29 Thread Joel Fernandes (Google)
l E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 55d3700dd1e7..5efe0a98ea45 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4119,7 +4119,9 @@ v

[PATCH 2/2] docs: Update RCU's hotplug requirements with a bit about design

2020-09-29 Thread Joel Fernandes (Google)
is rather incomplete. This commit therefore continues the section by describing how RCU's design handles CPU hotplug in a deadlock-free way. Signed-off-by: Joel Fernandes (Google) --- .../RCU/Design/Requirements/Requirements.rst | 30 +-- 1 file changed, 28 insertions(+), 2

[PATCH] rcu/tree: nocb: Avoid raising softirq when CBs ready to execute

2020-09-28 Thread Joel Fernandes (Google)
-time jitter. Passed 30 minute tests of TREE01 through TREE09 each. Cc: neer...@codeaurora.org Cc: fweis...@gmail.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH] perf: sched: Show start of latency as well

2020-09-25 Thread Joel Fernandes (Google)
spending a lot of time backtracking to the start of the latency in "perf sched script" which wastes a lot of time. This patch therefore adds a new column "Max delay start". Considering this, also rename "Maximum delay at" to "Max delay end" as its easier to un

[PATCH v6 4/4] rcu/segcblist: Remove useless rcupdate.h include

2020-09-23 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c index df0f31e30947..b65ac8c85b56 100644 --- a/kernel/rcu/rcu_segcblist.c +++ b/kernel/rcu/rcu_segcblist.c @@ -10,7

[PATCH v6 3/4] rcu/trace: Add tracing for how segcb list changes

2020-09-23 Thread Joel Fernandes (Google)
in the respective segment. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25 + kernel/rcu/rcu_segcblist.c | 34 ++ kernel/rcu/rcu_segcblist.h | 5 + kernel/rcu/tree.c | 9 + 4 files changed, 73 insertions

[PATCH v6 2/4] rcu/segcblist: Add counters to segcblist datastructure

2020-09-23 Thread Joel Fernandes (Google)
related to using donecbs's ->len field as a temporary variable to save the segmented callback list's length. This cannot be done anymore and is not needed. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c|

[PATCH v6 1/4] rcu/tree: Make rcu_do_batch count how many callbacks were executed

2020-09-23 Thread Joel Fernandes (Google)
from 0 is confusing and error-prone IMHO. This commit therefore explicitly counts have many callbacks were executed in rcu_do_batch() itself, and uses that to update the per-CPU segcb list's ->len field, without relying on the negativity of rcl->len. Signed-off-by: Joel Fernandes (Google) ---

[PATCH v6 0/4] Add support for length of each segment in the segcblist

2020-09-23 Thread Joel Fernandes (Google)
2053-1-j...@joelfernandes.org/) Joel Fernandes (Google) (4): rcu/tree: Make rcu_do_batch count how many callbacks were executed rcu/segcblist: Add counters to segcblist datastructure rcu/trace: Add tracing for how segcb list changes rcu/segcblist: Remove useless rcupdate.h include include

[RFC v5 1/5] rcu/tree: Make rcu_do_batch count how many callbacks were executed

2020-09-20 Thread Joel Fernandes (Google)
from 0 is confusing and error-prone IMHO. This commit therefore explicitly counts have many callbacks were executed in rcu_do_batch() itself, and uses that to update the per-CPU segcb list's ->len field, without relying on the negativity of rcl->len. Signed-off-by: Joel Fernandes (Google) ---

[RFC v5 0/5] Add support length of each segment in the segcblist (breaks TREE04)

2020-09-20 Thread Joel Fernandes (Google)
ues. Fixed minor nit from Davidlohr. v1->v3: minor nits. (https://lore.kernel.org/lkml/20200719034210.2382053-1-j...@joelfernandes.org/) Joel Fernandes (Google) (5): rcu/tree: Make rcu_do_batch count how many callbacks were executed rcu/segcblist: Add counters to segcblist datastructure rc

[RFC v5 5/5] rcu/segcblist: Remove useless rcupdate.h include

2020-09-20 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c index 72b284f965aa..13f8f181521d 100644 --- a/kernel/rcu/rcu_segcblist.c +++ b/kernel/rcu/rcu_segcblist.c @@ -10,7

[RFC v5 3/5] rcu: Fix rcu_barrier() breakage from earlier patch

2020-09-20 Thread Joel Fernandes (Google)
rcu_barrier() may skip queuing a callback and return too early. Fix it by storing state to indicate that callbacks are being invoked and the callback list should not appear as non-empty. This is a terrible hack, however it still does not fix TREE04. Signed-off-by: Joel Fernandes (Google) --- include

[RFC v5 4/5] rcu/trace: Add tracing for how segcb list changes

2020-09-20 Thread Joel Fernandes (Google)
in the respective segment. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25 + kernel/rcu/rcu_segcblist.c | 34 ++ kernel/rcu/rcu_segcblist.h | 5 + kernel/rcu/tree.c | 9 + 4 files changed, 73 insertions

[RFC v5 2/5] rcu/segcblist: Add counters to segcblist datastructure

2020-09-20 Thread Joel Fernandes (Google)
related to using donecbs's ->len field as a temporary variable to save the segmented callback list's length. This is not needed any more. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c|

[PATCH v4 -rcu 2/4] rcu/tree: Make rcu_do_batch count how many callbacks were executed

2020-08-24 Thread Joel Fernandes (Google)
n from 0 is confusing and error-prone IMHO. This commit therefore explicitly counts have many callbacks were executed in rcu_do_batch() itself, and uses that to update the per-CPU segcb list's len field, without relying on the negativity of rcl->len. Signed-off-by: Joel Fernandes (Google) --

[PATCH v4 -rcu 3/4] rcu/segcblist: Add counters to segcblist datastructure

2020-08-24 Thread Joel Fernandes (Google)
traces when segcblist counts updated. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c| 82 +-- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include

[PATCH v4 -rcu 4/4] rcu/trace: Add tracing for how segcb list changes

2020-08-24 Thread Joel Fernandes (Google)
in the respective segment. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25 + kernel/rcu/rcu_segcblist.c | 27 +++ kernel/rcu/rcu_segcblist.h | 7 +++ kernel/rcu/tree.c | 23 +++ 4 files changed, 82

[PATCH v4 -rcu 0/4] Maintain the length of each segment in the segcblist

2020-08-24 Thread Joel Fernandes (Google)
rnel.org/lkml/20200719034210.2382053-1-j...@joelfernandes.org/) Joel Fernandes (Google) (4): rcu/segcblist: Do not depend on rcl->len to store the segcb len during merge rcu/tree: Make rcu_do_batch count how many callbacks were executed rcu/segcblist: Add counters to segcblist datastructure rcu/tr

[PATCH v4 -rcu 1/4] rcu/segcblist: Do not depend on rcl->len to store the segcb len during merge

2020-08-24 Thread Joel Fernandes (Google)
t;len field should be the length of the done segment and not just used as a temporarily variable. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c

[PATCH RFC 11/12] sched/coresched: Check for dynamic changes in smt_mask

2020-08-15 Thread Joel Fernandes (Google)
logic if smt_mask changes between the loops. Reported-by: Joel Fernandes (Google) Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel

[PATCH RFC 08/12] cpumask: Introduce a new iterator for_each_cpu_wrap_or

2020-08-15 Thread Joel Fernandes (Google)
From: Vineeth Pillai Hotplug fixes to core-scheduling require a new cpumask iterator which iterates through all online cpus in both the given cpumasks. This patch introduces it. Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- include/linux/cpumask.h | 42

[PATCH RFC 02/12] entry/idle: Add a common function for activites during idle entry/exit

2020-08-15 Thread Joel Fernandes (Google)
Currently only RCU hooks for idle entry/exit are called. In later patches, kernel-entry protection functionality will be added. Signed-off-by: Joel Fernandes (Google) --- include/linux/entry-common.h | 16 kernel/sched/idle.c | 17 + 2 files changed, 25

[PATCH RFC 03/12] arch/x86: Add a new TIF flag for untrusted tasks

2020-08-15 Thread Joel Fernandes (Google)
. Signed-off-by: Joel Fernandes (Google) --- arch/x86/include/asm/thread_info.h | 2 ++ kernel/sched/sched.h | 6 ++ 2 files changed, 8 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 267701ae3d86..42e63969acb3 100644 --- a/arch

[PATCH RFC 07/12] bitops: Introduce find_next_or_bit

2020-08-15 Thread Joel Fernandes (Google)
From: Vineeth Pillai Hotplug fixes to core-scheduling require a new bitops API. Introduce a new API find_next_or_bit() which returns the bit number of the next set bit in OR-ed bit masks of the given bit masks. Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- include

[PATCH RFC 10/12] sched/coresched: Make core_pick_seq per run-queue

2020-08-15 Thread Joel Fernandes (Google)
core_pick_seq per run-queue. Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 19 ++- kernel/sched/sched.h | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3e9df8221c62

[PATCH RFC 06/12] entry/kvm: Protect the kernel when entering from guest

2020-08-15 Thread Joel Fernandes (Google)
From: Vineeth Pillai Similar to how user to kernel mode transitions are protected in earlier patches, protect the entry into kernel from guest mode as well. Signed-off-by: Joel Fernandes (Google) --- arch/x86/kvm/x86.c| 3 +++ include/linux/entry-kvm.h | 12 kernel/entry

[PATCH RFC 01/12] irq_work: Add support to detect if work is pending

2020-08-15 Thread Joel Fernandes (Google)
P1() { int r1; int r2 = 0; r1 = READ_ONCE(flag); if (r1) r2 = READ_ONCE(buf); } Cc: paul...@kernel.org Signed-off-by: Joel Fernandes (Google) --- include/linux/irq_work.h | 1 + kernel/irq_work.c|

[PATCH RFC 00/12] Core-sched v6+: kernel protection and hotplug fixes

2020-08-15 Thread Joel Fernandes (Google)
o worse than smtoff. Also a modified rcutorture was used to heavily stress the kernel to make sure there is not crash or instability. Joel Fernandes (Google) (5): irq_work: Add support to detect if work is pending entry/idle: Add a common function for activites during idle entry/exit arch/x86: Add a

[PATCH RFC 05/12] entry/idle: Enter and exit kernel protection during idle entry and exit

2020-08-15 Thread Joel Fernandes (Google)
Make use of the generic_idle_{enter,exit} helper function added in earlier patches to enter and exit kernel protection. On exiting idle, protection will be reenabled. Signed-off-by: Joel Fernandes (Google) --- include/linux/entry-common.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH RFC 04/12] kernel/entry: Add support for core-wide protection of kernel-mode

2020-08-15 Thread Joel Fernandes (Google)
-by: Joel Fernandes (Google) --- include/linux/sched.h | 12 +++ kernel/entry/common.c | 88 +++--- kernel/sched/core.c | 205 ++ kernel/sched/sched.h | 3 + 4 files changed, 277 insertions(+), 31 deletions(-) diff --git a/include/linux

[PATCH RFC 09/12] sched/coresched: Use for_each_cpu(_wrap)_or for pick_next_task

2020-08-15 Thread Joel Fernandes (Google)
From: Vineeth Pillai During a CPU hotplug event, schedule would be called with the hotplugged CPU not in the cpumask. So use for_each_cpu(_wrap)_or to include the current cpu in the task pick loop. Signed-off-by: Vineeth Pillai Co-developed-by: Joel Fernandes (Google) Signed-off-by: Joel

[PATCH RFC 12/12] sched/coresched: rq->core should be set only if not previously set

2020-08-15 Thread Joel Fernandes (Google)
e once it is set. Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5da5b2317b21..464493f3a759

[PATCH v4 4/5] rcutorture: Force synchronizing of RCU flavor from hotplug notifier

2020-08-07 Thread Joel Fernandes (Google)
synchronize callback. If anything locks up, we expect stall warnings and/or other splats. Obviously, we need not test for rcu_barrier from a notifier, since those are not allowed from notifiers. This fact is already detailed in the documentation as well. Signed-off-by: Joel Fernandes (Google

[PATCH v4 2/5] rcu/tree: Clarify comments about FQS loop reporting quiescent states

2020-08-07 Thread Joel Fernandes (Google)
At least since v4.19, the FQS loop no longer reports quiescent states for offline CPUs unless it is an emergency. This commit therefore fixes the comment in rcu_gp_init() to match the current code. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 8 +--- 1 file changed, 5

[PATCH v4 3/5] rcu/tree: Make FQS complaining about offline CPU more aggressive

2020-08-07 Thread Joel Fernandes (Google)
FQS loop scan happens and bring the problem to everyone's attention. Light testing with TREE03 and hotplug shows no warnings. Converted the warning as well to WARN_ON_ONCE() to reduce log spam. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 22 ++ 1 file changed,

[PATCH v4 5/5] docs: Update RCU's hotplug requirements with a bit about design

2020-08-07 Thread Joel Fernandes (Google)
is rather incomplete. This commit therefore continues the section by describing how RCU's design handles CPU hotplug in a deadlock-free way. Signed-off-by: Joel Fernandes (Google) --- .../RCU/Design/Requirements/Requirements.rst | 22 +++ 1 file changed, 22 insertions(+)

[PATCH v4 0/5] option-subject: RCU and CPU hotplug checks and docs

2020-08-07 Thread Joel Fernandes (Google)
This series improves/adds to RCU's warnings about CPU hotplug and adds documentation and testing. v3->v4: Minor cleanups. Joel Fernandes (Google) (5): rcu/tree: Add a warning if CPU being onlined did not report QS already rcu/tree: Clarify comments about FQS loop reporting quiescent states

[PATCH v4 1/5] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-08-07 Thread Joel Fernandes (Google)
l E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 65e1b5e92319..a49fa3b60faa 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3996,7 +3996

[tip: core/rcu] refperf: Add a test to measure performance of read-side synchronization

2020-07-31 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 653ed64b01dc5989f8f579d0038e987476c2c023 Gitweb: https://git.kernel.org/tip/653ed64b01dc5989f8f579d0038e987476c2c023 Author:Joel Fernandes (Google) AuthorDate:Mon, 25 May 2020 00:36:48 -04:00

[tip: core/rcu] rcu/tree: Skip entry into the page allocator for PREEMPT_RT

2020-07-31 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 4d2919411867848fab78c7cb13139e17ad8b85bc Gitweb: https://git.kernel.org/tip/4d2919411867848fab78c7cb13139e17ad8b85bc Author:Joel Fernandes (Google) AuthorDate:Mon, 25 May 2020 23:47:46 +02:00

[tip: core/rcu] rcu/tree: Keep kfree_rcu() awake during lock contention

2020-07-31 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 8ac88f7177c75bf9b7b8c29a8054115e1c712baf Gitweb: https://git.kernel.org/tip/8ac88f7177c75bf9b7b8c29a8054115e1c712baf Author:Joel Fernandes (Google) AuthorDate:Mon, 25 May 2020 23:47:45 +02:00

[tip: core/rcu] rcuperf: Remove useless while loops around wait_event

2020-07-31 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 7e866460cc18797b3a59360f5f8c444598a21729 Gitweb: https://git.kernel.org/tip/7e866460cc18797b3a59360f5f8c444598a21729 Author:Joel Fernandes (Google) AuthorDate:Mon, 25 May 2020 00:36:47 -04:00

[tip: core/rcu] rcu/tree: Make debug_objects logic independent of rcu_head

2020-07-31 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 446044eb9c9c335d3ae1be4665193ab43ebb284e Gitweb: https://git.kernel.org/tip/446044eb9c9c335d3ae1be4665193ab43ebb284e Author:Joel Fernandes (Google) AuthorDate:Mon, 25 May 2020 23:47:48 +02:00

[PATCH v2 1/3] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-07-30 Thread Joel Fernandes (Google)
and hotplug parameters. Cc: Paul E. McKenney Cc: Neeraj Upadhyay Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH v2 3/3] rcu/tree: Make FQS complaining about offline CPU more aggressive

2020-07-30 Thread Joel Fernandes (Google)
ows no warnings. Convert the warning as well to WARN_ON_ONCE() to reduce log spam. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index a621932cc385..39bdd744ba97 100

[PATCH v2 2/3] rcu/tree: Clarify comments about FQS loop reporting quiescent states

2020-07-30 Thread Joel Fernandes (Google)
At least since v4.19, the FQS loop no longer reports quiescent states unless it is a dire situation where an offlined CPU failed to report a quiescent state. Let us clarify the comment in rcu_gp_init() inorder to keep the comment current. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu

[PATCH 2/2] rcu/tree: Clarify comments about FQS loop reporting quiescent states

2020-07-29 Thread Joel Fernandes (Google)
At least since v4.19, the FQS loop no longer reports quiescent states unless it is a dire situation where an offlined CPU failed to report a quiescent state. Let us clarify the comment in rcu_gp_init() inorder to keep the comment current. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu

[PATCH 1/2] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-07-29 Thread Joel Fernandes (Google)
and hotplug parameters. Cc: Paul E. McKenney Cc: Neeraj Upadhyay Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH RFC v2] rcu/segcblist: Add counters to segcblist datastructure

2020-07-18 Thread Joel Fernandes (Google)
Fernandes (Google) --- v1->v2: minor nits. include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c| 90 --- 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include/linux/rcu_segcblist.h index b36afe7b2

[PATCH RFC] rcu/segcblist: Add counters to segcblist datastructure

2020-07-18 Thread Joel Fernandes (Google)
. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c| 96 +++ 2 files changed, 89 insertions(+), 9 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include/linux/rcu_segcblist.h index b36afe7b22c9

[PATCH 3/3] rcu/trace: Add name of the source for gp_seq to prevent confusion

2020-06-18 Thread Joel Fernandes (Google)
-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 12 kernel/rcu/tree.c | 32 kernel/rcu/tree_plugin.h | 4 ++-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events

[PATCH 1/3] rcu/trace: Print negative GP numbers correctly

2020-06-18 Thread Joel Fernandes (Google)
the negative numbering directly. Cc: ure...@gmail.com Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index

[PATCH 2/3] rcu/trace: Use gp_seq_req in acceleration's rcu_grace_period tracepoint

2020-06-18 Thread Joel Fernandes (Google)
instead as it allows one to reason about how the acceleration works. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9ef68dd249e1d..d0988a1c1079d 100644 --- a/kernel

[PATCH 4/7] rcu/trace: Print negative GP numbers correctly

2020-06-18 Thread Joel Fernandes (Google)
the negative numbering directly. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 62 -- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index cb5363564f7ed..bc24862790623

[PATCH 6/7] rcutorture: Add support to get the number of wakeups of main GP kthread

2020-06-18 Thread Joel Fernandes (Google)
This is useful to check for any improvements or degradation related to number of GP kthread wakeups during testing. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/Kconfig.debug | 1 + kernel/rcu/rcu.h | 2 ++ kernel/rcu/rcutorture.c | 23 ++- kernel/rcu

[PATCH 3/7] rcu/trace: Add name of the source for gp_seq

2020-06-18 Thread Joel Fernandes (Google)
The gp_seq value can come from either of rdp, rsp or rnp. Only the rsp is the global source of truth (most accurate GP info). The rnp can be off by ~1 and the rdp can be off by way more. Add some more context to traces to clarify where it comes from. Signed-off-by: Joel Fernandes (Google

[PATCH 5/7] rcu/trace: Use rsp's gp_seq in acceleration's rcu_grace_period tracepoint

2020-06-18 Thread Joel Fernandes (Google)
gp_seq instead as it allows one to reason about how the acceleration works. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 81df1b837dd9d..c3bae7a83d792 100644 --- a/kernel

[PATCH 2/7] rcu/trace: Add tracing for how segcb list changes

2020-06-18 Thread Joel Fernandes (Google)
Track how the segcb list changes before/after acceleration, during queuing and during dequeuing. This has proved useful to discover an optimization to avoid unwanted GP requests when there are no callbacks accelerated. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25

[PATCH 7/7] rcutorture: Add number of GP information to reports

2020-06-18 Thread Joel Fernandes (Google)
Add 2 things to get visiblity around number of grace periods. 1. Add number of GPs to End-state print. 2. Just like End-state, add GP state to Start-state. This helps determine how many GPs elapsed during a run of rcutorture and what the initial state was. Signed-off-by: Joel Fernandes (Google

[PATCH 1/7] rcu/segcblist: Prevent useless GP start if no CBs to accelerate

2020-06-18 Thread Joel Fernandes (Google)
104 | ++-+-+-+-+ | 10 | 66 | 82 | 98 | 119 | ++-+-+-+-+ | 11 | 52 | 82 | 83 | 117 | ++-+-+-+-+ Cc: ure...@gmail.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c

[PATCH] sched/headers: Fix sched_setattr userspace compilation breakage

2020-05-28 Thread Joel Fernandes (Google)
can compile. Fixes: e2d1e2aec572a ("sched/headers: Move various ABI definitions to " Signed-off-by: Joel Fernandes (Google) --- include/uapi/linux/sched/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/typ

[PATCH 2/2] refperf: Add a test to measure performance of read-side synchronization

2020-05-24 Thread Joel Fernandes (Google)
7 33 [3.347133] 18 34 Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/Kconfig.debug | 19 ++ kernel/rcu/Makefile | 1 + kernel/rcu/refperf.c | 558 +++ 3 files changed, 578 insertions(+) create mode 100644 kernel/rcu/refperf.c

[PATCH 1/2] rcuperf: Remove useless while loops around wait_event

2020-05-24 Thread Joel Fernandes (Google)
wait_event() already retries if the condition for the wake up is not satisifed after wake up. Remove them from the rcuperf test. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcuperf.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/kernel/rcu

[PATCH RFC v2] sched/headers: Fix sched_setattr userspace compilation issues

2020-05-22 Thread Joel Fernandes (Google)
with __KERNEL__ so that userspace and the kernel can both compile. Signed-off-by: Joel Fernandes (Google) --- v1->v2: With the chance that libc needs resolving something, I'm resending with libc-alpha added as suggested by Christian, and minor commit message fixes. include/uapi/linux/sched/types.h

[PATCH RFC] sched/headers: Fix sched_setattr userspace compilation issues

2020-05-21 Thread Joel Fernandes (Google)
compile. Signed-off-by: Joel Fernandes (Google) --- include/uapi/linux/sched/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h index c852153ddb0d3..1f10d935a63fe 100644 --- a/include/uapi/linux/sched/types.h +++ b

[PATCH RFC] sched: Use sched-RCU in core-scheduling balancing logic

2020-05-20 Thread Joel Fernandes (Google)
] watchdog: BUG: soft lockup - CPU#0 stuck for 11s! [kworker/0:10:965] Cc: vpillai Cc: Aaron Lu Cc: Aubrey Li Cc: pet...@infradead.org Cc: paul...@kernel.org Signed-off-by: Joel Fernandes (Google) Change-Id: I1a4bf0cd1426b3c21ad5de44719813ad4ee5805e --- kernel/sched/core.c | 4 ++-- 1 file

[PATCH RFC v2] Add support for core-wide protection of IRQ and softirq

2020-05-20 Thread Joel Fernandes (Google)
: Paul E. McKenney Co-developed-by: Vineeth Pillai Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- If you like some pictures of the cases handled by this patch, please see the OSPM slide deck (the below link jumps straight to relevant slides - about 6-7 of them in total

[PATCH RFC] sched: Add a per-thread core scheduling interface

2020-05-20 Thread Joel Fernandes (Google)
-tagged, allow the CGroup interface to override the task's tag. ChromeOS will use core-scheduling to securely enable hyperthreading. This cuts down the keypress latency in Google docs from 150ms to 50ms while improving the camera streaming frame rate by ~3%. Signed-off-by: Joel Fernandes (Google

[tip: core/rcu] rcu/tree: Count number of batched kfree_rcu() locklessly

2020-05-11 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: a6a82ce18ba443186545d3fefbee8b9419a859dc Gitweb: https://git.kernel.org/tip/a6a82ce18ba443186545d3fefbee8b9419a859dc Author:Joel Fernandes (Google) AuthorDate:Mon, 16 Mar 2020 12:32:28 -04:00

[tip: core/rcu] rcu/tree: Add a shrinker to prevent OOM due to kfree_rcu() batching

2020-05-11 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 9154244c1ab6c9db4f1f25ac8f73bd46dba64287 Gitweb: https://git.kernel.org/tip/9154244c1ab6c9db4f1f25ac8f73bd46dba64287 Author:Joel Fernandes (Google) AuthorDate:Mon, 16 Mar 2020 12:32:27 -04:00

[tip: core/rcu] rcuperf: Add ability to increase object allocation size

2020-05-11 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the core/rcu branch of tip: Commit-ID: f87dc808009ac86c790031627698ef1a34c31e25 Gitweb: https://git.kernel.org/tip/f87dc808009ac86c790031627698ef1a34c31e25 Author:Joel Fernandes (Google) AuthorDate:Mon, 16 Mar 2020 12:32:26 -04:00

[PATCH RFC] Add support for core-wide protection of IRQ and softirq

2020-05-10 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- If you like some pictures of the cases handled by this patch, please see the OSPM slide deck (the below link jumps straight to relevant slides - about 6-7 of them in total): https://bit.ly/2zvzxWk TODO: 1. Any optimziations for VM usecases (can we do

<    1   2   3   4   5   6   >