linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@conectiva.com.br>
To: Mark Hemment <markhe@veritas.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] allocation looping + kswapd CPU cycles
Date: Tue, 8 May 2001 14:23:56 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0105081419070.7774-100000@freak.distro.conectiva> (raw)
In-Reply-To: <Pine.LNX.4.21.0105081225520.31900-100000@alloc>


On Tue, 8 May 2001, Mark Hemment wrote:

> 
>   In 2.4.3pre6, code in page_alloc.c:__alloc_pages(), changed from;
> 
> 	try_to_free_pages(gfp_mask);
> 	wakeup_bdflush();
> 	if (!order)
> 		goto try_again;
> to
> 	try_to_free_pages(gfp_mask);
> 	wakeup_bdflush();
> 	goto try_again;
> 
> 
>   This introduced the effect of a non-zero order, __GFP_WAIT allocation
> (without PF_MEMALLOC set), never returning failure.  The allocation keeps
> looping in __alloc_pages(), kicking kswapd, until the allocation succeeds.
> 
>   If there is plenty of memory in the free-pools and inactive-lists
> free_shortage() will return false, causing the state of these
> free-pools/inactive-lists not to be 'improved' by kswapd.
> 
>   If there is nothing else changing/improving the free-pools or
> inactive-lists, the allocation loops forever (kicking kswapd).
> 
>   Does anyone know why the 2.4.3pre6 change was made?

Because wakeup_bdflush(0) can wakeup bdflush _even_ if it does not have
any job to do (ie less than 30% dirty buffers in the default config).  

> 
>   The attached patch (against 2.4.5-pre1) fixes the looping symptom, by
> adding a counter and looping only twice for non-zero order allocations.

Looks good. (actually Rik had a patch similar to this which fixed a real
case with cdda2wav just like you described)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  parent reply	other threads:[~2001-05-08 17:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-08 11:56 Mark Hemment
2001-05-08 14:54 ` Alex Bligh - linux-kernel
2001-05-08 17:23 ` Marcelo Tosatti [this message]
2001-05-08 19:21   ` Jens Axboe
2001-05-08 20:25   ` David S. Miller
2001-05-09  9:46     ` Mark Hemment
2001-05-09 16:36       ` Marcelo Tosatti
2001-05-10  8:41         ` Mark Hemment
2001-05-10 16:43           ` Marcelo Tosatti
2001-05-10 19:52             ` Stephen C. Tweedie
2001-05-10 18:22               ` Marcelo Tosatti
2001-05-10 20:19                 ` Stephen C. Tweedie
2001-05-10 18:49                   ` Marcelo Tosatti
2001-05-10 20:52                     ` Stephen C. Tweedie
2001-05-12 14:56     ` Rik van Riel

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=Pine.LNX.4.21.0105081419070.7774-100000@freak.distro.conectiva \
    --to=marcelo@conectiva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=markhe@veritas.com \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox