lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC][PATCH v2 1/7] taskstats: Add new taskstats command TASKSTATS_CMD_ATTR_PIDS
    From
    Date
    On Mon, 2010-11-15 at 16:53 +0100, Michael Holzheu wrote:
    > Hello Peter,
    >
    > On Sat, 2010-11-13 at 20:20 +0100, Peter Zijlstra wrote:
    > > On Thu, 2010-11-11 at 18:03 +0100, Michael Holzheu wrote:
    > > > As clock for 'now' and 'time' the sched_clock() function is used and the patch
    > >
    > > > + preempt_disable();
    > > > + stats->time_ns = sched_clock();
    > > > + preempt_enable();
    > >
    > > > + task_snap_time = sched_clock();
    > >
    > > That's just plain broken...
    >
    > What exactly do you mean? Do you mean that we should not use
    > sched_clock() in general or that it is called twice?

    That you should not use sched_clock(), and if you do (you really
    shouldn't) you should have disabled IRQs around it.

    > >
    > >
    > > > + t->sched_info.last_depart = task_rq(t)->clock;
    > >
    > > Are you sure you don't mean task_rq(t)->clock_task ?
    >
    > Maybe... I want to save in "last_depart" a sched_clock() timestamp that
    > is as precise as possible.
    >
    > We use "last_depart" for the TASKSTATS_CMD_ATTR_PIDS command to find out
    > which tasks have been running on a CPU since the last taskstats
    > snapshot. We return all tasks where last_depart > MIN(stats->time_ns for
    > all tasks of last snapshot).

    What does last departed mean? That is what timeline are you counting in?
    Do you want time as tasks see it, or time as your wallclock sees it?


    \
     
     \ /
      Last update: 2010-11-15 17:09    [W:2.314 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site