Re: [PATCH v4 4/6] sched: Remove double_rq_lock() from __migrate_task()

From: Peter Zijlstra
Date: Tue Aug 12 2014 - 04:22:05 EST


On Wed, Aug 06, 2014 at 12:06:27PM +0400, Kirill Tkhai wrote:
>
> Let's use ONRQ_MIGRATING instead.

I feel there should be a little more in the changelog; how about
something like:

Avoid double_rq_lock() and use ONRQ_MIGRATING for __migrate_task(). The
advantage is (obviously) not holding two 'rq->lock's at the same time
and thereby increasing parallelism.

The important point to note is that because we acquire dst->lock
immediately after releasing src->lock the potential wait time of
task_rq_lock() callers on ONRQ_MIGRATING is not longer than it would
have been in the double rq lock scenario.

> Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>

Attachment: pgpcn0qxa88ky.pgp
Description: PGP signature