public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dan Upton <upton.dan.linux@gmail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: CFS rq lock question
Date: Fri, 11 Apr 2008 19:37:01 +0200	[thread overview]
Message-ID: <1207935421.7524.3.camel@twins> (raw)
In-Reply-To: <ba7d8f720804111021v25cc4688mf6e36f571fd2b388@mail.gmail.com>

On Fri, 2008-04-11 at 13:21 -0400, Dan Upton wrote:
> I'm poking around with some scheduler stuff, and there's something I'm
> not clear on for the CFS runqueue locks.  The comments before
> __load_balance_iterator(...) in sched_fair.c suggests things can be
> dequeued even though the runqueue lock is held.  Can things also be
> added to the queue while the lock is held?  (Also, either way, what's
> the rationale that dequeueing is a safe procedure when somebody else
> holds a lock?)

/*
 * Load-balancing iterator. Note: while the runqueue stays locked
 * during the whole iteration, the current task might be
 * dequeued so the iterator has to be dequeue-safe. Here we
 * achieve that by always pre-iterating before returning
 * the current task:
 */

I don't think this comment is correct, but if it were, it would only
apply to rq->curr, not for any enqueue/dequeue.




  reply	other threads:[~2008-04-11 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11 17:21 CFS rq lock question Dan Upton
2008-04-11 17:37 ` Peter Zijlstra [this message]
2008-04-11 17:41   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1207935421.7524.3.camel@twins \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=upton.dan.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox