This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Patch [3/3] Userspace probes single stepping out-of-line
- From: "Zhang, Yanmin" <yanmin dot zhang at intel dot com>
- To: <prasanna at in dot ibm dot com>
- Cc: <systemtap at sources dot redhat dot com>, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, "Mao, Bibo" <bibo dot mao at intel dot com>
- Date: Thu, 2 Feb 2006 15:46:37 +0800
- Subject: RE: Patch [3/3] Userspace probes single stepping out-of-line
>>-----Original Message-----
>>From: Prasanna S Panchamukhi [mailto:prasanna@in.ibm.com]
>>Sent: 2006年1月30日 16:45
>>To: Zhang, Yanmin
>>Cc: systemtap@sources.redhat.com; Keshavamurthy, Anil S; Mao, Bibo
>>Subject: Re: Patch [3/3] Userspace probes single stepping out-of-line
>>
>>Yanmin,
>>
>>Please see my comments inline below.
>>
>>> >>7. Accessing user space pages not present in memory, from the
>>> >>registered callback routines.
>>> The patch uses the page_addr aligned with stack pointer to store instructions for single step.
>>> It doesn't consider scenarios of multi-thread process. For example, 1 process has 10 threads
>>> and every thread has an 8kb stack.
>>
>>Initially this patch checks if there is enough free space in the current stack
>>page below %esp before storing the instructions for single stepping. I think this
>>should work even for multi threaded processes.
>>
>> All the stacks share the same vma. Just near the end of
>>> the first 4kb page, threads might try to extend the same vma at the same time while every
>>> thread still has a stack page available. I suggest to use stack_addr - sizeof(long long) - size,
>>> if the result is bigger than vma->vm_start at VM_GROWDOWN case.
>>
>>If there is no free space in the current stack page, we can check
>>for some space before vma->vm_start, and then expand beyond vm_start
>>if there is no space before vma->vm_start as you suggested.
>>We can synchronize among multiple-threads using mmap_sem, I will try and
>>implement this in the next set.
[YM] All threads of the process will grow the stack vma for ever as they couldn't withdraw.
And the address space of the process is used up in the end.