lkml.org 
[lkml]   [2009]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [merged] proctxt-update-kernel-filesystem-proctxt-documentation.patch removed from -mm tree
Andrew Morton <akpm@linux-foundation.org> writes:

> On Wed, 24 Jun 2009 08:45:03 +0200 Stefani Seibold <stefani@seibold.net> wrote:
>
>> Am Dienstag, den 23.06.2009, 23:32 -0700 schrieb Andrew Morton:
>> > On Wed, 24 Jun 2009 08:20:44 +0200 Stefani Seibold <stefani@seibold.net> wrote:
>> >
>> > > what is with the associated
>> > > procfs-provide-stack-information-for-threads-v08.patch
>> > > patch?
>> > >
>> > > There was no real objections against this patch, so why not merge it for
>> > > 2.6.31?
>> >
>> > Alexey pointed out that it doesn't actually work.
>>
>> That is not true... it works. With my patch the kernel does exactly know
>> where the thread stack is and therefor it is easy to determinate the
>> associated map.

Usually yes, but not in all cases.


> On Tue, 16 Jun 2009 02:33:33 +0400 Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
>> On Mon, Jun 15, 2009 at 03:02:05PM -0700, akpm@linux-foundation.org wrote:
>> > procfs-provide-stack-information-for-threads-v08.patch
>> > --- a/fs/proc/array.c~procfs-provide-stack-information-for-threads-v08
>>
>> > +++ a/fs/proc/array.c
>> > @@ -321,6 +321,54 @@ static inline void task_context_switch_c
>> > p->nivcsw);
>> > }
>> >
>> > +static inline unsigned long get_stack_usage_in_bytes(struct vm_area_struct *vma,
>> > + struct task_struct *p)
>> > +{
>> > + unsigned long i;
>> > + struct page *page;
>> > + unsigned long stkpage;
>> > +
>> > + stkpage = KSTK_ESP(p) & PAGE_MASK;
>> > +
>> > +#ifdef CONFIG_STACK_GROWSUP
>> > + for (i = vma->vm_end; i-PAGE_SIZE > stkpage; i -= PAGE_SIZE) {
>> > +
>> > + page = follow_page(vma, i-PAGE_SIZE, 0);
>>
>> How can this work?
>>
>> If stack page got swapped out, you'll get smaller than actual result.
>
> Alexey's point is that follow_page() will return NULL if it hits a
> swapped-out stack page and the loop will exit, leading to an incorrect
> (ie: short) return value from get_stack_usage_in_bytes().
>
> Is this claim wrong?


Add to that the code is unnecessarily complicated.

The patch mixes several different changes together. It deserves being
broken up into at least two patches.

I am concerned about the performance. Glibc opens /proc/self/maps in
practically every application so doing something like following page
tables requires testing and verifying the performance.

Eric


\
 
 \ /
  Last update: 2009-06-24 09:39    [W:0.080 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site