Re: [PATCH] mm: yield during swap prefetching

Andrew Morton
2006-03-08T00:03:06Z

Con Kolivas <kernel@kolivas.org> wrote:
>
> > yield() really sucks if there are a lot of runnable tasks. And the amount
> > of CPU which that thread uses isn't likely to matter anyway.
> >
> > I think it'd be better to just not do this. Perhaps alter the thread's
> > static priority instead? Does the scheduler have a knob which can be used
> > to disable a tasks's dynamic priority boost heuristic?
>
> We do have SCHED_BATCH but even that doesn't really have the desired effect.
> I know how much yield sucks and I actually want it to suck as much as yield
> does.

Why do you want that?

If prefetch is doing its job then it will save the machine from a pile of
major faults in the near future. The fact that the machine happens to be
running a number of busy tasks doesn't alter that. It's _worth_ stealing a
few cycles from those tasks now to avoid lengthy D-state sleeps in the near
future?