All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrea Arcangeli <andrea@novell.com>
Cc: Rik van Riel <riel@redhat.com>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: lowmem_reserve (replaces protection)
Date: Wed, 27 Oct 2004 12:56:44 +1000	[thread overview]
Message-ID: <417F0E6C.60104@yahoo.com.au> (raw)
In-Reply-To: <20041027013522.GR14325@dualathlon.random>

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.

  parent reply	other threads:[~2004-10-27  2:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25 17:01 lowmem_reserve (replaces protection) Andrea Arcangeli
2004-10-26  1:48 ` Rik van Riel
2004-10-26  1:58   ` Andrea Arcangeli
2004-10-26  3:48     ` Nick Piggin
2004-10-26  4:04       ` Andrea Arcangeli
2004-10-26  4:17         ` Nick Piggin
2004-10-27  0:25           ` Andrea Arcangeli
2004-10-27  0:42             ` Andrew Morton
2004-10-27  0:48               ` Andrea Arcangeli
2004-10-27  2:06             ` Nick Piggin
2004-10-28  0:26             ` Andrea Arcangeli
2004-10-27  0:31           ` Rik van Riel
2004-10-27  0:54             ` Andrea Arcangeli
2004-10-27  0:56               ` Andrea Arcangeli
2004-10-27  1:35                 ` Andrea Arcangeli
2004-10-27  2:08                   ` Andrew Morton
2004-10-27  2:31                     ` Andrea Arcangeli
2004-10-27  2:56                   ` Nick Piggin [this message]
2004-10-27  1:00               ` Rik van Riel
2004-10-27  1:10                 ` Andrea Arcangeli
2004-10-27  2:05               ` Nick Piggin
2004-10-27  2:29                 ` Andrea Arcangeli
2004-10-27  3:01                   ` Nick Piggin
2004-10-27  3:23                     ` Andrea Arcangeli
2004-10-27  3:34                       ` Nick Piggin
2004-10-27  3:43                         ` Andrew Morton
2004-10-27  4:44                           ` Andrea Arcangeli
2004-10-27  4:51                             ` Rik van Riel
2004-10-27  5:05                               ` Andrea Arcangeli
2004-10-27  5:50                                 ` Nick Piggin
2004-10-27  5:33                             ` Andrew Morton
2004-10-27  6:11                               ` Andrea Arcangeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=417F0E6C.60104@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=andrea@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.