Mike Frysinger <vap...@gentoo.org> wrote:

> it'd be cool if the global /proc/maps could display something like
> [stack/<pid>], but i can't quite divine how to get a mm_struct out
> of a vm_region without having to walk the entire process list.

Tricky.  vm_regions can be shared between multiple mm_structs, although in the
case of the stack, they're probably not.  Furthermore, there's no interface to
mmap() to say the region you're allocating belongs to a particular PID (and
with userspace created threads, you have to create the stack _before_ calling
clone()).

That said, you could add a 'creator pid' to the vm_region.  This could be set
firstly by mmap() to current->pid, and then overridden by clone() for the
stack VMA.  It would be approximate, but probably a good approximation.  You
probably don't actually need a back pointer, just an integer PID.

David
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to