Re: [PATCH v2 1/4] sched/isolation: API to get housekeeping online CPUs

2020-09-24 Thread Frederic Weisbecker
On Thu, Sep 24, 2020 at 10:40:29AM +0200, pet...@infradead.org wrote: > On Wed, Sep 23, 2020 at 02:11:23PM -0400, Nitesh Narayan Lal wrote: > > Introduce a new API hk_num_online_cpus(), that can be used to > > retrieve the number of online housekeeping CPUs that are meant to handle > > managed IRQ

Re: [RFC PATCH 12/12] rcu: Nocb (de)activate through sysfs

2020-09-23 Thread Frederic Weisbecker
On Wed, Sep 23, 2020 at 08:47:16AM -0700, Paul E. McKenney wrote: > On Wed, Sep 23, 2020 at 05:27:46PM +0200, Frederic Weisbecker wrote: > > On Mon, Sep 21, 2020 at 05:26:29PM -0700, Paul E. McKenney wrote: > > > On Mon, Sep 21, 2020 at 02:43:51PM +0200, Frederi

Re: [RFC PATCH 05/12] rcu: De-offloading GP kthread

2020-09-23 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 05:10:15PM -0700, Paul E. McKenney wrote: > On Mon, Sep 21, 2020 at 02:43:44PM +0200, Frederic Weisbecker wrote: > > @@ -2292,6 +2340,7 @@ void __init rcu_init_nohz(void) > > rcu_segcblist_init(>cblist); > > rcu_s

Re: [RFC PATCH 07/12] rcu: Shutdown nocb timer on de-offloading

2020-09-23 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 05:17:56PM -0700, Paul E. McKenney wrote: > On Mon, Sep 21, 2020 at 02:43:46PM +0200, Frederic Weisbecker wrote: > > Make sure the nocb timer can't fire anymore before we reach the final > > de-offload state. Spuriously waking up the GP kthread is no big

Re: [RFC PATCH 12/12] rcu: Nocb (de)activate through sysfs

2020-09-23 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 05:26:29PM -0700, Paul E. McKenney wrote: > On Mon, Sep 21, 2020 at 02:43:51PM +0200, Frederic Weisbecker wrote: > > Not for merge. > > > > Make nocb toggable for a given CPU using: > > /sys/devices/system/cpu/cpu*/hotplug/nocb > > &g

Re: [RFC PATCH 01/12] rcu: Implement rcu_segcblist_is_offloaded() config dependent

2020-09-23 Thread Frederic Weisbecker
On Tue, Sep 22, 2020 at 04:11:50PM -0700, Paul E. McKenney wrote: > On Tue, Sep 22, 2020 at 11:43:26PM +0200, Frederic Weisbecker wrote: > > On Mon, Sep 21, 2020 at 05:27:32PM -0700, Paul E. McKenney wrote: > > > On Mon, Sep 21, 2020 at 02:43:40PM +0200, Frederi

Re: [RFC PATCH 01/12] rcu: Implement rcu_segcblist_is_offloaded() config dependent

2020-09-22 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 05:27:32PM -0700, Paul E. McKenney wrote: > On Mon, Sep 21, 2020 at 02:43:40PM +0200, Frederic Weisbecker wrote: > > This simplify the usage of this API and avoid checking the kernel > > config from the callers. > > > > Suggested-by: Paul

Re: [RFC][Patch v1 3/3] PCI: Limit pci_alloc_irq_vectors as per housekeeping CPUs

2020-09-22 Thread Frederic Weisbecker
On Tue, Sep 22, 2020 at 09:54:58AM -0400, Nitesh Narayan Lal wrote: > >> If min_vecs > num_housekeeping, for example: > >> > >> /* PCI MSI/MSIx support */ > >> #define XGBE_MSI_BASE_COUNT 4 > >> #define XGBE_MSI_MIN_COUNT (XGBE_MSI_BASE_COUNT + 1) > >> > >> Then the protection fails. > >

Re: [RFC][Patch v1 1/3] sched/isolation: API to get num of hosekeeping CPUs

2020-09-22 Thread Frederic Weisbecker
On Tue, Sep 22, 2020 at 09:50:55AM -0400, Nitesh Narayan Lal wrote: > On 9/22/20 6:08 AM, Frederic Weisbecker wrote: > TBH I don't have a very strong case here at the moment. > But still, IMHO, this will force the user to have both managed irqs and > nohz_full in their environme

Re: [RFC][Patch v1 2/3] i40e: limit msix vectors based on housekeeping CPUs

2020-09-22 Thread Frederic Weisbecker
On Tue, Sep 22, 2020 at 09:34:02AM -0400, Nitesh Narayan Lal wrote: > On 9/22/20 5:54 AM, Frederic Weisbecker wrote: > > But I don't also want to push toward a complicated solution to handle CPU > > hotplug > > if there is no actual problem to solve there. > > Sure,

Re: [RFC][Patch v1 1/3] sched/isolation: API to get num of hosekeeping CPUs

2020-09-22 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 11:16:51PM -0400, Nitesh Narayan Lal wrote: > > On 9/21/20 7:40 PM, Frederic Weisbecker wrote: > > On Wed, Sep 09, 2020 at 11:08:16AM -0400, Nitesh Narayan Lal wrote: > >> +/* > >> + * num_housekeeping_cpus() - Read t

Re: [RFC][Patch v1 2/3] i40e: limit msix vectors based on housekeeping CPUs

2020-09-22 Thread Frederic Weisbecker
On Mon, Sep 21, 2020 at 11:08:20PM -0400, Nitesh Narayan Lal wrote: > > On 9/21/20 6:58 PM, Frederic Weisbecker wrote: > > On Thu, Sep 17, 2020 at 11:23:59AM -0700, Jesse Brandeburg wrote: > >> Nitesh Narayan Lal wrote: > >> > >>> In a realtime enviro

Re: [RFC][Patch v1 1/3] sched/isolation: API to get num of hosekeeping CPUs

2020-09-21 Thread Frederic Weisbecker
On Wed, Sep 09, 2020 at 11:08:16AM -0400, Nitesh Narayan Lal wrote: > +/* > + * num_housekeeping_cpus() - Read the number of housekeeping CPUs. > + * > + * This function returns the number of available housekeeping CPUs > + * based on __num_housekeeping_cpus which is of type atomic_t > + * and is

Re: [RFC][Patch v1 2/3] i40e: limit msix vectors based on housekeeping CPUs

2020-09-21 Thread Frederic Weisbecker
On Thu, Sep 17, 2020 at 11:23:59AM -0700, Jesse Brandeburg wrote: > Nitesh Narayan Lal wrote: > > > In a realtime environment, it is essential to isolate unwanted IRQs from > > isolated CPUs to prevent latency overheads. Creating MSIX vectors only > > based on the online CPUs could lead to a

[RFC PATCH 11/12] rcu: Locally accelerate callbacks as long as offloading isn't complete

2020-09-21 Thread Frederic Weisbecker
I have no idea what I'm doing but doing that looks necessary to me. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel Fernandes --- kernel/rcu/tree.c | 7 +++ 1

[RFC PATCH 12/12] rcu: Nocb (de)activate through sysfs

2020-09-21 Thread Frederic Weisbecker
Not for merge. Make nocb toggable for a given CPU using: /sys/devices/system/cpu/cpu*/hotplug/nocb This is only intended for those who want to test this patchset. The real interfaces will be cpuset/isolation and rcutorture. Not-Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney

[RFC PATCH 01/12] rcu: Implement rcu_segcblist_is_offloaded() config dependent

2020-09-21 Thread Frederic Weisbecker
This simplify the usage of this API and avoid checking the kernel config from the callers. Suggested-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel Fernandes --- kernel/rcu

[RFC PATCH 09/12] rcu: Set SEGCBLIST_SOFTIRQ_ONLY at the very last stage of de-offloading

2020-09-21 Thread Frederic Weisbecker
Set SEGCBLIST_SOFTIRQ_ONLY once everything is settled. After that, the callbacks are handled locklessly and locally. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel

[RFC PATCH 07/12] rcu: Shutdown nocb timer on de-offloading

2020-09-21 Thread Frederic Weisbecker
Make sure the nocb timer can't fire anymore before we reach the final de-offload state. Spuriously waking up the GP kthread is no big deal but we must prevent from executing the timer callback without nocb locking. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E

[RFC PATCH 04/12] rcu: De-offloading CB kthread

2020-09-21 Thread Frederic Weisbecker
must notify the de-offloading worker so that it can resume the de-offloading while being sure that callbacks won't be handled remotely anymore. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc

[RFC PATCH 02/12] rcu: Turn enabled/offload states into a common flag

2020-09-21 Thread Frederic Weisbecker
Gather the segcblist properties in a common map to avoid spreading booleans in the structure. And this prepares for the offloaded state to be mutable on runtime. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc

[RFC PATCH 00/12] rcu/nocb: De-offload and re-offload support v2

2020-09-21 Thread Frederic Weisbecker
/git/frederic/linux-dynticks.git rcu/nocb HEAD: 6abe8408307eaeb03b4a0470945943c1decbc4b3 Thanks, Frederic --- Frederic Weisbecker (12): rcu: Implement rcu_segcblist_is_offloaded() config dependent rcu: Turn enabled/offload states into a common flag rcu: Provide

[RFC PATCH 08/12] rcu: Flush bypass before setting SEGCBLIST_SOFTIRQ_ONLY

2020-09-21 Thread Frederic Weisbecker
Make sure to handle the pending bypass queue before we switch to the final de-offload state. We'll have to be careful and later set SEGCBLIST_SOFTIRQ_ONLY before re-enabling again IRQs, or new bypass callbacks could be queued in the meantine. Inspired-by: Paul E. McKenney Signed-off-by: Frederic

[RFC PATCH 06/12] rcu: Re-offload support

2020-09-21 Thread Frederic Weisbecker
stop processing the callbacks locally. Ordering must be carefully enforced so that the callbacks that used to be processed locally without locking must have their latest updates visible by the time they get processed by the kthreads. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker

[RFC PATCH 03/12] rcu: Provide basic callback offloading state machine bits

2020-09-21 Thread Frederic Weisbecker
for the state machine that will carry up all the steps to enforce correctness while serving callbacks processing all along. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel

[RFC PATCH 10/12] rcu: Process batch locally as long as offloading isn't complete

2020-09-21 Thread Frederic Weisbecker
during these intermediate states. Some pieces there may still be necessary. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai Jiangshan Cc: Joel Fernandes --- kernel/rcu/rcu_segcblist.h | 12

[RFC PATCH 05/12] rcu: De-offloading GP kthread

2020-09-21 Thread Frederic Weisbecker
notify the de-offloading worker so that it can resume the de-offloading while being sure that callbacks won't be handled remotely anymore. Inspired-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Lai

Re: Requirements to control kernel isolation/nohz_full at runtime

2020-09-09 Thread Frederic Weisbecker
On Mon, Sep 07, 2020 at 05:34:17PM +0200, pet...@infradead.org wrote: > > (your mailer broke and forgot to keep lines shorter than 78 chars) I manually reordered the lines and that's indeed quite a mess :o) > > On Tue, Sep 01, 2020 at 12:46:41PM +0200, Frederic Weis

Re: Requirements to control kernel isolation/nohz_full at runtime

2020-09-09 Thread Frederic Weisbecker
On Fri, Sep 04, 2020 at 01:47:40PM -0700, Paul E. McKenney wrote: > On Tue, Sep 01, 2020 at 12:46:41PM +0200, Frederic Weisbecker wrote: > > Hi, > > > > I'm currently working on making nohz_full/nohz_idle runtime toggable > > and some other people seem to be interes

Re: Requirements to control kernel isolation/nohz_full at runtime

2020-09-09 Thread Frederic Weisbecker
On Thu, Sep 03, 2020 at 03:52:00PM -0300, Marcelo Tosatti wrote: > On Thu, Sep 03, 2020 at 02:36:36PM -0400, Phil Auld wrote: > > exclusive cpusets is used now to control scheduler load balancing on > > a group of cpus. It seems to me that this is the same idea and is part > > of the isolation

Re: Requirements to control kernel isolation/nohz_full at runtime

2020-09-09 Thread Frederic Weisbecker
On Thu, Sep 03, 2020 at 03:23:59PM -0300, Marcelo Tosatti wrote: > On Tue, Sep 01, 2020 at 12:46:41PM +0200, Frederic Weisbecker wrote: > > == Unbound affinity == > > > > Restore kernel threads, workqueue, timers, etc... wide affinity. But take > > care of cpumasks

Re: [patch 2/2] nohz: try to avoid IPI when setting tick dependency for task

2020-09-03 Thread Frederic Weisbecker
On Tue, Aug 25, 2020 at 03:41:49PM -0300, Marcelo Tosatti wrote: > When enabling per-CPU posix timers, an IPI to nohz_full CPUs might be > performed (to re-read the dependencies and possibly not re-enter > nohz_full on a given CPU). > > A common case is for applications that run on nohz_full=

Re: [patch 1/2] nohz: try to avoid IPI when configuring per-CPU posix timer

2020-09-01 Thread Frederic Weisbecker
On Tue, Aug 25, 2020 at 03:41:48PM -0300, Marcelo Tosatti wrote: > When enabling per-CPU posix timers, an IPI to nohz_full CPUs might be > performed (to re-read the dependencies and possibly not re-enter > nohz_full on a given CPU). > > A common case is for applications that run on nohz_full=

Requirements to control kernel isolation/nohz_full at runtime

2020-09-01 Thread Frederic Weisbecker
Hi, I'm currently working on making nohz_full/nohz_idle runtime toggable and some other people seem to be interested as well. So I've dumped a few thoughts about some pre-requirements to achieve that for those interested. As you can see, there is a bit of hard work in the way. I'm iterating that

[tip: core/rcu] tick/nohz: Narrow down noise while setting current task's tick dependency

2020-07-31 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the core/rcu branch of tip: Commit-ID: 3c8920e2dbd1a55f72dc14d656df9d0097cf5c72 Gitweb: https://git.kernel.org/tip/3c8920e2dbd1a55f72dc14d656df9d0097cf5c72 Author:Frederic Weisbecker AuthorDate:Fri, 15 May 2020 02:34:29 +02:00

[tip: timers/core] timers: Recalculate next timer interrupt only when necessary

2020-07-24 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 31cd0e119d50cf27ebe214d1a8f7ca36692f13a5 Gitweb: https://git.kernel.org/tip/31cd0e119d50cf27ebe214d1a8f7ca36692f13a5 Author:Frederic Weisbecker AuthorDate:Thu, 23 Jul 2020 17:16:41 +02:00

[PATCH v2] timers: Recalculate next timer interrupt only when necessary

2020-07-23 Thread Frederic Weisbecker
ime. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Anna-Maria Behnsen --- Changes since v1: _ Fix changelog's ramblings _ Fix structure layout kernel/time/timer.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/kernel/time/timer.c b/ker

Re: [PATCH] timers: Recalculate next timer interrupt only when necessary

2020-07-23 Thread Frederic Weisbecker
On Thu, Jul 23, 2020 at 03:53:32PM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > > > Since recalculating the next_expiry isn't a free operation, especially > > when we must climb up the last wheel level to find out that no timer > > has > >

Re: [patch V2 3/5] posix-cpu-timers: Provide mechanisms to defer timer handling to task_work

2020-07-23 Thread Frederic Weisbecker
On Thu, Jul 23, 2020 at 10:32:54AM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > On Fri, Jul 17, 2020 at 12:50:34AM +0200, Peter Zijlstra wrote: > >> On Thu, Jul 16, 2020 at 10:19:26PM +0200, Thomas Gleixner wrote: > >> > +static void __run_posix

Re: [patch V2 3/5] posix-cpu-timers: Provide mechanisms to defer timer handling to task_work

2020-07-22 Thread Frederic Weisbecker
On Fri, Jul 17, 2020 at 12:50:34AM +0200, Peter Zijlstra wrote: > On Thu, Jul 16, 2020 at 10:19:26PM +0200, Thomas Gleixner wrote: > > +static void __run_posix_cpu_timers(struct task_struct *tsk) > > +{ > > + struct posix_cputimers *pct = >posix_cputimers; > > + > > + if

Re: [patch V2 2/5] posix-cpu-timers: Convert the flags to a bitmap

2020-07-21 Thread Frederic Weisbecker
On Thu, Jul 16, 2020 at 10:19:25PM +0200, Thomas Gleixner wrote: > --- a/kernel/time/posix-cpu-timers.c > +++ b/kernel/time/posix-cpu-timers.c > @@ -25,7 +25,7 @@ void posix_cputimers_group_init(struct p > posix_cputimers_init(pct); > if (cpu_limit != RLIM_INFINITY) { >

[PATCH] timers: Recalculate next timer interrupt only when necessary

2020-07-20 Thread Frederic Weisbecker
ost of the time. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Anna-Maria Behnsen --- kernel/time/timer.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 77e21e98ec32..e8002f86c5bc 100

[tip: timers/core] timers: Spare timer softirq until next expiry

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: d4f7dae87096dfe722bf32aa82076ece1063746c Gitweb: https://git.kernel.org/tip/d4f7dae87096dfe722bf32aa82076ece1063746c Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:49 +02:00

[tip: timers/core] timers: Expand clk forward logic beyond nohz

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 1f8a4212dc83f8353843fabf6465fd918372fbbf Gitweb: https://git.kernel.org/tip/1f8a4212dc83f8353843fabf6465fd918372fbbf Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:48 +02:00

[tip: timers/core] timers: Reuse next expiry cache after nohz exit

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 90d52f65f303091be17b5f4ffab7090b2064b4a1 Gitweb: https://git.kernel.org/tip/90d52f65f303091be17b5f4ffab7090b2064b4a1 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:47 +02:00

[tip: timers/core] timers: Preserve higher bits of expiration on index calculation

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 3d2e83a2a6a0657c1cf145fa6ba23620715d6c36 Gitweb: https://git.kernel.org/tip/3d2e83a2a6a0657c1cf145fa6ba23620715d6c36 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:41 +02:00

[tip: timers/core] timers: Add comments about calc_index() ceiling work

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 4468897211628865ee2392acb5ad281f74176f63 Gitweb: https://git.kernel.org/tip/4468897211628865ee2392acb5ad281f74176f63 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:44 +02:00

[tip: timers/core] timers: Optimize _next_timer_interrupt() level iteration

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 001ec1b3925da0d51847c23fc0aa4129282db526 Gitweb: https://git.kernel.org/tip/001ec1b3925da0d51847c23fc0aa4129282db526 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:45 +02:00

[tip: timers/core] timers: Move trigger_dyntick_cpu() to enqueue_timer()

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 9a2b764b06c880678416d803d027f575ae40ec99 Gitweb: https://git.kernel.org/tip/9a2b764b06c880678416d803d027f575ae40ec99 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:43 +02:00

[tip: timers/core] timers: Lower base clock forwarding threshold

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 36cd28a4cdd05d47ccb62a2d86e8f37839cc879a Gitweb: https://git.kernel.org/tip/36cd28a4cdd05d47ccb62a2d86e8f37839cc879a Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:51 +02:00

[tip: timers/core] timers: Always keep track of next expiry

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: dc2a0f1fb2a06df09f5094f29aea56b763aa7cca Gitweb: https://git.kernel.org/tip/dc2a0f1fb2a06df09f5094f29aea56b763aa7cca Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:46 +02:00

[tip: timers/core] timers: Remove must_forward_clk

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/core branch of tip: Commit-ID: 0975fb565b8b8f9e0c96d0de39fcb954833ea5e0 Gitweb: https://git.kernel.org/tip/0975fb565b8b8f9e0c96d0de39fcb954833ea5e0 Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:50 +02:00

[tip: timers/urgent] timer: Fix wheel index calculation on last level

2020-07-17 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/urgent branch of tip: Commit-ID: e2a71bdea81690b6ef11f4368261ec6f5b6891aa Gitweb: https://git.kernel.org/tip/e2a71bdea81690b6ef11f4368261ec6f5b6891aa Author:Frederic Weisbecker AuthorDate:Fri, 17 Jul 2020 16:05:40 +02

[PATCH 06/12] timer: Optimize _next_timer_interrupt() level iteration

2020-07-17 Thread Frederic Weisbecker
-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index af1c08b0b168..9abc41715fd2 100644

[PATCH 01/12] timer: Fix wheel index calculation on last level

2020-07-17 Thread Frederic Weisbecker
Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli Cc: Thomas Gleixner Cc: sta...@vger.kernel.org --- kernel/time/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 9a838d38dbe6..df1ff803a

[PATCH 04/12] timer: Move trigger_dyntick_cpu() to enqueue_timer()

2020-07-17 Thread Frederic Weisbecker
Consolidate the code by calling trigger_dyntick_cpu() from enqueue_timer() instead of calling it from all its callers. Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.c | 61

[PATCH 12/12] timer: Lower base clock forwarding threshold

2020-07-17 Thread Frederic Weisbecker
There is nothing that prevents us from forwarding the base clock if it's one jiffy off. This reason for this arbitrary limit is historical and doesn't seem to stand anymore. Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli

[PATCH 10/12] timer: Spare timer softirq until next expiry

2020-07-17 Thread Frederic Weisbecker
track of canceled timers but we are still way ahead of the unconditional periodic softirqs (~15 times less of them with 1000 Hz and ~5 times less with 100 Hz). Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.

[PATCH 08/12] timer: Reuse next expiry cache after nohz exit

2020-07-17 Thread Frederic Weisbecker
Now that we track the next expiry unconditionally when a timer is added, we can reuse that information on a tick firing after exiting nohz. Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.c | 6 ++ 1

[PATCH 11/12] timer: Remove must_forward_clk

2020-07-17 Thread Frederic Weisbecker
There is no reason to keep this guard around. The code makes sure that base->clk remains sane and won't be forwarded beyond jiffies nor set backward. Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/time

[PATCH 05/12] timer: Add comments about calc_index() ceiling work

2020-07-17 Thread Frederic Weisbecker
calc_index() adds 1 unit of the level granularity to the expiry passed in parameter to ensure that the timer doesn't expire too early. Add a comment to explain that and the resulting layout in the wheel. Most-of-the-patch-by: Thomas Gleixner Tested-by: Juri Lelli Signed-off-by: Frederic

[PATCH 09/12] timer: Expand clk forward logic beyond nohz

2020-07-17 Thread Frederic Weisbecker
tch-up with missing updates whenever we need an up-to-date base clock. Tested-by: Juri Lelli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff

[PATCH 07/12] timers: Always keep track of next expiry

2020-07-17 Thread Frederic Weisbecker
lli Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli --- kernel/time/timer.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 9abc41715

[PATCH 02/12] timer: Preserve higher bits of expiration on index calculation

2020-07-17 Thread Frederic Weisbecker
are preparing to return the actual bucket expiration from calc_index() in order to properly fix base->next_expiry updates. Preserving the higher bits is a requirement to achieve that. Signed-off-by: Frederic Weisbecker Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Juri Lelli Cc: Thomas Gleixner

[PATCH 00/11] timer: Reduce timers softirq v3

2020-07-17 Thread Frederic Weisbecker
rk" as per Thomas' suggestion Please pull the timers/softirq-v3 branch that can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git timers/softirq-v3 HEAD: f176eb2a146b422f78d81ec63273487c33b3011d Thanks, Frederic --- Frederic Weisbec

[PATCH 03/12] timers: Use only bucket expiry for base->next_expiry value

2020-07-17 Thread Frederic Weisbecker
_cpu() is not longer necessary as the timers bucket expiry is guaranteed to be greater than or equal base->clk. Signed-off-by: Anna-Maria Behnsen Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Juri Lelli Cc: Thomas Gleixner Signed-off-by: Frederic Weisbecker --- kernel/time/timer.c | 64 ++

Re: [PATCH 2/9] timer: Add comments about calc_index() ceiling work

2020-07-17 Thread Frederic Weisbecker
On Tue, Jul 14, 2020 at 11:13:26AM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > static inline unsigned calc_index(unsigned expires, unsigned lvl) > > { > > + /* > > +* Time may have past since the clock last reached an index of > > +

Re: [PATCH 4/9] timers: Always keep track of next expiry

2020-07-17 Thread Frederic Weisbecker
On Tue, Jul 14, 2020 at 10:49:28AM +0200, Anna-Maria Behnsen wrote: > Hi Frederic, > > On Tue, 7 Jul 2020, Frederic Weisbecker wrote: > > > So far next expiry was only tracked while the CPU was in nohz_idle mode > > in order to cope with missing ticks that can't

[PATCH] timer: Fix wheel index calculation on last level

2020-07-15 Thread Frederic Weisbecker
Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Behnsen Cc: Juri Lelli Cc: Thomas Gleixner Cc: sta...@vger.kernel.org --- kernel/time/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 9a838d38dbe6..df1ff803a

[PATCH] timer: Preserve higher bits of expiration on index calculation

2020-07-15 Thread Frederic Weisbecker
rd > problem. > > The workaround of commit 30c66fc30ee7 ("timer: Prevent base->clk from > moving backward") in trigger_dyntick_cpu() is not longer necessary as the > timers bucket expiry is guaranteed to be greater than or equal base->clk. > > Signed-off-

Re: [PATCH 1/9] timer: Move trigger_dyntick_cpu() to enqueue_timer()

2020-07-15 Thread Frederic Weisbecker
On Thu, Jul 09, 2020 at 02:17:35PM +0200, Anna-Maria Behnsen wrote: > Hi Frederic, > > On Tue, 7 Jul 2020, Frederic Weisbecker wrote: > > > Consolidate the code by calling trigger_dyntick_cpu() from > > enqueue_timer() instead of calling it from all its callers. >

Re: [PATCH v2] timers: Use only bucket expiry for base->next_expiry value

2020-07-15 Thread Frederic Weisbecker
rd > problem. > > The workaround of commit 30c66fc30ee7 ("timer: Prevent base->clk from > moving backward") in trigger_dyntick_cpu() is not longer necessary as the > timers bucket expiry is guaranteed to be greater than or equal base->clk. > > Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker Thanks a lot!

Re: [PATCH] timers: Use only bucket expiry for base->next_expiry value

2020-07-10 Thread Frederic Weisbecker
Hi Anna-Maria, Nice change, it indeed makes more sense that way. Just a few details below: On Fri, Jul 10, 2020 at 05:46:22PM +0200, Anna-Maria Behnsen wrote: > The bucket expiry time is the effective expriy time of timers and is > greater than or equal to the requested timer expiry time. This

[tip: timers/urgent] timer: Prevent base->clk from moving backward

2020-07-09 Thread tip-bot2 for Frederic Weisbecker
The following commit has been merged into the timers/urgent branch of tip: Commit-ID: 30c66fc30ee7a98c4f3adf5fb7e213b61884474f Gitweb: https://git.kernel.org/tip/30c66fc30ee7a98c4f3adf5fb7e213b61884474f Author:Frederic Weisbecker AuthorDate:Fri, 03 Jul 2020 03:06:57 +02

[PATCH 7/9] timer: Spare timer softirq until next expiry

2020-07-06 Thread Frederic Weisbecker
track of canceled timers but we are still way ahead of the unconditional periodic softirqs (~15 times less of them with 1000 Hz and ~5 times less with 100 Hz). Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.

[PATCH 9/9] timer: Lower base clock forwarding threshold

2020-07-06 Thread Frederic Weisbecker
There is nothing that prevents us from forwarding the base clock if it's one jiffy off. This reason for this arbitrary limit is historical and doesn't seem to stand anymore. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c

[PATCH 3/9] timer: Optimize _next_timer_interrupt() level iteration

2020-07-06 Thread Frederic Weisbecker
-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index ae1259f67486..acf7cb8c09f8 100644 --- a/kernel/time/timer.c

[PATCH 8/9] timer: Remove must_forward_clk

2020-07-06 Thread Frederic Weisbecker
There is no reason to keep this guard around. The code makes sure that base->clk remains sane and won't be forwarded beyond jiffies nor set backward. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c |

[PATCH 5/9] timer: Reuse next expiry cache after nohz exit

2020-07-06 Thread Frederic Weisbecker
Now that we track the next expiry unconditionally when a timer is added, we can reuse that information on a tick firing after exiting nohz. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 6 ++ 1 file changed, 2

[PATCH 0/9] timer: Reduce timers softirq v2

2020-07-06 Thread Frederic Weisbecker
ers/softirq-v2 HEAD: 5545d80b7b9bd69ede1c17fda194ac6620e7063f Thanks, Frederic --- Frederic Weisbecker (9): timer: Move trigger_dyntick_cpu() to enqueue_timer() timer: Add comments about calc_index() ceiling work timer: Optimize _next_timer_interrupt() level iteration timers: Always keep

[PATCH 4/9] timers: Always keep track of next expiry

2020-07-06 Thread Frederic Weisbecker
So far next expiry was only tracked while the CPU was in nohz_idle mode in order to cope with missing ticks that can't increment the base->clk periodically anymore. We are going to expand that logic beyond nohz in order to spare timers softirqs so do it unconditionally. Signed-off-by: Frede

[PATCH 6/9] timer: Expand clk forward logic beyond nohz

2020-07-06 Thread Frederic Weisbecker
tch-up with missing updates whenever we need an up-to-date base clock. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/kernel/time/t

[PATCH 2/9] timer: Add comments about calc_index() ceiling work

2020-07-06 Thread Frederic Weisbecker
calc_index() adds 1 unit of the level granularity to the expiry passed in parameter to ensure that the timer doesn't expire too early. Add a comment to explain that and the resulting layout in the wheel. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri

[PATCH 1/9] timer: Move trigger_dyntick_cpu() to enqueue_timer()

2020-07-06 Thread Frederic Weisbecker
Consolidate the code by calling trigger_dyntick_cpu() from enqueue_timer() instead of calling it from all its callers. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 46 +++-- 1

[PATCH] timer: Prevent base->clk from moving backward

2020-07-02 Thread Frederic Weisbecker
hat, make sure that base->next_expiry doesn't get below base->clk. Fixes: a683f390b93f ("timers: Forward the wheel clock whenever possible") Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 17 ++

Re: [RFC PATCH 10/10] timer: Lower base clock forwarding threshold

2020-07-02 Thread Frederic Weisbecker
On Thu, Jul 02, 2020 at 05:14:23PM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > On Thu, Jul 02, 2020 at 03:21:35PM +0200, Thomas Gleixner wrote: > > The following part: > > > >> > * Also while executing timers, base->clk is 1 offset ahe

Re: [RFC PATCH 01/10] timer: Prevent base->clk from moving backward

2020-07-02 Thread Frederic Weisbecker
On Thu, Jul 02, 2020 at 11:59:59AM +0200, Juri Lelli wrote: > On 02/07/20 01:20, Frederic Weisbecker wrote: > > On Wed, Jul 01, 2020 at 06:35:04PM +0200, Juri Lelli wrote: > > > Guess you might be faster to understand what I'm missing. :-) > > > > So, did you port on

Re: [RFC PATCH 01/10] timer: Prevent base->clk from moving backward

2020-07-02 Thread Frederic Weisbecker
On Thu, Jul 02, 2020 at 11:59:59AM +0200, Juri Lelli wrote: > On 02/07/20 01:20, Frederic Weisbecker wrote: > > On Wed, Jul 01, 2020 at 06:35:04PM +0200, Juri Lelli wrote: > > > Guess you might be faster to understand what I'm missing. :-) > > > > So, did you port on

Re: [RFC PATCH 10/10] timer: Lower base clock forwarding threshold

2020-07-02 Thread Frederic Weisbecker
On Thu, Jul 02, 2020 at 03:21:35PM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > There is no apparent reason for not forwarding base->clk when it's 2 > > jiffies late, except perhaps for past optimizations. But since forwarding > > has to be done

Re: [RFC PATCH 03/10] timer: Simplify LVL_START() and calc_index()

2020-07-02 Thread Frederic Weisbecker
On Thu, Jul 02, 2020 at 01:59:17PM +0200, Thomas Gleixner wrote: > Frederic Weisbecker writes: > > LVL_START() makes the first index of a level to start with what would be > > the value of all bits set of the previous level. > > > > For example level 1 starts at 63 ins

Re: [RFC PATCH 01/10] timer: Prevent base->clk from moving backward

2020-07-01 Thread Frederic Weisbecker
On Wed, Jul 01, 2020 at 06:35:04PM +0200, Juri Lelli wrote: > Guess you might be faster to understand what I'm missing. :-) So, did you port only this patch or the whole set in order to trigger this? If it was the whole set, can you try this patch alone? Thanks!

[RFC PATCH 06/10] timer: Reuse next expiry cache after nohz exit

2020-06-30 Thread Frederic Weisbecker
Now that we track the next expiry unconditionally when a timer is added, we can reuse that information on a tick firing after exiting nohz. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 6 ++ 1 file changed, 2

[RFC PATCH 04/10] timer: Optimize _next_timer_interrupt() level iteration

2020-06-30 Thread Frederic Weisbecker
-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index b4838d63a016..4aa74aafdd33 100644 --- a/kernel/time/timer.c

[RFC PATCH 03/10] timer: Simplify LVL_START() and calc_index()

2020-06-30 Thread Frederic Weisbecker
there is no apparent reason for such fixups so simplify the whole thing. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time

[RFC PATCH 02/10] timer: Move trigger_dyntick_cpu() to enqueue_timer()

2020-06-30 Thread Frederic Weisbecker
Consolidate the code by calling trigger_dyntick_cpu() from enqueue_timer() instead of calling it from all its callers. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 46 +++-- 1

[RFC PATCH 07/10] timer: Expand clk forward logic beyond nohz

2020-06-30 Thread Frederic Weisbecker
tch-up with missing updates whenever we need an up-to-date base clock. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/kernel/time/t

[RFC PATCH 08/10] timer: Spare timer softirq until next expiry

2020-06-30 Thread Frederic Weisbecker
track of canceled timers but we are still way ahead of the unconditional periodic softirqs (~15 times less of them with 1000 Hz and ~5 times less with 100 Hz). Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.

[RFC PATCH 00/10] timer: Reduce timers softirq (and other optimizations)

2020-06-30 Thread Frederic Weisbecker
is a consolidation. Patch 3 and 4 are optimizations. The rest is about timer softirqs. git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git timers/softirq HEAD: d0567dd5546d1f32eca3772a431488f8b0ac26a1 Thanks, Frederic --- Frederic Weisbecker (10): timer: Prevent

[RFC PATCH 09/10] timer: Remove must_forward_clk

2020-06-30 Thread Frederic Weisbecker
There is no reason to keep this guard around. The code makes sure that base->clk remains sane and won't be forwarded beyond jiffies nor set backward. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c |

[RFC PATCH 10/10] timer: Lower base clock forwarding threshold

2020-06-30 Thread Frederic Weisbecker
There is no apparent reason for not forwarding base->clk when it's 2 jiffies late, except perhaps for past optimizations. But since forwarding has to be done at some point now anyway, this doesn't stand anymore. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner

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