Re: [RFC PATCH v7 17/23] kernel/entry: Add support for core-wide protection of kernel-mode

2020-09-01 Thread Joel Fernandes
On Tue, Sep 01, 2020 at 05:54:53PM +0200, Thomas Gleixner wrote: > On Fri, Aug 28 2020 at 15:51, Julien Desfossez wrote: > > @@ -112,59 +113,84 @@ static __always_inline void exit_to_user_mode(void) > > /* Workaround to allow gradual conversion of architecture code */ > > void __weak arch_do_sign

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

2020-09-01 Thread Joel Fernandes
Hi, Resuming regular activities here, post-LPC :) On Fri, Aug 28, 2020 at 07:18:55AM -0700, Paul E. McKenney wrote: > On Thu, Aug 27, 2020 at 06:55:18PM -0400, Joel Fernandes wrote: > > On Wed, Aug 26, 2020 at 07:20:28AM -0700, Paul E. McKenney wrote: > > [...] > > > >

Re: [RFC PATCH v7 08/23] sched: Add core wide task selection and scheduling.

2020-08-31 Thread Joel Fernandes
commit messages and code comments enlisting all the issues. Hope it makes sense now. IMHO any other solutions seems unclear or overhead. The simple solution below Just Works (Tm) and does not add overhead. Let me know what you think, thanks. ---8<--- >From 546c5b48f3721

Re: [RFC PATCH v7 08/23] sched: Add core wide task selection and scheduling.

2020-08-31 Thread Joel Fernandes
mask is updated. This extra logic was to take care of that. > > Sure, the mask is updated async, but _where_ is the actual problem with > that? > > On Fri, Aug 28, 2020 at 06:23:55PM -0400, Joel Fernandes wrote: > > Thanks Vineeth. Peter, also the "v6+" series (which

Re: [RFC PATCH v7 08/23] sched: Add core wide task selection and scheduling.

2020-08-31 Thread Joel Fernandes
when the mask is updated. This extra logic was to take care of that. > > Sure, the mask is updated async, but _where_ is the actual problem with > that? > > On Fri, Aug 28, 2020 at 06:23:55PM -0400, Joel Fernandes wrote: > > Thanks Vineeth. Peter, also the "v6+" ser

Re: [RFC PATCH v7 08/23] sched: Add core wide task selection and scheduling.

2020-08-28 Thread Joel Fernandes
On Fri, Aug 28, 2020 at 06:02:25PM -0400, Vineeth Pillai wrote: [...] > > Can we please split out this hotplug 'fix' into a separate patch with a > > coherent changelog. > Sorry about this. I had posted this as separate patches in v6 list, > but merged it for v7. Will split it and have details abo

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

2020-08-27 Thread Joel Fernandes
; is that setting th e rcu_cblist .len field doesn't hurt the other use > cases that require careful handling of ->cblist.len. Thank you for the ideas. I am trying something like this on top of this series based on the ideas. One thing I concerned a bit is if getting rid of the rcu_segcblist_xchg_len()

Re: [PATCH v2 03/11] sched,idle,rcu: Push rcu_idle deeper into the idle path

2020-08-27 Thread Joel Fernandes
On Thu, Aug 27, 2020 at 09:47:48AM +0200, pet...@infradead.org wrote: > On Wed, Aug 26, 2020 at 09:24:19PM -0400, Joel Fernandes wrote: > > On Wed, Aug 26, 2020 at 09:18:26PM -0400, Joel Fernandes wrote: > > > On Fri, Aug 21, 2020 at 10:47:41AM +0200, Peter Zijlstra wrote: >

Re: [PATCH] staging: ion: remove from the tree

2020-08-27 Thread Joel Fernandes
27;s not used, and is only causing problems > > > > for everyone involved. > > > > > > > > Cc: "Arve Hjønnevåg" > > > > Cc: "Christian König" > > > > Cc: Christian Brauner > > > > Cc: Ch

Re: [PATCH v2 03/11] sched,idle,rcu: Push rcu_idle deeper into the idle path

2020-08-26 Thread Joel Fernandes
On Wed, Aug 26, 2020 at 09:18:26PM -0400, Joel Fernandes wrote: > On Fri, Aug 21, 2020 at 10:47:41AM +0200, Peter Zijlstra wrote: > > Lots of things take locks, due to a wee bug, rcu_lockdep didn't notice > > that the locking tracepoints were using RCU. > > > >

Re: [PATCH v2 03/11] sched,idle,rcu: Push rcu_idle deeper into the idle path

2020-08-26 Thread Joel Fernandes
call. But that's a terrible idea considering that would add unwanted overhead I think. Reviewed-by: Joel Fernandes (Google) thanks, - Joel > > Signed-off-by: Peter Zijlstra (Intel) > Reviewed-by: Steven Rostedt (VMware) > Tested-by: Marco Elver > --- > drivers/cpuid

Re: [PATCH v2 02/11] cpuidle: Fixup IRQ state

2020-08-26 Thread Joel Fernandes
> > Tested-by: Marco Elver > > For all patches in the series: > > Acked-by: Rafael J. Wysocki Reviewed-by: Joel Fernandes (Google) thanks, - Joel > > > --- > > drivers/cpuidle/cpuidle.c |3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCH v2 01/11] lockdep: Use raw_cpu_*() for per-cpu variables

2020-08-26 Thread Joel Fernandes
es") > Reported-by: Sven Schnelle > Reviewed-by: Steven Rostedt (VMware) > Tested-by: Marco Elver Reviewed-by: Joel Fernandes (Google) thanks, - Joel > Signed-off-by: Peter Zijlstra (Intel) > --- > include/linux/irqflags.h |6 +++--- > include/linux/lockdep.h |

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

2020-08-25 Thread Joel Fernandes
On Tue, Aug 25, 2020 at 02:55:53PM -0700, Paul E. McKenney wrote: > On Mon, Aug 24, 2020 at 10:48:42PM -0400, Joel Fernandes (Google) wrote: > > Track how the segcb list changes before/after acceleration, during > > queuing and during dequeuing. > > > > This has p

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

2020-08-25 Thread Joel Fernandes
On Tue, Aug 25, 2020 at 02:53:38PM -0700, Paul E. McKenney wrote: > On Mon, Aug 24, 2020 at 10:48:41PM -0400, Joel Fernandes (Google) wrote: > > Add counting of segment lengths of segmented callback list. > > > > This will be useful for a number of things such as knowing how

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

2020-08-25 Thread Joel Fernandes
Hi Paul, On Tue, Aug 25, 2020 at 01:08:09PM -0700, Paul E. McKenney wrote: > On Mon, Aug 24, 2020 at 10:48:39PM -0400, Joel Fernandes (Google) wrote: > > The donecbs's ->len field is used to store the total count of the segmented > > callback list's length. This ->

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

2020-08-24 Thread Joel Fernandes (Google)
of counting down 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 Fe

[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)
n 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 change

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

2020-08-24 Thread Joel Fernandes (Google)
://lore.kernel.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

[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)
donecb's ->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/

Re: [RFC] Design proposal for upstream core-scheduling interface

2020-08-24 Thread Joel Fernandes
Hey Dhaval, On Mon, Aug 24, 2020 at 3:50 PM Dhaval Giani wrote: > > On Fri, Aug 21, 2020 at 8:01 PM Joel Fernandes wrote: > > > > Hello! > > Core-scheduling aims to allow making it safe for more than 1 task that trust > > each other to safely share hyperthrea

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

2020-08-22 Thread Joel Fernandes
On Fri, Aug 14, 2020 at 11:19 PM Joel Fernandes (Google) wrote: > > Hello! > > This series is continuation of main core-sched v6 series [1] and adds support > for syscall and IRQ isolation from usermode processes and guests. It is key to > safely entering kernel mode in an HT

[RFC] Design proposal for upstream core-scheduling interface

2020-08-21 Thread Joel Fernandes
Hello! Core-scheduling aims to allow making it safe for more than 1 task that trust each other to safely share hyperthreads within a CPU core [1]. This results in a performance improvement for workloads that can benefit from using hyperthreading safely while limiting core-sharing when it is not saf

Re: 回复: [PATCH] rcu: shrink each possible cpu krcp

2020-08-20 Thread Joel Fernandes
On Wed, Aug 19, 2020 at 05:58:08PM +0200, Uladzislau Rezki wrote: > On Wed, Aug 19, 2020 at 08:21:59AM -0700, Paul E. McKenney wrote: > > On Wed, Aug 19, 2020 at 09:56:54AM -0400, Joel Fernandes wrote: > > > On Wed, Aug 19, 2020 at 03:00:55AM +,

Re: [RFC PATCH 00/16] Core scheduling v6

2020-08-20 Thread Joel Fernandes
On Thu, Aug 13, 2020 at 12:28:17PM +0800, Li, Aubrey wrote: > On 2020/8/13 7:08, Joel Fernandes wrote: > > On Wed, Aug 12, 2020 at 10:01:24AM +0800, Li, Aubrey wrote: > >> Hi Joel, > >> > >> On 2020/8/10 0:44, Joel Fernandes wrote: > >>> Hi Aubrey,

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

2020-08-19 Thread Joel Fernandes
On Wed, Aug 19, 2020 at 11:26:48AM -0700, Kees Cook wrote: > On Fri, Aug 14, 2020 at 11:18:56PM -0400, Joel Fernandes (Google) wrote: > > This series is continuation of main core-sched v6 series [1] and adds > > support > > - Is this really "RFC"? Seeing multiple

Re: 回复: [PATCH] rcu: shrink each possible cpu krcp

2020-08-19 Thread Joel Fernandes
On Wed, Aug 19, 2020 at 08:21:59AM -0700, Paul E. McKenney wrote: > On Wed, Aug 19, 2020 at 09:56:54AM -0400, Joel Fernandes wrote: > > On Wed, Aug 19, 2020 at 03:00:55AM +, Zhang, Qiang wrote: > > > > > > > > > ___

Re: 回复: [PATCH] rcu: shrink each possible cpu krcp

2020-08-19 Thread Joel Fernandes
On Wed, Aug 19, 2020 at 03:00:55AM +, Zhang, Qiang wrote: > > > > 发件人: linux-kernel-ow...@vger.kernel.org > 代表 Joel Fernandes > 发送时间: 2020年8月19日 8:04 > 收件人: Paul E. McKenney > 抄送: Uladzislau Rezki; Zhang, Qiang; Josh

Re: [PATCH] rcu: shrink each possible cpu krcp

2020-08-19 Thread Joel Fernandes
On Wed, Aug 19, 2020 at 01:22:25PM +0200, Uladzislau Rezki wrote: > On Tue, Aug 18, 2020 at 08:04:20PM -0400, Joel Fernandes wrote: > > On Tue, Aug 18, 2020 at 6:02 PM Paul E. McKenney wrote: > > > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > >

Re: [PATCH] rcu: shrink each possible cpu krcp

2020-08-18 Thread Joel Fernandes
On Tue, Aug 18, 2020 at 6:02 PM Paul E. McKenney wrote: > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index b8ccd7b5af82..6decb9ad2421 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -2336,10 +2336,15 @@ int rcutree_dead_cpu(unsigned int cpu) > > { > >

Re: [PATCH] rcu: shrink each possible cpu krcp

2020-08-18 Thread Joel Fernandes
On Tue, Aug 18, 2020 at 11:55:11PM +0200, Uladzislau Rezki wrote: > > On Tue, Aug 18, 2020 at 03:00:35PM -0400, Joel Fernandes wrote: > > > On Tue, Aug 18, 2020 at 1:18 PM Paul E. McKenney > > > wrote: > > > > > > > > On Mon, Aug 17, 2020 at 06:0

Re: [PATCH] rcu: shrink each possible cpu krcp

2020-08-18 Thread Joel Fernandes
On Tue, Aug 18, 2020 at 1:18 PM Paul E. McKenney wrote: > > On Mon, Aug 17, 2020 at 06:03:54PM -0400, Joel Fernandes wrote: > > On Fri, Aug 14, 2020 at 2:51 PM Uladzislau Rezki wrote: > > > > > > > From: Zqiang > > > > > > > &g

Re: [PATCH] rcu: shrink each possible cpu krcp

2020-08-17 Thread Joel Fernandes
On Fri, Aug 14, 2020 at 2:51 PM Uladzislau Rezki wrote: > > > From: Zqiang > > > > Due to cpu hotplug. some cpu may be offline after call "kfree_call_rcu" > > func, if the shrinker is triggered at this time, we should drain each > > possible cpu "krcp". > > > > Signed-off-by: Zqiang > > --- > >

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

2020-08-16 Thread Joel Fernandes
Hello Peter, On Sat, Aug 15, 2020 at 10:14:41AM +0200, pet...@infradead.org wrote: > On Fri, Aug 14, 2020 at 11:18:58PM -0400, Joel Fernandes (Google) wrote: > > Currently only RCU hooks for idle entry/exit are called. In later > > patches, kernel-entry protection functionalit

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

2020-08-16 Thread Joel Fernandes
On Sat, Aug 15, 2020 at 10:13:30AM +0200, pet...@infradead.org wrote: > On Fri, Aug 14, 2020 at 11:18:57PM -0400, Joel Fernandes (Google) wrote: > > https://lkml.kernel.org/r/20200722153017.024407...@infradead.org Thank you, so that means I can drop this patch then. - Joel

[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.

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

2020-08-15 Thread Joel Fernandes (Google)
. But this is no 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 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)
: 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 100644

Re: [RFC PATCH 00/16] Core scheduling v6

2020-08-12 Thread Joel Fernandes
On Wed, Aug 12, 2020 at 10:01:24AM +0800, Li, Aubrey wrote: > Hi Joel, > > On 2020/8/10 0:44, Joel Fernandes wrote: > > Hi Aubrey, > > > > Apologies for replying late as I was still looking into the details. > > > > On Wed, Aug 05, 202

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

2020-08-10 Thread Joel Fernandes
On Mon, Aug 10, 2020 at 10:54:34AM -0700, Paul E. McKenney wrote: > On Mon, Aug 10, 2020 at 01:31:09PM -0400, Joel Fernandes wrote: > > Hi Paul, > > > > On Mon, Aug 10, 2020 at 09:19:45AM -0700, Paul E. McKenney wrote: > > > On Fri, Aug 07, 2020 at 01:07:21PM -0400,

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

2020-08-10 Thread Joel Fernandes
On Mon, Aug 10, 2020 at 10:57:17AM -0700, Paul E. McKenney wrote: > On Mon, Aug 10, 2020 at 01:39:31PM -0400, Joel Fernandes wrote: > > On Mon, Aug 10, 2020 at 08:46:54AM -0700, Paul E. McKenney wrote: > > > On Fri, Aug 07, 2020 at 01:07:18PM -0400, Joel Fernandes (Google) wrote:

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

2020-08-10 Thread Joel Fernandes
On Mon, Aug 10, 2020 at 11:06:47AM -0700, Paul E. McKenney wrote: > On Fri, Aug 07, 2020 at 01:07:19PM -0400, Joel Fernandes (Google) wrote: > > At least since v4.19, the FQS loop no longer reports quiescent states > > for offline CPUs unless it is an emergency. > > >

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

2020-08-10 Thread Joel Fernandes
On Fri, Aug 07, 2020 at 07:10:38PM -0700, Randy Dunlap wrote: > Hi-- > > On 8/7/20 10:07 AM, Joel Fernandes (Google) wrote: > > RCU's hotplug design will help understand the requirements an RCU > > implementation needs to fullfill, such as dead-lock avoidance. > >

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

2020-08-10 Thread Joel Fernandes
On Mon, Aug 10, 2020 at 08:46:54AM -0700, Paul E. McKenney wrote: > On Fri, Aug 07, 2020 at 01:07:18PM -0400, Joel Fernandes (Google) wrote: > > Currently, rcu_cpu_starting() checks to see if the RCU core expects a > > quiescent state from the incoming CPU. However, the curr

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

2020-08-10 Thread Joel Fernandes
Hi Paul, On Mon, Aug 10, 2020 at 09:19:45AM -0700, Paul E. McKenney wrote: > On Fri, Aug 07, 2020 at 01:07:21PM -0400, Joel Fernandes (Google) wrote: > > RCU has had deadlocks in the past related to synchronizing in a hotplug > > notifier. Typically, this has occurred because time

Re: [RFC PATCH 00/16] Core scheduling v6

2020-08-09 Thread Joel Fernandes
Hi Aubrey, Apologies for replying late as I was still looking into the details. On Wed, Aug 05, 2020 at 11:57:20AM +0800, Li, Aubrey wrote: [...] > +/* > + * Core scheduling policy: > + * - CORE_SCHED_DISABLED: core scheduling is disabled. > + * - CORE_COOKIE_MATCH: tasks with same cookie can run

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

2020-08-07 Thread Joel Fernandes
On Fri, Aug 7, 2020 at 1:07 PM Joel Fernandes (Google) wrote: > > > 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

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

2020-08-07 Thread Joel Fernandes (Google)
flavor-specific 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 Fe

[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)
ately when the 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 ++-

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

2020-08-07 Thread Joel Fernandes (Google)
rrier 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 inserti

[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 st

[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)
ggested-by: Paul 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 @

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

2020-08-07 Thread Joel Fernandes
On Fri, Aug 07, 2020 at 11:37:32AM -0400, Joel Fernandes wrote: > Hi Paul, > > On Thu, Jul 30, 2020 at 08:48:25PM -0700, Paul E. McKenney wrote: > [...] > > > And I could make the comment here as: > > > /* > > >* Delete QS reporting from here

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

2020-08-07 Thread Joel Fernandes
Hi Paul, On Thu, Jul 30, 2020 at 08:48:25PM -0700, Paul E. McKenney wrote: [...] > > And I could make the comment here as: > > /* > > * Delete QS reporting from here, by June 2021, if the warning does not > > * fire. Leave the warning indefinitely. Check RCU design requirements > >

Re: [PATCH 1/2] fs: Add fd_install file operation

2020-08-03 Thread Joel Fernandes
On Mon, Aug 3, 2020 at 10:47 AM 'Kalesh Singh' via kernel-team wrote: > > Provides a per process hook for the acquisition of file descriptors, > despite the method used to obtain the descriptor. > Hi, So apart from all of the comments received, I think it is hard to understand what the problem is

Re: [RFC PATCH 00/16] Core scheduling v6

2020-08-03 Thread Joel Fernandes
Hi Aubrey, On Mon, Aug 3, 2020 at 4:23 AM Li, Aubrey wrote: > > On 2020/7/1 5:32, Vineeth Remanan Pillai wrote: > > Sixth iteration of the Core-Scheduling feature. > > > > Core scheduling is a feature that allows only trusted tasks to run > > concurrently on cpus sharing compute resources (eg: hy

[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

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

2020-07-30 Thread Joel Fernandes
On Thu, Jul 30, 2020 at 09:21:59AM -0700, Paul E. McKenney wrote: > On Wed, Jul 29, 2020 at 11:02:20PM -0400, Joel Fernandes (Google) wrote: > > Add a warning if CPU being onlined did not report QS already. This is to > > simplify the code in the CPU onlining path and also to m

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

2020-07-30 Thread Joel Fernandes
On Thu, Jul 30, 2020 at 09:35:20AM -0700, Paul E. McKenney wrote: > On Wed, Jul 29, 2020 at 11:25:19PM -0400, Joel Fernandes wrote: > > On Wed, Jul 29, 2020 at 11:02 PM Joel Fernandes (Google) > > wrote: > > > > > > At least since v4.19, the FQS loop no longer re

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

2020-07-30 Thread Joel Fernandes
On Thu, Jul 30, 2020 at 09:21:59AM -0700, Paul E. McKenney wrote: > On Wed, Jul 29, 2020 at 11:02:20PM -0400, Joel Fernandes (Google) wrote: > > Add a warning if CPU being onlined did not report QS already. This is to > > simplify the code in the CPU onlining path and also to m

[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)
REE03 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

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

2020-07-30 Thread Joel Fernandes (Google)
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 100644 --

[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

Re: [PATCH v2 1/1] rcu/tree: Drop the lock before entering to page allocator

2020-07-30 Thread Joel Fernandes
ock(&krcp->lock); > + > /* >* NOTE: For one argument of kvfree_rcu() we can >* drop the lock and get the page in sleepable > @@ -3315,6 +3340,8 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu

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

2020-07-29 Thread Joel Fernandes
On Wed, Jul 29, 2020 at 11:02 PM Joel Fernandes (Google) wrote: > > At least since v4.19, the FQS loop no longer reports quiescent states I meant here, "FQS loop no longer reports quiescent states for offline CPUs." Sorry, - Joel > unless it is a dire situation where an

Re: [PATCH 1/1] staging: android: ashmem: Fix lockdep warning for write operation

2020-07-29 Thread Joel Fernandes
ed memory. Therefore the race > that lockdep is warning about is not valid. Resolve this by introducing a > separate lockdep class for the backing shmem inodes. > > [1]: https://lkml.kernel.org/lkml/0b5f9d059aa20...@google.com/ > > Signed-off-by: Suren Baghdasaryan > --- Once Eric's nits are resolved: Reviewed-by: Joel Fernandes (Google) Thanks.

[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)
REE03 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

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

2020-07-29 Thread Joel Fernandes
On Mon, Jul 20, 2020 at 07:29:23AM -0700, Davidlohr Bueso wrote: > On Sat, 18 Jul 2020, Joel Fernandes (Google) wrote: > > > +/* Move from's segment length to to's segment. */ > > +static void rcu_segcblist_move_seglen(struct rcu_segcblist *rsclp, int > > fro

Re: [PATCH] selinux: add tracepoint on denials

2020-07-28 Thread Joel Fernandes
> developers workflow. > > [1] https://source.android.com/devices/tech/debug/native_stack_dump > > Signed-off-by: Thiébaud Weksteen > Signed-off-by: Joel Fernandes While I am in support of the general idea, could you change my SOB to something like Inspired-by? This is really

Re: [rcu/segcblist] af49115178: WARNING:at_kernel/rcu/tree.c:#rcu_do_batch

2020-07-27 Thread Joel Fernandes
cture") > url: > https://github.com/0day-ci/linux/commits/Joel-Fernandes-Google/rcu-segcblist-Add-counters-to-segcblist-datastructure/20200719-115700 > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git > 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68 > > in testcas

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

2020-07-27 Thread Joel Fernandes
On Mon, Jul 27, 2020 at 09:49:25PM +0800, Boqun Feng wrote: [...] > So C11 features are available to gnu89 as extensions, also I tried to > compile the following code with -std=gnu89: > > #include > > typedef struct { > int a; > } atomic_t; > > void g(void

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

2020-07-24 Thread Joel Fernandes
On Mon, Jul 20, 2020 at 4:22 AM wrote: > > Hi Joel, Sorry for the late reply as I was on vacation last several days. > > On Sun, Jul 19, 2020 at 12:18:41AM -0400, Joel Fernandes wrote: > > On Sun, Jul 19, 2020 at 12:06:28AM -0400, Joel Fernandes wrote: > > > On Sa

Re: [RFC PATCH 14/16] irq: Add support for core-wide protection of IRQ and softirq

2020-07-19 Thread Joel Fernandes
On Sat, Jul 18, 2020 at 01:36:16AM +0200, Thomas Gleixner wrote: > Vineeth, Joel! Hi Thomas, > Vineeth Remanan Pillai writes: > > From: "Joel Fernandes (Google)" > > > > Lastly, we also check in the schedule loop if we are about to schedule > > an untru

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

2020-07-18 Thread Joel Fernandes
On Sun, Jul 19, 2020 at 12:06:28AM -0400, Joel Fernandes wrote: > On Sat, Jul 18, 2020 at 11:55 PM Joel Fernandes (Google) > wrote: > [...] > > /* If no callbacks moved, nothing more need be done. */ > > @@ -419,10 +494,9 @@ void rcu_segcblist_advance(struct rcu_

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

2020-07-18 Thread Joel Fernandes
On Sat, Jul 18, 2020 at 11:55 PM Joel Fernandes (Google) wrote: [...] > /* If no callbacks moved, nothing more need be done. */ > @@ -419,10 +494,9 @@ void rcu_segcblist_advance(struct rcu_segcblist *rsclp, > unsigned long seq) > * callbacks. The overall effect is

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

2020-07-18 Thread Joel Fernandes (Google)
Add counting of segment lengths of segmented callback list. This will be useful for a number of things such as knowing how big the ready-to-execute segment have gotten. The immediate benefit is ability to trace how the callbacks in the segmented callback list change. Signed-off-by: Joel

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

2020-07-18 Thread Joel Fernandes (Google)
From: Joel Fernandes Add counting of segment lengths of segmented callback list. This will be useful for a number of things such as knowing how big the ready-to-execute segment have gotten. The immediate benefit is ability to trace how the callbacks in the segmented callback list change

Re: [RFC PATCH 14/16] irq: Add support for core-wide protection of IRQ and softirq

2020-07-18 Thread Joel Fernandes
On Sat, Jul 18, 2020 at 01:37:50AM +0200, Thomas Gleixner wrote: > "Li, Aubrey" writes: > > On 2020/7/1 5:32, Vineeth Remanan Pillai wrote: > > > > We saw a lot of soft lockups on the screen when we tested v6. > > > > [ 186.527883] watchdog: BUG: soft lockup - CPU#86 stuck for 22s! > > [uperf:55

Re: [PATCHv2] mm: Fix warning in move_normal_pmd()

2020-07-16 Thread Joel Fernandes
On Thu, Jul 16, 2020 at 1:55 PM Linus Torvalds wrote: > > On Thu, Jul 16, 2020 at 6:16 AM Kirill A. Shutemov > wrote: > > > > It can also lead to performance regression: for small mremap() if only one > > side of the range got aligned and there's no PMD_SIZE range to move, > > kernel will still

Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator

2020-07-16 Thread Joel Fernandes
On Thu, Jul 16, 2020 at 04:37:14PM +0200, Uladzislau Rezki wrote: > On Thu, Jul 16, 2020 at 09:36:47AM -0400, Joel Fernandes wrote: > > On Thu, Jul 16, 2020 at 11:19:13AM +0200, Uladzislau Rezki wrote: > > > On Wed, Jul 15, 2020 at 07:13:33PM -0400, Joel Fernandes wrote: >

Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator

2020-07-16 Thread Joel Fernandes
On Thu, Jul 16, 2020 at 11:19:13AM +0200, Uladzislau Rezki wrote: > On Wed, Jul 15, 2020 at 07:13:33PM -0400, Joel Fernandes wrote: > > On Wed, Jul 15, 2020 at 2:56 PM Sebastian Andrzej Siewior > > wrote: > > > > > > On 2020-07-15 20:35:37 [+020

Re: [PATCH 1/1] rcu/tree: Drop the lock before entering to page allocator

2020-07-15 Thread Joel Fernandes
On Wed, Jul 15, 2020 at 2:56 PM Sebastian Andrzej Siewior wrote: > > On 2020-07-15 20:35:37 [+0200], Uladzislau Rezki (Sony) wrote: > > @@ -3306,6 +3307,9 @@ kvfree_call_rcu_add_ptr_to_bulk(struct kfree_rcu_cpu > > *krcp, void *ptr) > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > >

Re: [PATCHv2] mm: Fix warning in move_normal_pmd()

2020-07-15 Thread Joel Fernandes
Hi Linus, On Wed, Jul 15, 2020 at 11:36:59AM -0700, Linus Torvalds wrote: > On Wed, Jul 15, 2020 at 6:50 AM Kirill A. Shutemov > wrote: > > > > mremap(2) does not allow source and destination regions to overlap, but > > shift_arg_pages() calls move_page_tables() directly and in this case the > >

<    1   2   3   4   5   6   7   8   9   10   >