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:	Thu, 11 Nov 2010 15:17:03 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Raistlin <raistlin@...ux.it>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	Chris Friesen <cfriesen@...tel.com>, oleg@...hat.com,
	Frederic Weisbecker <fweisbec@...il.com>,
	Darren Hart <darren@...art.com>,
	Johan Eker <johan.eker@...csson.com>,
	"p.faure" <p.faure@...tech.ch>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Claudio Scordino <claudio@...dence.eu.com>,
	michael trimarchi <trimarchi@...is.sssup.it>,
	Fabio Checconi <fabio@...dalf.sssup.it>,
	Tommaso Cucinotta <cucinotta@...up.it>,
	Juri Lelli <juri.lelli@...il.com>,
	Nicola Manica <nicola.manica@...i.unitn.it>,
	Luca Abeni <luca.abeni@...tn.it>,
	Dhaval Giani <dhaval@...is.sssup.it>,
	Harald Gustafsson <hgu1972@...il.com>,
	paulmck <paulmck@...ux.vnet.ibm.com>
Subject: Re: [RFC][PATCH 05/22] sched: SCHED_DEADLINE policy implementation

On Fri, 2010-10-29 at 08:30 +0200, Raistlin wrote:
> +static void update_curr_dl(struct rq *rq)
> +{
> +       struct task_struct *curr = rq->curr;
> +       struct sched_dl_entity *dl_se = &curr->dl;
> +       u64 delta_exec;
> +
> +       if (!dl_task(curr) || !on_dl_rq(dl_se))
> +               return;
> +
> +       delta_exec = rq->clock - curr->se.exec_start;
> +       if (unlikely((s64)delta_exec < 0))
> +               delta_exec = 0;
> +
> +       schedstat_set(curr->se.statistics.exec_max,
> +                     max(curr->se.statistics.exec_max, delta_exec));
> +
> +       curr->se.sum_exec_runtime += delta_exec;
> +       account_group_exec_runtime(curr, delta_exec);
> +
> +       curr->se.exec_start = rq->clock;
> +       cpuacct_charge(curr, delta_exec);
> +
> +       dl_se->runtime -= delta_exec;
> +       if (dl_runtime_exceeded(rq, dl_se)) {
> +               __dequeue_task_dl(rq, curr, 0);
> +               if (likely(start_dl_timer(dl_se)))
> +                       dl_se->dl_throttled = 1;
> +               else
> +                       enqueue_task_dl(rq, curr, ENQUEUE_REPLENISH);
> +
> +               resched_task(curr);
> +       }
> +} 

So you keep the current task in the rb-tree? If you remove the current
task from the tree you don't have to do the whole dequeue/enqueue thing.
Then again, I guess it only really matters once you push the deadline,
which shouldn't be that often.

Also, you might want to put a conditional around that resched, no point
rescheduling if you're still the leftmost task.


--
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