LKML Archive on
help / color / mirror / Atom feed
From: Cyrill Gorcunov <>
To: Ingo Molnar <>, Peter Zijlstra <>
Cc: LKML <>
Subject: CFS related question
Date: Sun, 19 Oct 2008 00:03:19 +0400	[thread overview]
Message-ID: <20081018200319.GC8188@localhost> (raw)

Hi Ingo, Peter,

I just curious, look we have the following

static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)
	struct sched_entity *se = NULL;

	if (first_fair(cfs_rq)) {
		se = __pick_next_entity(cfs_rq);
		se = pick_next(cfs_rq, se);
		set_next_entity(cfs_rq, se);

	return se;

which I presume may return NULL so the following piece
could fail

static struct task_struct *pick_next_task_fair(struct rq *rq)
	struct task_struct *p;
	struct cfs_rq *cfs_rq = &rq->cfs;
	struct sched_entity *se;

	if (unlikely(!cfs_rq->nr_running))
		return NULL;

	do {
-->		se = pick_next_entity(cfs_rq);
--> OOPs	cfs_rq = group_cfs_rq(se);
	} while (cfs_rq);

	p = task_of(se);
	hrtick_start_fair(rq, p);

	return p;

Did I miss something? Or it comepletely can NOT happen?

		- Cyrill -

             reply	other threads:[~2008-10-18 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-18 20:03 Cyrill Gorcunov [this message]
2008-10-18 20:28 ` CFS related question Peter Zijlstra
2008-10-19  5:29   ` Cyrill Gorcunov
2008-10-20 18:12   ` Hiroshi Shimamoto
2008-10-20 18:20     ` Cyrill Gorcunov

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:

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

  git send-email \
    --in-reply-to=20081018200319.GC8188@localhost \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).