[lkml]   [2000]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: ANNOUNCE: Linux Kernel ORB: kORBit
On Sat, 16 Dec 2000, Mikulas Patocka wrote:

> > Not unless your driver is broken.
> ok_to_allocate:
> ******* INTERRUPT ********
> spin_lock_irqsave(&page_alloc_lock, flags);
> /* if it's not a dma request, try non-dma first */
> if (!(gfp_mask & __GFP_DMA))
> RMQUEUE_TYPE(order, 0);
> RMQUEUE_TYPE(order, 1);
> spin_unlock_irqrestore(&page_alloc_lock, flags);
> nopage:
> return 0;
> }

Now read the code carefully and see how allocations can
end up here ... and when they can't...

> When interrupt comes here and eats page just freed by try_to_free_pages(),
> GFP_KERNEL allocation will fail => The kernel goes crazy, shoots
> processes, returns -ENOMEM to calls, maybe damages its structures.
> Deadlock in getblk, if memory is full of dirty file mapped pages.

Wrong. Getblk won't deadlock, it will just sleep and another
thread will continue later on. Killing processes will (in 2.4)
only happen when you run out of swap ... 2.4 will simply have
its processes loop in alloc_pages() until memory is available.

The "maybe damages its structures" is a sure indication of
you having a very vivid imagination ;)

> You actually do not need network flood to kill your box. Just imagine that
> kpiod is swapping files out too slowly, free memory is going lower and
> lower, every process screaming with "VM: do_try_to_free_pages failed" and
> the system is aproaching instant death.

Umm? Can you explain how this could happen?

> Besides, __get_free_pages just encourages people to write broken
> drivers because it tries to hide allocation bugs. If there would
> be something like
> if (current->flags & PF_MEMALLOC && !in_interrupt())
> panic("swapper fscked up!");

We have something a little bit like this in 2.4, though
it's just a printk and it doesn't print a backtrace. Now
that you mention it, though, printing a backtrace may be
a nice debugging option for missed higher-order allocations ;)

(but only useful if you get unreasonable amounts of them)


Hollywood goes for world dumbination,
Trailer at 11.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.158 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site