public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: khromy <khromy@lnuxlab.ath.cx>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.5.53-mm3: xmms: page allocation failure. order:5, mode:0x20
Date: Sun, 29 Dec 2002 17:06:54 -0800	[thread overview]
Message-ID: <3E0F9C2E.9652D11A@digeo.com> (raw)
In-Reply-To: 1041211946.1474.31.camel@irongate.swansea.linux.org.uk

Alan Cox wrote:
> 
> On Sun, 2002-12-29 at 20:42, Andrew Morton wrote:
> > gack.  Someone is requesting 128k of memory with GFP_ATOMIC.  It fell
> > afoul of the reduced memory reserves.  It deserved to.
> 
> ISA sound I/O. And yes it really does want the 128K if it can get it on
> a slower box. It will try 128/64/32/.. so it gets less if there isnt any
> DMA RAM around. All the sound works this way because few bits of sound
> hardware, even in the PCI world, support scatter gather.
> 
> If the VM can't deal with it - we need to fix the VM.

It'll tend to usually work because GFP_KERNEL allocations prefer to
not dip into the DMA region.

> All these allocations are blocking and can wait a long time.

But it's not!  dma_alloc_coherent() is using GFP_ATOMIC|__GFP_DMA.

Now, if we can fix the caller to use

	__GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS | __GFP_DMA

then that at least will allow page reclaim.

Then we can remove this restriction in __alloc_pages():

        /*
         * Don't let big-order allocations loop.  Yield for kswapd, try again.
         */
        if (order <= 3) {
                yield();
                goto rebalance;
        }

and all will be well.

dma_alloc_coherent() should be fixed to take a gfp_mask, and callers
should be updated.

As for permitting direct page reclaim for higher-order allocations: I
just don't know - it's from before my time.  Perhaps the VM will livelock.

  reply	other threads:[~2002-12-30  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-29 20:26 2.5.53-mm3: xmms: page allocation failure. order:5, mode:0x20 khromy
2002-12-29 20:34 ` khromy
2002-12-29 20:42 ` Andrew Morton
2002-12-29 23:32   ` khromy
2002-12-29 23:54     ` Andrew Morton
     [not found]       ` <20021230002604.GA25134@lnuxlab.ath.cx>
     [not found]         ` <3E0F8EF6.3C264886@digeo.com>
2002-12-30  0:51           ` khromy
2002-12-30  0:49             ` Andrew Morton
2002-12-30  1:32   ` Alan Cox
2002-12-30  1:06     ` Andrew Morton [this message]
2002-12-30  1:20     ` khromy
2002-12-30  1:49       ` Alan Cox

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=3E0F9C2E.9652D11A@digeo.com \
    --to=akpm@digeo.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=khromy@lnuxlab.ath.cx \
    --cc=linux-kernel@vger.kernel.org \
    /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