Re: lowmem_reserve (replaces protection)

From: Nick Piggin (nickpiggin_at_yahoo.com.au)
Date: 10/27/04

  • Next message: Dmitry Torokhov: "Re: [PATCH 0/5] Sonypi driver model & PM changes"
    Date:	Wed, 27 Oct 2004 12:56:44 +1000
    To: Andrea Arcangeli <andrea@novell.com>
    
    

    Andrea Arcangeli wrote:
    > this _incremental_ 2/? patch should fix the longtanding kswapd issue
    > vs protection algorithm, now lowmem_reserve (partly hidden by the lack
    > of lowmem_reserve/protection or equivalent band-aid enabled in 2.6.9).
    >
    > --- 2-kswapd-balance/include/linux/mmzone.h.~1~ 2004-10-27 03:17:07.207812600 +0200
    > +++ 2-kswapd-balance/include/linux/mmzone.h 2004-10-27 03:26:22.673369000 +0200
    > @@ -273,7 +273,7 @@ void __get_zone_counts(unsigned long *ac
    > void get_zone_counts(unsigned long *active, unsigned long *inactive,
    > unsigned long *free);
    > void build_all_zonelists(void);
    > -void wakeup_kswapd(struct zone *zone);
    > +void wakeup_kswapd(struct zone *zone, int classzone_idx);
    >
    > /*
    > * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc.
    > --- 2-kswapd-balance/mm/page_alloc.c.~1~ 2004-10-27 03:17:07.215811384 +0200
    > +++ 2-kswapd-balance/mm/page_alloc.c 2004-10-27 03:24:31.351292528 +0200
    > @@ -641,7 +641,7 @@ __alloc_pages(unsigned int gfp_mask, uns
    > }
    >
    > for (i = 0; (z = zones[i]) != NULL; i++)
    > - wakeup_kswapd(z);
    > + wakeup_kswapd(z, classzone_idx);
    >
    > /*
    > * Go through the zonelist again. Let __GFP_HIGH and allocations
    > --- 2-kswapd-balance/mm/vmscan.c.~1~ 2004-10-27 03:14:22.563842288 +0200
    > +++ 2-kswapd-balance/mm/vmscan.c 2004-10-27 03:26:57.462080312 +0200
    > @@ -1169,11 +1169,11 @@ static int kswapd(void *p)
    > /*
    > * A zone is low on free memory, so wake its kswapd task to service it.
    > */
    > -void wakeup_kswapd(struct zone *zone)
    > +void wakeup_kswapd(struct zone *zone, int classzone_idx)
    > {
    > if (zone->present_pages == 0)
    > return;
    > - if (zone->free_pages > zone->pages_low)
    > + if (zone->free_pages > zone->pages_low + zone->lowmem_reserve[classzone_idx])
    > return;
    > if (!waitqueue_active(&zone->zone_pgdat->kswapd_wait))
    > return;

    I don't think this is required, because by the time __alloc_pages
    reaches wakeup_kswapd, it would have checked one zone with a
    ->lowmem_reserve of 0, and found it to be low on pages. Thus
    wakeup_kswapd will wake it up.
    -
    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/


  • Next message: Dmitry Torokhov: "Re: [PATCH 0/5] Sonypi driver model & PM changes"

    Relevant Pages

    • Re: Proper interpretation of no-wake rules
      ... a wake-creating speed 300 feet after it cuts power back to neutral. ... They don't put the "school zone" sign on school property, ... You got a ticket for a wake didn't you? ... The No Wake bouy is a marker bouy - it designates a speed zone. ...
      (rec.boats)
    • Re: Proper interpretation of no-wake rules
      ... That means your wake can't enter that zone. ... boat has to be in the zone while making a wake in order for you to get ... That would depend on the law as written. ...
      (rec.boats)
    • Re: Proper interpretation of no-wake rules
      ... That means your wake can't enter that zone. ... boat has to be in the zone while making a wake in order for you to get ... That would depend on the law as written. ...
      (rec.boats)
    • Re: Proper interpretation of no-wake rules
      ... That means your wake can't enter that zone. ... boat has to be in the zone while making a wake in order for you to get ... That would depend on the law as written. ...
      (rec.boats)
    • Re: Proper interpretation of no-wake rules
      ... That means your wake can't enter that zone. ... boat has to be in the zone while making a wake in order for you to get ... That would depend on the law as written. ...
      (rec.boats)