lkml.org 
[lkml]   [2002]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: aa-030-writeout_scheduling
    On Tue, 19 Mar 2002, Andrew Morton wrote:

    > 1: Introduces two new bdflush tunables:
    >
    > ndirty
    >
    > The maximum number of buffers which bdflush will attempt to
    > write out in response to a wakeup. Previously, bdflush would write
    > out the whole world.
    >
    > So this limits the amount of bdflush writeout in response to a
    > single wakeup_bdflush().
    >
    > NOTE: this code appears to be broken. If nfract_stop_bdflush
    > is set at zero, ndirty will not prevent bdflush from writing out
    > all dirty buffers. IOW, ndirty doesn't do anything at present.

    Indeed, I suspect you'll want to either fix this or remove
    the code before submitting the patch. Including dead code
    right from the start seems kind of pointless.

    Note that if you have the ndirty thing functional, the
    nfract_stop_bdflush tunable isn't doing anything, since
    kswapd would stop after ndirty pages ...



    > @@ -2957,13 +2963,18 @@ int bdflush(void *startup)
    > complete((struct completion *)startup);
    >
    > for (;;) {
    > + int ndirty = bdf_prm.b_un.ndirty;
    > +
    > CHECK_EMERGENCY_SYNC
    >
    > - spin_lock(&lru_list_lock);
    > - if (!write_some_buffers(NODEV) || balance_dirty_state() < 0) {
    > - wait_for_some_buffers(NODEV);
    > - interruptible_sleep_on(&bdflush_wait);
    > + while (ndirty > 0) {
    > + spin_lock(&lru_list_lock);
    > + if (!write_some_buffers(NODEV))
    > + break;
    > + ndirty -= NRSYNC;
    > }
    > + if (ndirty > 0 || bdflush_stop())
    > + interruptible_sleep_on(&bdflush_wait);
    > }
    > }

    To make ndirty functional, you could either make the sleep
    unconditional, or change the if condition to the following:

    if (bdf_prm.b_un.ndirty > 0 || bdflush_stop())
    interruptible_sleep_on(&bdflush_wait);

    regards,

    Rik
    --
    Bravely reimplemented by the knights who say "NIH".

    http://www.surriel.com/ http://distro.conectiva.com/

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

    \
     
     \ /
      Last update: 2005-03-22 13:25    [W:0.024 / U:119.592 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site