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, 26 Oct 2006 09:12:45 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	Nick Piggin <nickpiggin@...oo.com.au>
cc:	akpm@...l.org, Peter Williams <pwil3058@...pond.net.au>,
	linux-kernel@...r.kernel.org,
	"Siddha, Suresh B" <suresh.b.siddha@...el.com>,
	Dave Chinner <dgc@....com>, Ingo Molnar <mingo@...e.hu>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [PATCH 2/5] Extract load calculation from rebalance_tick

On Thu, 26 Oct 2006, Nick Piggin wrote:

> 'time_slice' should be static, and it should be named better, and you
> may as well also put the "task has expired but not rescheduled" part
> in there too. That is part of the same logical op (which is to resched
> the task when it finishes timeslice).

This way?

Index: linux-2.6.19-rc3/kernel/sched.c
===================================================================
--- linux-2.6.19-rc3.orig/kernel/sched.c	2006-10-26 11:04:43.000000000 -0500
+++ linux-2.6.19-rc3/kernel/sched.c	2006-10-26 11:11:20.458202627 -0500
@@ -3044,8 +3044,13 @@ void account_steal_time(struct task_stru
 		cpustat->steal = cputime64_add(cpustat->steal, tmp);
 }
 
-void time_slice(struct rq *rq, struct task_struct *p)
+static void task_running_tick(struct rq *rq, struct task_struct *p)
 {
+	if (p->array != rq->active) {
+		/* Task has expired but was not scheduled yet */
+		set_tsk_need_resched(p);
+		return;
+	}
 	spin_lock(&rq->lock);
 	/*
 	 * The task was running during this tick - update the
@@ -3135,14 +3140,8 @@ void scheduler_tick(void)
 	if (p == rq->idle)
 		/* Task on the idle queue */
 		wake_priority_sleeper(rq);
-	else {
-		/* Task on cpu queue */
-		if (p->array != rq->active)
-			/* Task has expired but was not scheduled yet */
-			set_tsk_need_resched(p);
-		else
-			time_slice(rq, p);
-	}
+	else
+		task_running_tick(rq, p);
 #ifdef CONFIG_SMP
 	update_load(rq);
 	if (jiffies >= __get_cpu_var(next_balance))
-
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