[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150430081713.7ad33eb7@notabene.brown>
Date: Thu, 30 Apr 2015 08:17:13 +1000
From: NeilBrown <neilb@...e.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Yuanhan Liu <yuanhan.liu@...ux.intel.com>,
linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 1/3 v2] wait: introduce wait_event_exclusive_cmd
On Wed, 29 Apr 2015 11:31:09 +0200 Peter Zijlstra <peterz@...radead.org>
wrote:
> On Wed, Apr 29, 2015 at 10:48:53AM +0800, Yuanhan Liu wrote:
> > It's just a variant of wait_event_cmd(), with exclusive flag being set.
> >
> > For cases like RAID5, which puts many processes to sleep until 1/4
> > resources are free, a wake_up wakes up all processes to run, but
> > there is one process being able to get the resource as it's protected
> > by a spin lock. That ends up introducing heavy lock contentions, and
> > hurts performance badly.
> >
> > Here introduce wait_event_exclusive_cmd to relieve the lock contention
> > naturally by letting wake_up just wake up one process.
> >
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Signed-off-by: Yuanhan Liu <yuanhan.liu@...ux.intel.com>
>
> Thanks!
>
> Assuming you want to route this through Neil's MD tree:
>
> Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Thanks a lot Peter!
I've queued the three patches in my md tree for 4.2.
Thanks yliu!
NeilBrown
>
> > ---
> > include/linux/wait.h | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/include/linux/wait.h b/include/linux/wait.h
> > index 2db8334..db78c72 100644
> > --- a/include/linux/wait.h
> > +++ b/include/linux/wait.h
> > @@ -358,6 +358,19 @@ do { \
> > __ret; \
> > })
> >
> > +#define __wait_event_exclusive_cmd(wq, condition, cmd1, cmd2) \
> > + (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 1, 0, \
> > + cmd1; schedule(); cmd2)
> > +/*
> > + * Just like wait_event_cmd(), except it sets exclusive flag
> > + */
> > +#define wait_event_exclusive_cmd(wq, condition, cmd1, cmd2) \
> > +do { \
> > + if (condition) \
> > + break; \
> > + __wait_event_exclusive_cmd(wq, condition, cmd1, cmd2); \
> > +} while (0)
> > +
> > #define __wait_event_cmd(wq, condition, cmd1, cmd2) \
> > (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
> > cmd1; schedule(); cmd2)
> > --
> > 1.9.0
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists