Re: OOM-killer too aggressive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chuck Ebbert <[email protected]> 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)
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux