lkml.org 
[lkml]   [2010]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 0/3] Do not wait the full timeout on congestion_wait when there is no congestion
    Minchan,

    It's much cleaner to keep the unchanged congestion_wait() and add a
    congestion_wait_check() for converting problematic wait sites. The
    too_many_isolated() wait is merely a protective mechanism, I won't
    bother to improve it at the cost of more code.

    Thanks,
    Fengguang

    > diff --git a/mm/compaction.c b/mm/compaction.c
    > index 94cce51..7370683 100644
    > --- a/mm/compaction.c
    > +++ b/mm/compaction.c
    > @@ -253,7 +253,11 @@ static unsigned long isolate_migratepages(struct zone *zone,
    > * delay for some time until fewer pages are isolated
    > */
    > while (unlikely(too_many_isolated(zone))) {
    > - congestion_wait(BLK_RW_ASYNC, HZ/10);
    > + long timeout = HZ/10;
    > + if (timeout == congestion_wait(BLK_RW_ASYNC, timeout)) {
    > + set_current_state(TASK_INTERRUPTIBLE);
    > + schedule_timeout(timeout);
    > + }
    >
    > if (fatal_signal_pending(current))
    > return 0;

    > diff --git a/mm/vmscan.c b/mm/vmscan.c
    > index 3109ff7..f5e3e28 100644
    > --- a/mm/vmscan.c
    > +++ b/mm/vmscan.c
    > @@ -1337,7 +1337,11 @@ shrink_inactive_list(unsigned long nr_to_scan, struct zone *zone,
    > unsigned long nr_dirty;
    > while (unlikely(too_many_isolated(zone, file, sc))) {
    > - congestion_wait(BLK_RW_ASYNC, HZ/10);
    > + long timeout = HZ/10;
    > + if (timeout == congestion_wait(BLK_RW_ASYNC, timeout)) {
    > + set_current_state(TASK_INTERRUPTIBLE);
    > + schedule_timeout(timeout);
    > + }
    >
    > /* We are about to die and free our memory. Return now. */
    > if (fatal_signal_pending(current))
    > --
    > 1.7.0.5
    >
    >
    > --
    > Kind regards,
    > Minchan Kim


    \
     
     \ /
      Last update: 2010-08-27 03:25    [W:0.023 / U:60.252 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site