lkml.org 
[lkml]   [2006]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Extending getrusage
    On 4/21/06, Claudio Scordino <cloud.of.andor@gmail.com> wrote:
    > Recently, while writing some code at user level, I needed a fast way
    > to have such information about another process.

    That's not very specific. And one program isn't really a compelling
    reason. You should specify with some level of detail why you need
    that information and why you cannot depend on collaboration of the
    process you try to get the information for.


    > - return -EINVAL;
    > - return getrusage(current, who, ru);
    > + struct rusage r;
    > + struct task_struct *tsk = current;
    > + read_lock(&tasklist_lock);

    You are introducing scalability problems where there were none before.
    Even if there is some justification revealed in the end IMO the patch
    shouldn't be accepted in this form. You should not slow down the
    normal case of operation. If the current thread is observed the lock
    isn't needed.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-04-21 16:35    [W:2.446 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site