Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread Jason Low
On Thu, 2015-08-27 at 18:43 -0400, George Spelvin wrote: > Jason Low wrote: > > Frederic suggested that we just use a single "status" variable and > > access the bits for the running and checking field. I am leaning towards > > that method, so I might not include the rest of the boolean changes in

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread George Spelvin
Jason Low wrote: > Frederic suggested that we just use a single "status" variable and > access the bits for the running and checking field. I am leaning towards > that method, so I might not include the rest of the boolean changes in > this patchset. Don't worry, I'm not offended. I just started

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread Jason Low
On Wed, 2015-08-26 at 21:28 -0400, George Spelvin wrote: > > I can include your patch in the series and then use boolean for the new > > checking_timer field. However, it looks like this applies on an old > > kernel. For example, the spin_lock field has already been removed from > > the structure.

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread Frederic Weisbecker
On Thu, Aug 27, 2015 at 01:29:50PM -0700, Jason Low wrote: > On Thu, 2015-08-27 at 14:53 +0200, Frederic Weisbecker wrote: > > Sure, like: > > > > #define CPUTIMER_RUNNING 0x1 > > #define CPUTIMER_CHECKING 0x2 > > > > struct thread_group_cputimer { > > struct task_cputime_atomic cputime_atomi

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread Jason Low
On Thu, 2015-08-27 at 14:53 +0200, Frederic Weisbecker wrote: > On Wed, Aug 26, 2015 at 04:32:34PM -0700, Jason Low wrote: > > On Thu, 2015-08-27 at 00:56 +0200, Frederic Weisbecker wrote: > > > On Tue, Aug 25, 2015 at 08:17:48PM -0700, Jason Low wrote: > > > > It was found while running a database

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-27 Thread Frederic Weisbecker
On Wed, Aug 26, 2015 at 04:32:34PM -0700, Jason Low wrote: > On Thu, 2015-08-27 at 00:56 +0200, Frederic Weisbecker wrote: > > On Tue, Aug 25, 2015 at 08:17:48PM -0700, Jason Low wrote: > > > It was found while running a database workload on large systems that > > > significant time was spent tryin

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Jason Low
On Wed, 2015-08-26 at 16:32 -0700, Jason Low wrote: > Perhaps to be safer, we use something like load_acquire() and > store_release() for accessing both the ->running and ->checking_timer > fields? Regarding using barriers, one option could be to pair them between sig->cputime_expires and the sig

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread George Spelvin
> I can include your patch in the series and then use boolean for the new > checking_timer field. However, it looks like this applies on an old > kernel. For example, the spin_lock field has already been removed from > the structure. Apologies; that was 4.1.6. A 4.2-rc8 patch is appended (it's a

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Jason Low
On Wed, 2015-08-26 at 15:33 -0400, George Spelvin wrote: > And some more comments on the series... > > > @@ -626,6 +628,7 @@ struct task_cputime_atomic { > > struct thread_group_cputimer { > > struct task_cputime_atomic cputime_atomic; > > int running; > >+int checking_timer; > > }; >

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Jason Low
On Thu, 2015-08-27 at 00:56 +0200, Frederic Weisbecker wrote: > On Tue, Aug 25, 2015 at 08:17:48PM -0700, Jason Low wrote: > > It was found while running a database workload on large systems that > > significant time was spent trying to acquire the sighand lock. > > > > The issue was that whenever

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Jason Low
On Thu, 2015-08-27 at 00:31 +0200, Frederic Weisbecker wrote: > On Wed, Aug 26, 2015 at 10:53:35AM -0700, Linus Torvalds wrote: > > On Tue, Aug 25, 2015 at 8:17 PM, Jason Low wrote: > > > > > > This patch addresses this by having the thread_group_cputimer structure > > > maintain a boolean to sign

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Frederic Weisbecker
On Tue, Aug 25, 2015 at 08:17:48PM -0700, Jason Low wrote: > It was found while running a database workload on large systems that > significant time was spent trying to acquire the sighand lock. > > The issue was that whenever an itimer expired, many threads ended up > simultaneously trying to sen

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Frederic Weisbecker
On Wed, Aug 26, 2015 at 10:53:35AM -0700, Linus Torvalds wrote: > On Tue, Aug 25, 2015 at 8:17 PM, Jason Low wrote: > > > > This patch addresses this by having the thread_group_cputimer structure > > maintain a boolean to signify when a thread in the group is already > > checking for process wide

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread George Spelvin
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 3/3] timer: Reduce unnecessary sighand lock contention

2015-08-26 Thread Linus Torvalds
On Tue, Aug 25, 2015 at 8:17 PM, Jason Low wrote: > > This patch addresses this by having the thread_group_cputimer structure > maintain a boolean to signify when a thread in the group is already > checking for process wide timers, and adds extra logic in the fastpath > to check the boolean. It i