lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Dec 2011 16:42:57 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Kirill Tkhai <kirill.tkhai@...il.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Kirill Tkhai <tkhai@...dex.ru>
Subject: Re: [PATCH]sched: stop hrtick timer if running task is switching
	from fair scheduling class to another

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.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ