Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1224552

Re: [tip:sched/core] sched: 'Annotate' migrate_tasks()

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [tip:sched/core] sched: 'Annotate' migrate_tasks()
Date 2015-09-15 02:00 +0200
Message-ID <q8LPc-4Cp-11@gated-at.bofh.it> (permalink)
References <q2lNL-42r-9@gated-at.bofh.it> <q8daO-5pP-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Sep 13, 2015 at 3:56 AM, tip-bot for Wanpeng Li
<tipbot@zytor.com> wrote:
> +               lockdep_unpin_lock(&rq->lock);
> +               raw_spin_unlock(&rq->lock);
> +               raw_spin_lock(&next->pi_lock);
> +               raw_spin_lock(&rq->lock);

So _if_ this is ever likely to be a performance-critical piece of
code, it might be worth doing

    if (!raw_spin_trylock(&next->pi_lock)) {
        .. do the above unlock and relock in the right order sequence ..
    }

to avoid doing that whole "unlock just to relock in the right order" thing.

That's particularly true in cases where dropping one of the locks can
necessitate re-doing some checks.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[tip:sched/core] sched: 'Annotate' migrate_tasks() tip-bot for Wanpeng Li <tipbot@zytor.com> - 2015-09-13 13:00 +0200
  Re: [tip:sched/core] sched: 'Annotate' migrate_tasks() Linus Torvalds <torvalds@linux-foundation.org> - 2015-09-15 02:00 +0200
    Re: [tip:sched/core] sched: 'Annotate' migrate_tasks() Peter Zijlstra <peterz@infradead.org> - 2015-09-15 10:00 +0200

csiph-web