Re: [PATCH v3 0/9] KVM: Fix tick-based accounting for x86 guests

2021-04-20 Thread Frederic Weisbecker
On Thu, Apr 15, 2021 at 03:20:57PM -0700, Sean Christopherson wrote: > This is a continuation of Wanpeng's series[1] to fix tick-based CPU time > accounting on x86, with my cleanups[2] bolted on top. The core premise of > Wanpeng's patches are preserved, but they are heavily stripped down. >

Re: [PATCH v3 3/9] KVM: x86: Defer tick-based accounting 'til after IRQ handling

2021-04-20 Thread Frederic Weisbecker
On Thu, Apr 15, 2021 at 03:21:00PM -0700, Sean Christopherson wrote: > From: Wanpeng Li > > When using tick-based accounting, defer the call to account guest time > until after servicing any IRQ(s) that happened in the guest or > immediately after VM-Exit. Tick-based accounting of vCPU time

Re: [PATCH 1/2] srcu: Fix broken node geometry after early ssp init

2021-04-18 Thread Frederic Weisbecker
On Sat, Apr 17, 2021 at 09:46:16PM -0700, Paul E. McKenney wrote: > On Sat, Apr 17, 2021 at 03:16:49PM +0200, Frederic Weisbecker wrote: > > On Wed, Apr 14, 2021 at 08:55:38AM -0700, Paul E. McKenney wrote: > > > > diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h >

Re: [PATCH 1/2] srcu: Fix broken node geometry after early ssp init

2021-04-17 Thread Frederic Weisbecker
cu_init_geometry()'s > instructions (maybe we are?), then rcu_init_geometry() can be split > into a function that just does the check (which is not __init) and the > remainder of the function, which could remain __init. There you go: --- From: Frederic Weisbecker Date: Wed, 31 Mar 2021 1

Re: [PATCH 1/2] srcu: Fix broken node geometry after early ssp init

2021-04-16 Thread Frederic Weisbecker
On Wed, Apr 14, 2021 at 08:55:38AM -0700, Paul E. McKenney wrote: > On Wed, Apr 14, 2021 at 03:24:12PM +0200, Frederic Weisbecker wrote: > > diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h > > index 75ed367d5b60..24db97cbf76b 100644 > > --- a/kernel/rcu/rcu.h >

[PATCH 2/2] srcu: Early test SRCU polling start

2021-04-14 Thread Frederic Weisbecker
-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes Cc: Uladzislau Rezki --- kernel/rcu/update.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index

[PATCH 1/2] srcu: Fix broken node geometry after early ssp init

2021-04-14 Thread Frederic Weisbecker
rcu_init(). This way we make sure the RCU nodes hierarchy is properly built and distributed before the nodes of a struct srcu_state are allocated. Suggested-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fer

[PATCH 0/2] srcu: Fix early boot hang v3

2021-04-14 Thread Frederic Weisbecker
Hi, Another approach, suggested offlist by Paul. Much more simple and maintainable. Enjoy! git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git rcu/dev-v3 HEAD: bd6cef5d990e47a523027aea95f80537644af55e Thanks, Frederic --- Frederic Weisbecker (2

[tip: core/rcu] rcu: Remove superfluous rdp fetch

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: d3ad5bbc4da70c25ad6b386e038e711d0755767b Gitweb: https://git.kernel.org/tip/d3ad5bbc4da70c25ad6b386e038e711d0755767b Author:Frederic Weisbecker AuthorDate:Wed, 06 Jan 2021 23:07:15 +01:00

[tip: core/rcu] rcu/nocb: Fix missed nocb_timer requeue

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: b2fcf2102049f6e56981e0ab3d9b633b8e2741da Gitweb: https://git.kernel.org/tip/b2fcf2102049f6e56981e0ab3d9b633b8e2741da Author:Frederic Weisbecker AuthorDate:Tue, 23 Feb 2021 01:09:59 +01:00

[tip: core/rcu] rcu/nocb: Detect unsafe checks for offloaded rdp

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 3820b513a2e33d6dee1caa3b4815f92079cb9890 Gitweb: https://git.kernel.org/tip/3820b513a2e33d6dee1caa3b4815f92079cb9890 Author:Frederic Weisbecker AuthorDate:Thu, 12 Nov 2020 01:51:21 +01:00

[tip: core/rcu] rcu/nocb: Comment the reason behind BH disablement on batch processing

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 5de2e5bb80aeef82f75fff76120874cdc86f935d Gitweb: https://git.kernel.org/tip/5de2e5bb80aeef82f75fff76120874cdc86f935d Author:Frederic Weisbecker AuthorDate:Thu, 28 Jan 2021 18:12:08 +01:00

[tip: core/rcu] rcu/nocb: Avoid confusing double write of rdp->nocb_cb_sleep

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 8a682b3974c36853b52fc8ede14dee966e96e19f Gitweb: https://git.kernel.org/tip/8a682b3974c36853b52fc8ede14dee966e96e19f Author:Frederic Weisbecker AuthorDate:Thu, 28 Jan 2021 18:12:12 +01:00

[tip: core/rcu] rcu/nocb: Forbid NOCB toggling on offline CPUs

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 64305db2856b969a5d48e8f3a5b0d06b5594591c Gitweb: https://git.kernel.org/tip/64305db2856b969a5d48e8f3a5b0d06b5594591c Author:Frederic Weisbecker AuthorDate:Thu, 28 Jan 2021 18:12:09 +01:00

[tip: core/rcu] rcu/nocb: Rename nocb_gp_update_state to nocb_gp_update_state_deoffloading

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 55adc3e1c82a25e99e9efef4f2b14b8b4806918a Gitweb: https://git.kernel.org/tip/55adc3e1c82a25e99e9efef4f2b14b8b4806918a Author:Frederic Weisbecker AuthorDate:Thu, 28 Jan 2021 18:12:13 +01:00

[tip: core/rcu] rcu/nocb: Only (re-)initialize segcblist when needed on CPU up

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: ec711bc12c777b1165585f59f7a6c35a89e04cc3 Gitweb: https://git.kernel.org/tip/ec711bc12c777b1165585f59f7a6c35a89e04cc3 Author:Frederic Weisbecker AuthorDate:Thu, 28 Jan 2021 18:12:10 +01:00

[tip: core/rcu] rcu/nocb: Disable bypass when CPU isn't completely offloaded

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 76d00b494d7962e88d4bbd4135f34aba9019c67f Gitweb: https://git.kernel.org/tip/76d00b494d7962e88d4bbd4135f34aba9019c67f Author:Frederic Weisbecker AuthorDate:Tue, 23 Feb 2021 01:10:00 +01:00

[tip: core/rcu] rcu/nocb: Remove stale comment above rcu_segcblist_offload()

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 0efdf14a9f83618335a0849df3586808bff36cfb Gitweb: https://git.kernel.org/tip/0efdf14a9f83618335a0849df3586808bff36cfb Author:Frederic Weisbecker AuthorDate:Tue, 23 Feb 2021 01:10:01 +01:00

[tip: core/rcu] rcu/nocb: Move trace_rcu_nocb_wake() calls outside nocb_lock when possible

2021-04-11 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: e02691b7ef51c5fac0eee5a6ebde45ce92958fae Gitweb: https://git.kernel.org/tip/e02691b7ef51c5fac0eee5a6ebde45ce92958fae Author:Frederic Weisbecker AuthorDate:Tue, 23 Feb 2021 01:10:02 +01:00

[PATCH 5/5] srcu: Early test SRCU polling start

2021-04-08 Thread Frederic Weisbecker
but early calls to start_poll_synchronize_srcu() involve empty callbacks. Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes Cc: Uladzislau Rezki --- kernel/rcu/update.c | 12 +++- 1 file changed, 11 insertions

[PATCH 4/5] srcu: Queue a callback in case of early started poll

2021-04-08 Thread Frederic Weisbecker
grace period so there is no need to queue empty callbacks beyond the second call. Suggested-by: Paul E . McKenney Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes Cc: Uladzislau Rezki --- include/linux/srcutree.h

[PATCH 3/5] srcu: Fix broken node geometry after early ssp init

2021-04-08 Thread Frederic Weisbecker
early initialized ssp's. Queued callbacks are saved then requeued once the ssp reset is done. Suggested-by: Paul E . McKenney Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes Cc: Uladzislau Rezki --- include/linux

[PATCH 2/5] srcu: Initialize SRCU after timers

2021-04-08 Thread Frederic Weisbecker
mode until everything is well settled. Signed-off-by: Frederic Weisbecker Cc: Uladzislau Rezki Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes --- include/linux/srcu.h | 6 ++ init/main.c | 2 ++ kernel/rcu/rcu.h | 6 -- kernel

[PATCH 1/5] srcu: Unconditionally embed struct lockdep_map

2021-04-08 Thread Frederic Weisbecker
struct lockdep_map is empty when CONFIG_DEBUG_LOCK_ALLOC=n. We can remove the ifdeffery while adding the lockdep map in struct srcu_struct without risking consuming space in the off-case. This will also simplify further manipulations on this field. Signed-off-by: Frederic Weisbecker Cc

[PATCH 0/5] srcu: Fix boot stall v2

2021-04-08 Thread Frederic Weisbecker
: 0dc3551822c74a0f34783cbd64a9199c9758ec6d Thanks, Frederic --- Frederic Weisbecker (5): srcu: Unconditionally embed struct lockdep_map srcu: Initialize SRCU after timers srcu: Fix broken node geometry after early ssp init srcu: Queue a callback in case of early started poll

Re: [PATCH] hrtimer: avoid retrigger_next_event IPI

2021-04-07 Thread Frederic Weisbecker
On Wed, Apr 07, 2021 at 10:53:01AM -0300, Marcelo Tosatti wrote: > > Setting the realtime clock triggers an IPI to all CPUs to reprogram > hrtimers. > > However, only base, boottime and tai clocks have their offsets updated > (and therefore potentially require a reprogram). > > If the CPU is a

[PATCH] doc: Fix mistaken diagram references in RCU

2021-04-04 Thread Frederic Weisbecker
The 3 diagrams describing rcu_gp_init() all spuriously refer to the same figure, probably due to some copy/paste issue. Fix the references. Signed-off-by: Frederic Weisbecker --- .../RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH 3/3] srcu: Fix broken node geometry after early ssp init

2021-04-02 Thread Frederic Weisbecker
On Fri, Apr 02, 2021 at 08:03:57AM -0700, Paul E. McKenney wrote: > On Fri, Apr 02, 2021 at 12:02:21PM +0200, Frederic Weisbecker wrote: > > Arguably that's a quite a corner case and I don't expect anyone to call > > start_poll_synchronize_srcu() so early but who knows.

Re: [PATCH 3/3] srcu: Fix broken node geometry after early ssp init

2021-04-02 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 06:12:41PM -0700, Paul E. McKenney wrote: > On Fri, Apr 02, 2021 at 01:47:04AM +0200, Frederic Weisbecker wrote: gg> > void __init srcu_init(void) > > { > > - struct srcu_struct *ssp; > > + static struct srcu_data __initdata old_sdp; >

Re: [PATCH 1/3] srcu: Remove superfluous ssp initialization on deferred work queue

2021-04-01 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 05:48:56PM -0700, Paul E. McKenney wrote: > On Fri, Apr 02, 2021 at 01:47:02AM +0200, Frederic Weisbecker wrote: > > When an ssp has already started a grace period and queued an early work > > to flush after SRCU workqueues are created, we expect the ssp to

[PATCH 2/3] srcu: Remove superfluous sdp->srcu_lock_count zero filling

2021-04-01 Thread Frederic Weisbecker
alloc_percpu() zeroes out the allocated memory. Therefore we can assume the whole struct srcu_data to be clear after calling it, just like after a static initialization. No need for a special treatment in the dynamic allocation case. Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai

[PATCH 3/3] srcu: Fix broken node geometry after early ssp init

2021-04-01 Thread Frederic Weisbecker
. Unfortunately this involves a new field into struct srcu_struct to postpone the ssp hierarchy rebuild. Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: Joel Fernandes Cc: Uladzislau Rezki --- include/linux/srcutre

[PATCH 1/3] srcu: Remove superfluous ssp initialization on deferred work queue

2021-04-01 Thread Frederic Weisbecker
When an ssp has already started a grace period and queued an early work to flush after SRCU workqueues are created, we expect the ssp to be properly initialized already. So we can skip this step at this stage. Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Lai Jiangshan Cc: Neeraj

[PATCH 0/3] srcu: Fix boot stall

2021-04-01 Thread Frederic Weisbecker
nticks.git rcu/dev HEAD: 6390b2aa1295f79150fac8f5ff60177eea5d8f8b Thanks, Frederic --- Frederic Weisbecker (3): srcu: Remove superfluous ssp initialization on deferred work queue srcu: Remove superfluous sdp->srcu_lock_count zero filling srcu: Fix broken node geometr

Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language

2021-04-01 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 03:33:29PM -0700, Paul E. McKenney wrote: > On Thu, Apr 01, 2021 at 11:08:02PM +0200, Frederic Weisbecker wrote: > How about like this? I put this only in kvm.sh for the moment, but > if these keep cropping up I will just hit all the scripts. ;-) Sure, wor

Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language

2021-04-01 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 02:02:53PM -0700, Paul E. McKenney wrote: > On Thu, Apr 01, 2021 at 10:41:13PM +0200, Frederic Weisbecker wrote: > > On Thu, Apr 01, 2021 at 01:40:22PM -0700, Paul E. McKenney wrote: > > > On Thu, Apr 01, 2021 at 10:31:12PM +0200, Frederic Weisbecker wro

Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language

2021-04-01 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 01:40:22PM -0700, Paul E. McKenney wrote: > On Thu, Apr 01, 2021 at 10:31:12PM +0200, Frederic Weisbecker wrote: > > On Thu, Apr 01, 2021 at 11:51:16AM -0700, Paul E. McKenney wrote: > > > On Thu, Apr 01, 2021 at 03:26:02PM +0200, Frederic Weisbecker wrote

Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language

2021-04-01 Thread Frederic Weisbecker
On Thu, Apr 01, 2021 at 11:51:16AM -0700, Paul E. McKenney wrote: > On Thu, Apr 01, 2021 at 03:26:02PM +0200, Frederic Weisbecker wrote: > > Grepping for "CPU" on lscpu output isn't always successful, depending > > on the local language setting. As a result, the build

[PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all native language

2021-04-01 Thread Frederic Weisbecker
Grepping for "CPU" on lscpu output isn't always successful, depending on the local language setting. As a result, the build can be aborted early with: "make: the '-j' option requires a positive integer argument" Prefer a more generic solution. Signed-off-by:

Re: 回复: [PATCH 01/10] tick/nohz: Prevent tick_nohz_get_sleep_length() from returning negative value

2021-03-25 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 04:08:08PM +, Zhou Ti (x2019cwm) wrote: > But I don't think it's a good idea to handle this in callers, because > logically the function shouldn't return negative values. Returning 0 directly > would allow idle governors to get another chance to select again. Hmm,

Re: [PATCH 06/10] timer: Report ignored local enqueue in nohz mode

2021-03-25 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 04:27:56PM +0100, Peter Zijlstra wrote: > On Thu, Mar 11, 2021 at 01:37:04PM +0100, Frederic Weisbecker wrote: > > Enqueuing a local timer after the tick has been stopped will result in > > the timer being ignored until the next random interrupt. > >

Re: [PATCH tip/core/rcu 2/3] rcu: Provide polling interfaces for Tiny RCU grace periods

2021-03-23 Thread Frederic Weisbecker
On Mon, Mar 22, 2021 at 12:45:22PM -0700, Paul E. McKenney wrote: > On Mon, Mar 22, 2021 at 08:00:35PM +0100, Frederic Weisbecker wrote: > > But poll_state_synchronize_rcu() checks that the gp_num has changed, > > which is not needed for cond_synchronize_rcu() since this it is &

Re: [PATCH tip/core/rcu 2/3] rcu: Provide polling interfaces for Tiny RCU grace periods

2021-03-22 Thread Frederic Weisbecker
On Mon, Mar 22, 2021 at 08:47:44AM -0700, Paul E. McKenney wrote: > On Sun, Mar 21, 2021 at 11:28:55PM +0100, Frederic Weisbecker wrote: > > On Wed, Mar 03, 2021 at 04:26:31PM -0800, paul...@kernel.org wrote: > > > From: "Paul E. McKenney" > > > > > &

Re: [PATCH tip/core/rcu 2/3] rcu: Provide polling interfaces for Tiny RCU grace periods

2021-03-21 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:26:31PM -0800, paul...@kernel.org wrote: > From: "Paul E. McKenney" > > There is a need for a non-blocking polling interface for RCU grace > periods, so this commit supplies start_poll_synchronize_rcu() and > poll_state_synchronize_rcu() for this purpose. Note that

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-19 Thread Frederic Weisbecker
On Fri, Mar 19, 2021 at 04:38:48PM -0700, Paul E. McKenney wrote: > > I didn't even think that far. > > My scenario was: > > > > 1. cookie = start_poll_synchronize_rcu() > > > > > > 2. cond_synchronize_rcu() checks the cookie and sees that the > > grace period has not yet expired. So it

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-19 Thread Frederic Weisbecker
On Fri, Mar 19, 2021 at 10:51:16AM -0700, Paul E. McKenney wrote: > On Fri, Mar 19, 2021 at 02:58:54PM +0100, Frederic Weisbecker wrote: > > It's all a matter of personal taste but if I may suggest some namespace > > modifications: > > > >

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-19 Thread Frederic Weisbecker
has elapsed since the earlier call from > + * which oldstate was obtained, return @true, otherwise return @false. > + * Otherwise, invoke synchronize_rcu() to wait for a full grace period. Rephrase suggestion for the last sentence: "In case of failure, it's up to the caller to try polling again later or invoke synchronize_rcu() to wait for a new full grace period to complete." In any case: Reviewed-by: Frederic Weisbecker Thanks!

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-18 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 09:51:01AM -0700, Paul E. McKenney wrote: > On Tue, Mar 16, 2021 at 04:17:50PM +0100, Frederic Weisbecker wrote: > > On Wed, Mar 03, 2021 at 04:26:30PM -0800, paul...@kernel.org wrote: > > > +/** > > > + * poll_state_synchronize_rcu - Conditio

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-16 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:26:30PM -0800, paul...@kernel.org wrote: > +/** > + * poll_state_synchronize_rcu - Conditionally wait for an RCU grace period > + * > + * @oldstate: return from call to get_state_synchronize_rcu() or > start_poll_synchronize_rcu() > + * > + * If a full RCU grace period

Re: [PATCH 01/10] tick/nohz: Prevent tick_nohz_get_sleep_length() from returning negative value

2021-03-16 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 03:35:37PM +0100, Peter Zijlstra wrote: > On Tue, Mar 16, 2021 at 02:37:03PM +0100, Frederic Weisbecker wrote: > > On Tue, Mar 16, 2021 at 01:21:29PM +0100, Peter Zijlstra wrote: > > > On Thu, Mar 11, 2021 at 01:36:59PM +0100, Frederic Weisbecker wrote: &

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-16 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:26:30PM -0800, paul...@kernel.org wrote: > +/** > + * poll_state_synchronize_rcu - Conditionally wait for an RCU grace period > + * > + * @oldstate: return from call to get_state_synchronize_rcu() or > start_poll_synchronize_rcu() > + * > + * If a full RCU grace period

Re: [PATCH 01/10] tick/nohz: Prevent tick_nohz_get_sleep_length() from returning negative value

2021-03-16 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 01:21:29PM +0100, Peter Zijlstra wrote: > On Thu, Mar 11, 2021 at 01:36:59PM +0100, Frederic Weisbecker wrote: > > From: "Zhou Ti (x2019cwm)" > > > > If the hardware clock happens to fire its interrupts late, two possible >

Re: [PATCH 02/10] tick/nohz: Add tick_nohz_full_this_cpu()

2021-03-16 Thread Frederic Weisbecker
On Tue, Mar 16, 2021 at 01:28:01PM +0100, Peter Zijlstra wrote: > On Thu, Mar 11, 2021 at 01:37:00PM +0100, Frederic Weisbecker wrote: > > Optimize further the check for local full dynticks CPU. Testing directly > > tick_nohz_full_cpu(smp_processor_id()) is suboptimal because t

Re: [PATCH 12/13] rcu/nocb: Prepare for finegrained deferred wakeup

2021-03-16 Thread Frederic Weisbecker
On Mon, Mar 15, 2021 at 08:02:39PM -0700, Paul E. McKenney wrote: > On Tue, Feb 23, 2021 at 01:10:10AM +0100, Frederic Weisbecker wrote: > > Provide a way to tune the deferred wakeup level we want to perform from > > a safe wakeup point. Currently those sites are: > > > &

Re: [PATCH 10/13] rcu/nocb: Delete bypass_timer upon nocb_gp wakeup

2021-03-15 Thread Frederic Weisbecker
On Mon, Mar 15, 2021 at 10:53:36PM +0800, Boqun Feng wrote: > On Wed, Mar 10, 2021 at 11:17:02PM +0100, Frederic Weisbecker wrote: > > On Tue, Mar 02, 2021 at 05:24:56PM -0800, Paul E. McKenney wrote: > > > On Tue, Feb 23, 2021 at 01:10:08AM +0100, Frederic Weisbecker wrote: >

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-12 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:26:30PM -0800, paul...@kernel.org wrote: > /** > + * start_poll_state_synchronize_rcu - Snapshot and start RCU grace period > + * > + * Returns a cookie that is used by a later call to cond_synchronize_rcu() > + * or poll_state_synchronize_rcu() to determine whether or

Re: [PATCH tip/core/rcu 1/3] rcu: Provide polling interfaces for Tree RCU grace periods

2021-03-12 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:26:30PM -0800, paul...@kernel.org wrote: > From: "Paul E. McKenney" > > There is a need for a non-blocking polling interface for RCU grace > periods, so this commit supplies start_poll_synchronize_rcu() and > poll_state_synchronize_rcu() for this purpose. Note that

Re: [PATCH tip/core/rcu 06/10] softirq: Don't try waking ksoftirqd before it has been spawned

2021-03-12 Thread Frederic Weisbecker
rq processing when ksoftirqd does not > yet exist. With this change, the above test passes. > > Reported-by: Sebastian Andrzej Siewior > Reported-by: Uladzislau Rezki > Cc: Peter Zijlstra > Cc: Thomas Gleixner > [ paulmck: Remove unneeded check per Sebastian Siewior feedback. ] > Signed-off-by: Paul E. McKenney Reviewed-by: Frederic Weisbecker

Re: [PATCH tip/core/rcu 07/10] rcu: Prevent dyntick-idle until ksoftirqd has been spawned

2021-03-11 Thread Frederic Weisbecker
On Wed, Mar 03, 2021 at 04:00:16PM -0800, paul...@kernel.org wrote: > From: "Paul E. McKenney" > > After interrupts have enabled at boot but before some random point > in early_initcall() processing, softirq processing is unreliable. > If softirq sees a need to push softirq-handler invocation to

[PATCH 10/10] tick/nohz: Kick only _queued_ task whose tick dependency is updated

2021-03-11 Thread Frederic Weisbecker
we never deactivate a task while it is running, the only exception being the task deactivating itself while scheduling out. Suggested-by: Peter Zijlstra Signed-off-by: Marcelo Tosatti Cc: Yunfeng Ye Cc: Thomas Gleixner Cc: Rafael J. Wysocki Signed-off-by: Frederic Weisbecker --- include/linu

[PATCH 09/10] tick/nohz: Change signal tick dependency to wakeup CPUs of member tasks

2021-03-11 Thread Frederic Weisbecker
Signed-off-by: Frederic Weisbecker --- include/linux/tick.h | 8 kernel/time/posix-cpu-timers.c | 4 ++-- kernel/time/tick-sched.c | 15 +-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index

[PATCH 08/10] tick/nohz: Only wakeup a single target cpu when kicking a task

2021-03-11 Thread Frederic Weisbecker
cpu and task->tick_dep_mask. Suggested-by: Peter Zijlstra Signed-off-by: Frederic Weisbecker Cc: Yunfeng Ye Cc: Thomas Gleixner Cc: Rafael J. Wysocki Signed-off-by: Marcelo Tosatti --- kernel/time/tick-sched.c | 40 +++- 1 file changed, 27 insertions(

[PATCH 06/10] timer: Report ignored local enqueue in nohz mode

2021-03-11 Thread Frederic Weisbecker
Enqueuing a local timer after the tick has been stopped will result in the timer being ignored until the next random interrupt. Perform sanity checks to report these situations. Reviewed-by: Rafael J. Wysocki Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo

[PATCH 05/10] tick/nohz: Update idle_exittime on actual idle exit

2021-03-11 Thread Frederic Weisbecker
tra Cc: Thomas Gleixner Cc: Marcelo Tosatti Cc: Rafael J. Wysocki Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index c86b586d65e0..2a041d0dc

[PATCH 07/10] tick/nohz: Update nohz_full Kconfig help

2021-03-11 Thread Frederic Weisbecker
CONFIG_NO_HZ_FULL behaves just like CONFIG_NO_HZ_IDLE by default. Reassure distros about it. Signed-off-by: Frederic Weisbecker Cc: Yunfeng Ye Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Marcelo Tosatti Cc: Rafael J. Wysocki --- kernel/time/Kconfig | 11 ++- 1 file changed, 6

[PATCH 04/10] tick/nohz: Remove superflous check for CONFIG_VIRT_CPU_ACCOUNTING_NATIVE

2021-03-11 Thread Frederic Weisbecker
The vtime_accounting_enabled_this_cpu() early check already makes what follows as dead code in the case of CONFIG_VIRT_CPU_ACCOUNTING_NATIVE. No need to keep the ifdeferry around. Signed-off-by: Frederic Weisbecker Cc: Yunfeng Ye Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Marcelo Tosatti Cc

[PATCH 01/10] tick/nohz: Prevent tick_nohz_get_sleep_length() from returning negative value

2021-03-11 Thread Frederic Weisbecker
er Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index e10a4af88737..22b6a46818cf 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1142,6 +1142,9

[PATCH 00/10] tick/nohz updates

2021-03-11 Thread Frederic Weisbecker
rs/nohz HEAD: e469edfa00f97e5ec5d31fe31d3aef0a5c9bd607 Thanks, Frederic --- Frederic Weisbecker (5): tick/nohz: Add tick_nohz_full_this_cpu() tick/nohz: Remove superflous check for CONFIG_VIRT_CPU_ACCOUNTING_NATIVE timer: Report ignored local enqueue in nohz mode tick/nohz: Upd

[PATCH 03/10] tick/nohz: Conditionally restart tick on idle exit

2021-03-11 Thread Frederic Weisbecker
on idle exit when it's strictly necessary. Signed-off-by: Yunfeng Ye Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Marcelo Tosatti Cc: Rafael J. Wysocki Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 50 1 file changed, 30 insertions

[PATCH 02/10] tick/nohz: Add tick_nohz_full_this_cpu()

2021-03-11 Thread Frederic Weisbecker
that handles that correctly and convert some users along. Signed-off-by: Frederic Weisbecker Cc: Yunfeng Ye Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Marcelo Tosatti Cc: Rafael J. Wysocki --- include/linux/tick.h | 11 ++- kernel/time/tick-sched.c | 12 +--- 2 files

Re: [PATCH 10/13] rcu/nocb: Delete bypass_timer upon nocb_gp wakeup

2021-03-10 Thread Frederic Weisbecker
On Tue, Mar 02, 2021 at 05:24:56PM -0800, Paul E. McKenney wrote: > On Tue, Feb 23, 2021 at 01:10:08AM +0100, Frederic Weisbecker wrote: > > A NOCB-gp wake up can safely delete the nocb_bypass_timer. nocb_gp_wait() > > is going to check again the bypass state and rearm t

Re: [PATCH 11/13] rcu/nocb: Only cancel nocb timer if not polling

2021-03-10 Thread Frederic Weisbecker
On Tue, Mar 02, 2021 at 05:22:29PM -0800, Paul E. McKenney wrote: > On Tue, Feb 23, 2021 at 01:10:09AM +0100, Frederic Weisbecker wrote: > > No need to disarm the nocb_timer if rcu_nocb is polling because it > > shouldn't be armed either. > > > > Signed-off-by: Freder

Re: [PATCH 05/13] rcu/nocb: Use the rcuog CPU's ->nocb_timer

2021-03-10 Thread Frederic Weisbecker
On Tue, Mar 02, 2021 at 05:15:57PM -0800, Paul E. McKenney wrote: > The first question is of course: Did you try this with lockdep enabled? ;-) Yep I always do. But I may miss some configs on my testings. I usually test at least TREE01 on x86 and arm64. > > @@ -1702,43 +1692,50 @@ bool

Re: [patch V3 6/6] rcu: Prevent false positive softirq warning on RT

2021-03-09 Thread Frederic Weisbecker
-off-by: Thomas Gleixner > Tested-by: Sebastian Andrzej Siewior > Reviewed-by: Paul E. McKenney Reviewed-by: Frederic Weisbecker

Re: timer: Report ignored local enqueue in nohz mode?

2021-03-05 Thread Frederic Weisbecker
b9e65158ef1cb2bb94372 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Fri, 8 Jan 2021 13:50:12 +0100 Subject: [PATCH] timer: Report ignored local enqueue in nohz mode Enqueuing a local timer after the tick has been stopped will result in the timer being ignored until the next random inter

Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-03-03 Thread Frederic Weisbecker
On Tue, Mar 02, 2021 at 06:06:43PM -0800, Paul E. McKenney wrote: > On Wed, Mar 03, 2021 at 02:35:33AM +0100, Frederic Weisbecker wrote: > > On Tue, Mar 02, 2021 at 10:17:29AM -0800, Paul E. McKenney wrote: > > > On Tue, Mar 02, 2021 at 01:34:44PM +0100, Frederic Weisbecker wrot

Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-03-03 Thread Frederic Weisbecker
On Tue, Mar 02, 2021 at 10:17:29AM -0800, Paul E. McKenney wrote: > On Tue, Mar 02, 2021 at 01:34:44PM +0100, Frederic Weisbecker wrote: > > OK, how about if I queue a temporary commit (shown below) that just > calls out the first scenario so that I can start testing, and you get >

Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-03-02 Thread Frederic Weisbecker
On Mon, Mar 01, 2021 at 05:48:29PM -0800, Paul E. McKenney wrote: > On Wed, Feb 24, 2021 at 11:06:06PM +0100, Frederic Weisbecker wrote: > > On Wed, Feb 24, 2021 at 10:37:09AM -0800, Paul E. McKenney wrote: > > > On Tue, Feb 23, 2021 at 01:09:59AM +0100, Frederic Weisbecker

Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-02-24 Thread Frederic Weisbecker
On Wed, Feb 24, 2021 at 04:14:25PM -0800, Paul E. McKenney wrote: > On Wed, Feb 24, 2021 at 11:06:06PM +0100, Frederic Weisbecker wrote: > > I managed to recollect some pieces of my brain. So keep the above but > > let's change the point 10: > > > > 10. CPU 0 e

Re: [PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-02-24 Thread Frederic Weisbecker
On Wed, Feb 24, 2021 at 10:37:09AM -0800, Paul E. McKenney wrote: > On Tue, Feb 23, 2021 at 01:09:59AM +0100, Frederic Weisbecker wrote: > > Two situations can cause a missed nocb timer rearm: > > > > 1) rdp(CPU A) queues its nocb timer. The grace period elapses before

[PATCH 12/13] rcu/nocb: Prepare for finegrained deferred wakeup

2021-02-22 Thread Frederic Weisbecker
-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng --- kernel/rcu/tree.c| 2 +- kernel/rcu/tree.h| 2 +- kernel/rcu/tree_plugin.h | 15 --- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/kernel

[PATCH 13/13] rcu/nocb: Unify timers

2021-02-22 Thread Frederic Weisbecker
shouldn't bring visible overhead since the timers almost never fire. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng --- include/trace/events/rcu.h | 1 + kernel/rcu/tree.h | 6 +-- kernel/rcu/tree_plugin.h

[PATCH 09/13] rcu/nocb: Cancel nocb_timer upon nocb_gp wakeup

2021-02-22 Thread Frederic Weisbecker
As we wake up in nocb_gp_wait(), there is no need to keep the nocb_timer around as we are going to go through the whole rdp list again. Any update performed before the timer was armed will now be visible after the nocb_gp_lock acquire. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc

[PATCH 10/13] rcu/nocb: Delete bypass_timer upon nocb_gp wakeup

2021-02-22 Thread Frederic Weisbecker
A NOCB-gp wake up can safely delete the nocb_bypass_timer. nocb_gp_wait() is going to check again the bypass state and rearm the bypass timer if necessary. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng

[PATCH 11/13] rcu/nocb: Only cancel nocb timer if not polling

2021-02-22 Thread Frederic Weisbecker
No need to disarm the nocb_timer if rcu_nocb is polling because it shouldn't be armed either. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng --- kernel/rcu/tree_plugin.h | 14 +++--- 1 file changed, 7

[PATCH 07/13] rcu/nocb: Directly call __wake_nocb_gp() from bypass timer

2021-02-22 Thread Frederic Weisbecker
can be for any rdp from the group and not necessarily the rdp leader on which the bypass timer is attached. Therefore we can simply call directly __wake_nocb_gp(). This way we don't even need to lock the nocb_lock. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: J

[PATCH 05/13] rcu/nocb: Merge nocb_timer to the rdp leader

2021-02-22 Thread Frederic Weisbecker
ter though because we only need the guarantee to see the timer armed if we were the last one to arm it. Any other situation (another rdp has armed it and we either see it or not) is fine. This solves all the issues listed above. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan

[PATCH 08/13] rcu/nocb: Allow de-offloading rdp leader

2021-02-22 Thread Frederic Weisbecker
: Neeraj Upadhyay Cc: Boqun Feng Signed-off-by: Frederic Weisbecker --- kernel/rcu/tree_plugin.h | 4 1 file changed, 4 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index c80b214a86bb..0fdf0223f08f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu

[PATCH 04/13] rcu/nocb: Move trace_rcu_nocb_wake() calls outside nocb_lock when possible

2021-02-22 Thread Frederic Weisbecker
Those tracing calls don't need to be under the nocb lock. Move them outside. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng --- kernel/rcu/tree_plugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH 03/13] rcu/nocb: Remove stale comment above rcu_segcblist_offload()

2021-02-22 Thread Frederic Weisbecker
Remove stale comment claiming that the cblist must be empty before changing the offloading state. This applied when the offloaded state was defined exclusively on boot. Reported-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc

[PATCH 06/13] timer: Revert "timer: Add timer_curr_running()"

2021-02-22 Thread Frederic Weisbecker
This reverts commit dcd42591ebb8a25895b551a5297ea9c24414ba54. The only user was RCU/nocb. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng Cc: Thomas Gleixner --- include/linux/timer.h | 2 -- kernel/time/timer.c

[PATCH 01/13] rcu/nocb: Fix potential missed nocb_timer rearm

2021-02-22 Thread Frederic Weisbecker
otic behaviour. Fix this with resetting rdp->nocb_defer_wakeup everytime we disarm the timer. Fixes: d1b222c6be1f (rcu/nocb: Add bypass callback queueing) Cc: Stable Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng Signed-off-by: Frederic Weisbecker --- k

[PATCH 02/13] rcu/nocb: Disable bypass when CPU isn't completely offloaded

2021-02-22 Thread Frederic Weisbecker
, only enable bypass once we safely complete the offloading process. Reported-by: Paul E. McKenney Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng Signed-off-by: Frederic Weisbecker --- include/linux/rcu_segcblist.h | 7 --- kernel/rcu/tree_plugin.h

[PATCH 00/13] rcu/nocb updates v2

2021-02-22 Thread Frederic Weisbecker
t;timer: Add timer_curr_running()"" * New patch git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git rcu/dev-v2 HEAD: 925ee3076eb694db893e2c6664d90ad8fb9cb6e5 Thanks, Frederic --- Frederic Weisbecker (13): rcu/nocb: Fix potential missed noc

Re: [PATCH] tick/nohz: Make the idle_exittime update correctly

2021-02-19 Thread Frederic Weisbecker
ll_update_tick tick_nohz_restart_sched_tick ts->idle_exittime = now; It's thus overwritten by mistake on nohz_full tick restart. Move the update to the appropriate idle exit path instead. Signed-off-by: Yunfeng Ye Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c

Re: nohz: Update tick instead of restarting tick in tick_nohz_idle_exit()

2021-02-19 Thread Frederic Weisbecker
sary. Signed-off-by: Yunfeng Ye Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 44 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3e272490fe2e..79796286a4ba 100

Re: [PATCH] fix the issue that the tick_nohz_get_sleep_length() function could return a negative value

2021-02-19 Thread Frederic Weisbecker
expires past the last idle entry time. Make sure that both cases are handled to avoid returning a negative duration to the cpuidle governors. Signed-off-by: Ti Zhou Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/kernel/ti

[tip: sched/core] static_call: Provide DEFINE_STATIC_CALL_RET0()

2021-02-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the sched/core branch of tip: Commit-ID: 29fd01944b7273bb630c649a2104b7f9e4ef3fa6 Gitweb: https://git.kernel.org/tip/29fd01944b7273bb630c649a2104b7f9e4ef3fa6 Author:Frederic Weisbecker AuthorDate:Mon, 18 Jan 2021 15:12:17 +01:00

[tip: sched/core] rcu: Pull deferred rcuog wake up to rcu_eqs_enter() callers

2021-02-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the sched/core branch of tip: Commit-ID: 54b7429efffc99e845ba9381bee3244f012a06c2 Gitweb: https://git.kernel.org/tip/54b7429efffc99e845ba9381bee3244f012a06c2 Author:Frederic Weisbecker AuthorDate:Mon, 01 Feb 2021 00:05:44 +01:00

[tip: sched/core] rcu/nocb: Perform deferred wake up before last idle's need_resched() check

2021-02-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the sched/core branch of tip: Commit-ID: 43789ef3f7d61aa7bed0cb2764e588fc990c30ef Gitweb: https://git.kernel.org/tip/43789ef3f7d61aa7bed0cb2764e588fc990c30ef Author:Frederic Weisbecker AuthorDate:Mon, 01 Feb 2021 00:05:45 +01:00

  1   2   3   4   5   6   7   8   9   10   >