[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140210145946.41a64fd9832b41e90c852e40@linux-foundation.org>
Date: Mon, 10 Feb 2014 14:59:46 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, Jason Low <jason.low2@...com>,
Waiman Long <waiman.long@...com>, mingo@...nel.org,
paulmck@...ux.vnet.ibm.com, torvalds@...ux-foundation.org,
tglx@...utronix.de, riel@...hat.com, davidlohr@...com,
hpa@...or.com, andi@...stfloor.org, aswin@...com,
scott.norton@...com, chegu_vinod@...com
Subject: Re: [PATCH 6/8] mutex: Extra reschedule point
On Mon, 10 Feb 2014 20:58:26 +0100 Peter Zijlstra <peterz@...radead.org> wrote:
> Add in an extra reschedule in an attempt to avoid getting reschedule
> the moment we've acquired the lock.
>
> ...
>
> --- a/kernel/locking/mutex.c
> +++ b/kernel/locking/mutex.c
> @@ -468,6 +468,13 @@ __mutex_lock_common(struct mutex *lock,
> }
> osq_unlock(&lock->osq);
> slowpath:
> + /*
> + * If we fell out of the spin path because of need_resched(),
> + * reschedule now, before we try-lock the mutex. This avoids getting
> + * scheduled out right after we obtained the mutex.
> + */
> + if (unlikely(need_resched()))
> + schedule_preempt_disabled();
need_resched() already does unlikely().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists