Re: [RFC] Per-thread getrusage

2008-01-29 Thread Pavel Emelyanov
Eric W. Biederman wrote: > Pavel Emelyanov <[EMAIL PROTECTED]> writes: >>> ... >>> +asmlinkage long sys_thread_getrusage(int tid, struct rusage __user *ru) >>> +{ >>> + struct task_struct *tsk; >>> + tsk = find_task_by_pid(tid); >>> + return getrusage(tsk, RUSAGE_THREAD, ru); >>> +} >> Well,

Re: [RFC] Per-thread getrusage

2008-01-29 Thread Pavel Emelyanov
Andrew Morton wrote: > On Mon, 28 Jan 2008 13:43:02 -0700 > [EMAIL PROTECTED] (Eric W. Biederman) wrote: > >> Pavel Emelyanov <[EMAIL PROTECTED]> writes: ... +asmlinkage long sys_thread_getrusage(int tid, struct rusage __user *ru) +{ + struct task_struct *tsk; + tsk = fi

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Andrew Morton
On Mon, 28 Jan 2008 13:43:02 -0700 [EMAIL PROTECTED] (Eric W. Biederman) wrote: > Pavel Emelyanov <[EMAIL PROTECTED]> writes: > >> ... > >> +asmlinkage long sys_thread_getrusage(int tid, struct rusage __user *ru) > >> +{ > >> + struct task_struct *tsk; > >> + tsk = find_task_by_pid(tid); > >> +

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Eric W. Biederman
Pavel Emelyanov <[EMAIL PROTECTED]> writes: >> ... >> +asmlinkage long sys_thread_getrusage(int tid, struct rusage __user *ru) >> +{ >> +struct task_struct *tsk; >> +tsk = find_task_by_pid(tid); >> +return getrusage(tsk, RUSAGE_THREAD, ru); >> +} > > Well, the find_task_by_pid() is real

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Pavel Emelyanov
Andrew Morton wrote: > On Mon, 28 Jan 2008 12:38:17 +0300 Pavel Emelyanov <[EMAIL PROTECTED]> wrote: > >>> If the code was using find_task_by_vpid() then OK (I guess). But it is >> Yup, find_task_by_vpid() will find the proper (i.e. in your namespace) task. >> >>> looking the tids up in the init_

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Andrew Morton
On Mon, 28 Jan 2008 12:38:17 +0300 Pavel Emelyanov <[EMAIL PROTECTED]> wrote: > > If the code was using find_task_by_vpid() then OK (I guess). But it is > > Yup, find_task_by_vpid() will find the proper (i.e. in your namespace) task. > > > looking the tids up in the init_pid_ns. Which I assume

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Pavel Emelyanov
Andrew Morton wrote: > On Mon, 28 Jan 2008 10:48:23 +0300 Pavel Emelyanov <[EMAIL PROTECTED]> wrote: > >> Andrew Morton wrote: >>> On Thu, 17 Jan 2008 13:57:05 +0530 Vinay Sridhar <[EMAIL PROTECTED]> >>> wrote: >>> Hi All, Last year, there was discussion about per-thread getrus

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Andrew Morton
On Mon, 28 Jan 2008 13:54:12 +0530 Sripathi Kodi <[EMAIL PROTECTED]> wrote: > Does Roland's patch (http://lkml.org/lkml/2008/1/18/589) look good to go > in, provided Ulrich's comment (http://lkml.org/lkml/2008/1/19/15) is > addressed? Sure, it looks sane - it avoids the problematic get_task_by_

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Andrew Morton
On Mon, 28 Jan 2008 10:48:23 +0300 Pavel Emelyanov <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > On Thu, 17 Jan 2008 13:57:05 +0530 Vinay Sridhar <[EMAIL PROTECTED]> > > wrote: > > > >> Hi All, > >> > >> Last year, there was discussion about per-thread getrusage by adding > >> RUSAGE

Re: [RFC] Per-thread getrusage

2008-01-28 Thread Sripathi Kodi
Hi Andrew, On Monday 28 January 2008 11:22, Andrew Morton wrote: > On Thu, 17 Jan 2008 13:57:05 +0530 Vinay Sridhar <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > Last year, there was discussion about per-thread getrusage by > > adding RUSAGE_THREAD flag to getrusage(). Please refer to the

Re: [RFC] Per-thread getrusage

2008-01-27 Thread Pavel Emelyanov
Andrew Morton wrote: > On Thu, 17 Jan 2008 13:57:05 +0530 Vinay Sridhar <[EMAIL PROTECTED]> > wrote: > >> Hi All, >> >> Last year, there was discussion about per-thread getrusage by adding >> RUSAGE_THREAD flag to getrusage(). Please refer to the thread >> http://lkml.org/lkml/2007/4/4/308.

Re: [RFC] Per-thread getrusage

2008-01-27 Thread Andrew Morton
On Thu, 17 Jan 2008 13:57:05 +0530 Vinay Sridhar <[EMAIL PROTECTED]> wrote: > Hi All, > > Last year, there was discussion about per-thread getrusage by adding > RUSAGE_THREAD flag to getrusage(). Please refer to the thread > http://lkml.org/lkml/2007/4/4/308. Ulrich had suggested that we

Re: [RFC] Per-thread getrusage

2008-01-18 Thread Roland McGrath
I agree that RUSAGE_THREAD is fine. (In fact, if you'd pressed me to remember without looking, I would have assumed we put it in already.) However, in the implementation, I would keep it cleaner by moving the identical code from inside the loop under case RUSAGE_SELF into a shared subfunction, rat

Re: [RFC] Per-thread getrusage

2008-01-17 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vinay Sridhar wrote: > There are two ways to implement this in the kernel: > 1) Introduce an additional parameter 'tid' to sys_getrusage() and put > code in glibc to handle getrusage() and pthread_getrusage() calls > correctly. > 2) Introduce a new sys