On 10/6/11 2:56 PM, Arun Sharma wrote: > i.e. select() should be weighted by 4x vs nanosleep() as confirmed via: > > perf script | grep comm=foo > > foo 15516 [006] 2291.187831: sched_stat_sleep: comm=foo pid=15516 > delay=4054262 [ns] > foo 15516 [006] 2291.187832: sched_stat_sleep: comm=foo pid=15516 > delay=4054262 [ns] > foo 15516 [006] 2291.188895: sched_stat_sleep: comm=foo pid=15516 > delay=1053565 [ns] > foo 15516 [006] 2291.188896: sched_stat_sleep: comm=foo pid=15516 > delay=1053565 [ns] > foo 15516 [006] 2291.188897: sched_stat_sleep: comm=foo pid=15516 > delay=1053565 [ns] > > Andrew, are you already working on user space patches? Attached is a quick hack (mainly meant as a RFC to get the discussion going). After the patch I get the expected result: 0.16% foo [unknown] [k] 0 | --- schedule | |--79.26%-- schedule_hrtimeout_range_clock | schedule_hrtimeout_range | poll_schedule_timeout | do_select | core_sys_select | sys_select | system_call_fastpath | |--16.87%-- do_nanosleep | hrtimer_nanosleep | sys_nanosleep | system_call_fastpath | --3.88%-- pipe_wait pipe_read do_sync_read vfs_read sys_read system_call_fastpath We still have the issue that per-process profiling doesn't work. -Arun