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>] [day] [month] [year] [list]
Message-ID: <982c94040803160704h5377c943o68612a0a5d6e4b7d@mail.gmail.com>
Date:	Sun, 16 Mar 2008 10:04:49 -0400
From:	"Philip Pratt-Szeliga" <pcpratts@....edu>
To:	linux-kernel@...r.kernel.org
Subject: scheduler code/doc inconstancy

In Linux 2.6.24.3:

kernel/sched.c line 3663 calls sched_info_switch and line 3665 says
if(likely(prev != next)){

so it looks like this:

sched_info_switch(prev, next);

if (likely(prev != next)) {

But! In kernel/sched_stat.c the following starts at line 206. It says
we are only called when prev != next in the comment but that violates
what is happening above.

/*
* Called when tasks are switched involuntarily due, typically, to expiring
* their time slice. (This may also be called when switching to or from
* the idle task.) ___We are only called when prev != next.___
*/
static inline void
__sched_info_switch(struct task_struct *prev, struct task_struct *next)
{
struct rq *rq = task_rq(prev);

/*
* prev now departs the cpu. It's not interesting to record
* stats about how efficient we were at scheduling the idle
* process, however.
*/
if (prev != rq->idle)
sched_info_depart(prev);

if (next != rq->idle)
sched_info_arrive(next);
}
static inline void
sched_info_switch(struct task_struct *prev, struct task_struct *next)
{
if (unlikely(sched_info_on()))
__sched_info_switch(prev, next);
}


Maybe this is a bug in the code but possibly it is just a problem in
the documentation

Sincerely,
Phil Pratt-Szeliga
--
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