Re: [PATCH] Optimize sys_times for a single thread process

From: Mitchell Blank Jr
Date: Tue May 17 2005 - 19:47:13 EST


Christoph Lameter wrote:
> + if (current == next_thread(current)) {
> + /*
> + * Single thread case. We do not need to scan the tasklist
> + * and thus can avoid the read_lock(&task_list_lock). We
> + * also do not need to take the siglock since we
> + * are the only thread in this process
> + */
> + utime = cputime_add(current->signal->utime, current->utime);
> + stime = cputime_add(current->signal->utime, current->stime);
> + cutime = current->signal->cutime;
> + cstime = current->signal->cstime;
> + } else

Maybe #ifdef CONFIG_SMP around this? On uniproc you're still saving the
sti/cli around reading the tsk->signal stuff but that's probably not
enough to warrant the code bloat.

Or maybe this is a small enough amount of code not to matter... just a
suggestion.

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