Re: CONFIG_PREEMPT and server workloads

From: Chris Mason
Date: Thu Mar 18 2004 - 17:55:26 EST


On Thu, 2004-03-18 at 17:32, Andrew Morton wrote:
> Takashi Iwai <tiwai@xxxxxxx> wrote:
> >
> > --- linux-2.6.4-8/fs/jbd/commit.c-dist 2004-03-16 23:00:40.000000000 +0100
> > +++ linux-2.6.4-8/fs/jbd/commit.c 2004-03-18 02:42:41.043448624 +0100
> > @@ -290,6 +290,9 @@ write_out_data_locked:
> > commit_transaction->t_sync_datalist = jh;
> > break;
> > }
> > +
> > + if (need_resched())
> > + break;
> > } while (jh != last_jh);
> >
> > if (bufs || need_resched()) {
>
> Yup, this has problems.
>
> What we're doing here is walking (under spinlock) a ring of buffers
> searching for unlocked dirty ones to write out.
>
> Suppose the ring has thousands of locked buffers and there is a RT task
> scheduling at 1kHz. Each time need_resched() comes true we break out of
> the search, schedule away and then restart the search from the beginning.
>
Why not just put all the locked buffers onto a different list as you
find them or lock them. That way you can always make progress...

-chris


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/