public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: linux-kernel@vger.kernel.org, largret@gmail.com, axboe@suse.de,
	Andi Kleen <ak@muc.de>
Subject: Re: OOM-killer too aggressive?
Date: Sun, 26 Feb 2006 10:21:52 -0800	[thread overview]
Message-ID: <20060226102152.69728696.akpm@osdl.org> (raw)
In-Reply-To: <200602260938_MC3-1-B94B-EE2B@compuserve.com>

Chuck Ebbert <76306.1226@compuserve.com> wrote:
>
> Chris Largret is getting repeated OOM kills because of DMA memory
> exhaustion:
> 
> oom-killer: gfp_mask=0xd1, order=3
> 

This could be related to the known GFP_DMA oom on some x86_64 machines.

> Looking at floppy_open, we have:
> 
>         if (!floppy_track_buffer) {
>                 /* if opening an ED drive, reserve a big buffer,
>                  * else reserve a small one */
>                 if ((UDP->cmos == 6) || (UDP->cmos == 5))
>                         try = 64;       /* Only 48 actually useful */
>                 else
>                         try = 32;       /* Only 24 actually useful */
> 
>                 tmp = (char *)fd_dma_mem_alloc(1024 * try);
>                 if (!tmp && !floppy_track_buffer) {
>                         try >>= 1;      /* buffer only one side */
>                         INFBOUND(try, 16);
>                         tmp = (char *)fd_dma_mem_alloc(1024 * try);
>                 }
>                 if (!tmp && !floppy_track_buffer) {
>                         fallback_on_nodma_alloc(&tmp, 2048 * try);
>                 }
> 
> So it will try to allocate half its first request if that fails, then
> fall back to non-DMA memory as a last resort, but doesn't get a chance
> because the OOM killer gets invoked.  Maybe we need a new flag that says
> "fail me immediately if no memory available"?

That's __GFP_NORETRY.

> Or should floppy.c be fixed so it doesn't ask for so much?
> 

The page allocator uses 32k as the threshold for when-to-try-like-crazy.

x86_64 should probably be defining its own fd_dma_mem_alloc() which doesn't
use GFP_DMA.

--- devel/drivers/block/floppy.c~floppy-false-oom-fix	2006-02-26 10:14:38.000000000 -0800
+++ devel-akpm/drivers/block/floppy.c	2006-02-26 10:15:04.000000000 -0800
@@ -278,7 +278,8 @@ static void do_fd_request(request_queue_
 #endif
 
 #ifndef fd_dma_mem_alloc
-#define fd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL,get_order(size))
+#define fd_dma_mem_alloc(size)	\
+		__get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size))
 #endif
 
 static inline void fallback_on_nodma_alloc(char **addr, size_t l)
_


  reply	other threads:[~2006-02-26 18:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26 14:35 OOM-killer too aggressive? Chuck Ebbert
2006-02-26 18:21 ` Andrew Morton [this message]
2006-02-26 20:39   ` Andi Kleen
2006-02-26 21:04     ` Andrew Morton
2006-02-26 21:06   ` Chris Largret
2006-02-26 21:31     ` Andrew Morton
2006-02-26 23:00       ` Chris Largret
2006-02-27  0:20         ` Andrew Morton
2006-02-27  1:01           ` Chris Largret
2006-02-27  1:57             ` Andrew Morton
2006-02-27  6:34               ` Chris Largret
2006-02-26 23:47       ` Andi Kleen
2006-02-26 23:51       ` Andi Kleen
2006-02-27 22:30         ` Christoph Lameter
2006-02-28  0:41           ` Andi Kleen
2006-02-28  0:59             ` Andrew Morton
2006-02-28  1:03               ` Christoph Lameter
2006-02-28  1:25               ` Andi Kleen
2006-02-28  1:38                 ` Andrew Morton
2006-02-28 12:09                   ` Andi Kleen
     [not found] <5KvnZ-4uN-27@gated-at.bofh.it>
2006-02-26 18:39 ` Robert Hancock
2006-02-26 21:56   ` Marcelo Tosatti
2006-02-26 20:56     ` Chris Largret
2006-02-27  0:22       ` Marcelo Tosatti
2006-02-27  1:48         ` Chris Largret
2006-02-27 15:47           ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2006-02-26 23:32 Chuck Ebbert

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=20060226102152.69728696.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=76306.1226@compuserve.com \
    --cc=ak@muc.de \
    --cc=axboe@suse.de \
    --cc=largret@gmail.com \
    --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