From: Oleg Nesterov <oleg@redhat.com>
To: Kirill Tkhai <kirill.tkhai@gmail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Kirill Tkhai <tkhai@yandex.ru>
Subject: Re: [PATCH]sched: stop hrtick timer if running task is switching from fair scheduling class to another
Date: Mon, 26 Dec 2011 16:42:57 +0100 [thread overview]
Message-ID: <20111226154257.GA21445@redhat.com> (raw)
In-Reply-To: <1324584060.4222.15.camel@hp>
On 12/23, Kirill Tkhai wrote:
>
> [PATCH]sched: stop hrtick timer if running task is switching from fair
> scheduling class to another
>
> We have to stop hrtick timer to avoid excess interrupt. Not-fair tasks
> are not interested in fair's hrtick. RT class uses its own fixed
> timeslice (in case of RR), which doesn't depend on current value of hrtick
> timer.
Well. I shouldn't try to comment this patch, I do not really understand
this code.
But since nobody else replies...
> @@ -5271,6 +5271,13 @@ static void switched_from_fair(struct rq *rq,
> struct task_struct *p)
> place_entity(cfs_rq, se, 0);
> se->vruntime -= cfs_rq->min_vruntime;
> }
> +
> + /*
> + * Other scheduling classes are not interested in fair's hrtick timer.
> + */
> + if (task_current(rq, p) && sched_feat(HRTICK))
> + hrtick_clear(rq);
> +
> }
May be... but in this case, perhaps instead we should teach
dequeue_task_fair() or put_prev_task_fair() to do this. Then we can
probably remove __schedule()->hrtick_clear().
I simply can't understand the current hrtick logic. For example,
why dequeue_task_fair() does hrtick_update() ? OK, probably
because "nr_running < sched_nr_latency" can become true. But at
least this doesn't make sense to me when p == rq->curr, say,
__schedule() path.
Hmm. In any case, how it is possible to do hrtick_start() with
rq->lock held? hrtimer_restart() may want to wakeup_softirqd().
Peter, Ingo, does this code really work? SCHED_FEAT(HRTICK) == 0
by default, and afaics you can't change it without CONFIG_SCHED_DEBUG.
Confused...
Oleg.
next prev parent reply other threads:[~2011-12-26 15:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 20:01 [PATCH]sched: stop hrtick timer if running task is switching from fair scheduling class to another Kirill Tkhai
2011-12-26 15:42 ` Oleg Nesterov [this message]
2012-01-04 12:30 ` Peter Zijlstra
2011-12-26 16:59 ` SCHED_RR && time_slice Oleg Nesterov
2011-12-29 16:43 ` Kirill Tkhai
2011-12-29 17:12 ` Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2011-12-17 0:09 [PATCH]sched: stop hrtick timer if running task is switching from fair scheduling class to another Kirill Tkhai
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=20111226154257.GA21445@redhat.com \
--to=oleg@redhat.com \
--cc=kirill.tkhai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tkhai@yandex.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.