lkml.org 
[lkml]   [2006]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
    Shailabh Nagar <nagar@watson.ibm.com> wrote:
    >
    > +/*
    > + * Per-task exit data sent from the kernel to user space
    > + * is tagged by an id based on grouping of cpus.
    > + *
    > + * If userspace specifies a non-zero P as the nl_pid field of
    > + * the sockaddr_nl structure while binding to a netlink socket,
    > + * it will receive exit data from threads that exited on cpus in the range
    > + *
    > + * [(P-1)*Y, P*Y-1]
    > + *
    > + * where Y = TASKSTATS_CPUS_PER_SET
    > + * i.e. if TASKSTATS_CPUS_PER_SET is 16,
    > + * to listen to data from cpus 0..15, specify P=1
    > + * for cpus 16..32, specify P=2 etc.
    > + *
    > + * To listen to data from all cpus, userspace should use P=0
    > + */
    > +
    > +#define TASKSTATS_CPUS_PER_SET 16

    The constant is unpleasant.

    If we're going to abuse nl_pid then how about we design things so that
    nl_pid is treated as two 16-bit words - one word is the start CPU and the
    other word is the end cpu?

    Or, if a 65536-CPU limit is too scary, make the bottom 8 bits of nl_pid be
    the number of CPUS (ie: TASKSTATS_CPUS_PER_SET) and the top 24 bits is the
    starting CPU.

    <avoids mentioning nl_pad>

    It'd be better to use a cpumask, of course..
    -
    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-07-02 00:10    [W:4.142 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site