Andrew Morton wrote:
I was planning to make it configurable. But that would still not be as flexible as below...Shailabh Nagar <[email protected]> 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 16The constant is unpleasant.
All these options mean each listener gets to pick a "custom" range of cpus to listen on, rather than choose one of pre-defined ranges (even if the pre-defined ranges can change by a configurable TASKSTATS_CPUS_PER_SET). Which means the kernel side has to figure out which of the listeners cpu range includes the currently exiting task's cpu. To do this, we'll need a callback from the binding of the netlink socket (so taskstats can maintainIf 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 thestarting CPU.<avoids mentioning nl_pad> It'd be better to use a cpumask, of course..
the cpu -> nl_pid mappings at any exit).The current genetlink interface doesn't have that kind of flexibility (though it can be added
I'm sure).Seems a bit involved if the primary aim is to restrict the number of cpus that one listener
wants to listen, rather than be able to pick which ones. A configurable range won't suffice ? --Shailabh - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- References:
- [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Jay Lan <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Paul Jackson <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: [email protected]
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Paul Jackson <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Shailabh Nagar <[email protected]>
- Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- From: Andrew Morton <[email protected]>
- [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Prev by Date: Re: [PATCH 2/2] AUTOFS: Make sure all dentries refs are released before calling kill_anon_super()
- Next by Date: Re: [PATCH] sched.h: increment TASK_COMM_LEN to 20 bytes
- Previous by thread: Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Next by thread: Re: [Patch][RFC] Disabling per-tgid stats on task exit in taskstats
- Index(es):