lkml.org 
[lkml]   [2013]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: wakeup buddy

* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> On Wed, 2013-03-06 at 15:06 +0800, Michael Wang wrote:
>
> > wake_affine() stuff is trying to bind related tasks closely, but it
> > doesn't work well according to the test on 'perf bench sched pipe'
> > (thanks to Peter).
>
> so sched-pipe is a poor benchmark for this..
>
> Ideally we'd write a new benchmark that has some actual data footprint
> and we'd measure the cost of tasks being apart on the various cache
> metrics and see what affine wakeup does for it.

Ideally we'd offer applications a new, lightweight vsyscall:

void sys_sched_work_tick(void)

Or, to speed up adoption, a new, vsyscall-accelerated prctrl():

prctl(PR_WORK_TICK);

which applications could call in each basic work unit they are performing.

Sysbench would call it for every transaction completed, sched-pipe would
call it for every pipe message sent, hackbench would call it for messages,
etc. etc.

This is a minimal application level change, but gives *huge* information
to the scheduler: we could balance tasks to maximize their observed work
rate.

The scheduler could also do other things, like observe the wakeup/sleep
patterns within a 'work atom', observe execution overlap between work
atoms and place tasks accordingly, etc. etc.

Today we approximate work atoms by saying that scheduling atoms == work
atoms. But that approximation breaks down in a number of important cases.

If we had such a design we'd be able to fix pretty much everything,
without the catch-22 problems we are facing normally.

An added bonus would be increased instrumentation: we could trace, time,
profile work atom rates and could collect work atom profiles. We see work
atom execution histograms, etc. etc. - stuff that is simply not possible
today without extensive application-dependent instrumentation.

We could also use utrace scripts to define work atoms without modifying
the application: for many applications we know which particular function
call means that a basic work unit was completed.

I have actually written the prctl() approach before, for instrumentation
purposes, and it does wonders to system analysis.

Any objections?

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-03-11 10:01    [W:0.154 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site