Re: Patch for show_task

Andrew Morton (akpm@digeo.com)
Thu, 3 Apr 2003 22:43:46 -0800


Pete Zaitcev <zaitcev@redhat.com> wrote:
>
> Andrew, bkbits says you changed the line above to be p->thread_info.
> Unfortunately, there's another.
>
> --- linux-2.5.66/kernel/sched.c 2003-03-24 14:01:16.000000000 -0800
> +++ linux-2.5.66-sparc/kernel/sched.c 2003-04-03 22:33:29.000000000 -0800
> @@ -2197,7 +2197,7 @@
> unsigned long * n = (unsigned long *) (p->thread_info+1);
> while (!*n)
> n++;
> - free = (unsigned long) n - (unsigned long)(p+1);
> + free = (unsigned long) n - (unsigned long) (p->thread_info+1);
> }
> printk("%5lu %5d %6d ", free, p->pid, p->parent->pid);
> if ((relative = eldest_child(p)))
>

Yup. But the whole thing's dead anyway - we do not clear the kernel stack
when it is allocated hence the attempt to work out how much was used cannot
work.

That's what

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.5/2.5.66/2.5.66-mm3/broken-out/show_task-free-stack-fix.patch

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