Re: [uClinux-dev] Re: [PATCH] NOMMU: add [stack] label to per-process maps output

From: Mike Frysinger
Date: Thu Dec 17 2009 - 17:49:31 EST


On Wed, Dec 16, 2009 at 11:59, David Howells wrote:
> Mike Frysinger wrote:
>> + Â Â Â Â Â Â if (vma->vm_start <= mm->start_brk &&
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â vma->vm_end >= mm->brk) {
>
> Hmmm... ÂThat ought to involve mm->start_stack somewhere... Â(Or, more
> probably, task->stack_start:-/)

with MMU, the [heap] (i.e. brk) and [stack] are different mappings.
under NOMMU, they're the same mapping, except that no one uses the brk
and the "heap" is really all of dynamic kernel memory. so we have to
avoid the brk/[heap] check and simply copy over the [stack] one:
} else if (mm) {
if (vma->vm_start <= mm->start_stack &&
vma->vm_end >= mm->start_stack) {
pad_len_spaces(m, len);
seq_puts(m, "[stack]");
}
}

the semi-annoying thing is that FLAT combines a whole lot of stuff
(including the stack) into the same mapping giving us the output:
root:/> cat /proc/155/maps
029f0000-029f9000 rwxp 00000000 00:00 0 [stack]

but i guess this is no worse than the current ?
-mike
--
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/