[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] scsi: fix sense_slab/bio swapping livelock

On Tue, 8 Apr 2008, Pekka Enberg wrote:
> I wonder if we can get away with a SLAB_IO flag that you can use to annotate
> caches that participate in writeout and the allocator could keep some spare
> pages around that can be handed out for them in case of OOM...

Actually, I don't think this is SLAB-specific, since there are potentially
the same issues for pages.

I suspect the right thing to do is not to mark them for "IO", but mark
them for "short-lived", and allow short-lived allocations that don't have
extended lifetimes to succeed even when a "real" allocation wouldn't.

When we are under memory pressure, a normal allocation generally needs to
clear up enough memory from elsewhere to succeed. But a short-lived
allocation without any long-term lifetimes would be known to release its
memory back to the pool, so it can be allowed to go ahead when a normal
memory allocation would not.

Examples of short-lived allocations:
- IO requests
- temporary network packets that don't get queued up (eg "ACK" packet) as
opposed to those that do get queued (incoming _or_ outgoing queues)
- things like the temporary buffers for "getname()/putname()" etc.

That said, even a lot of temporary allocations can at times have issues.
If your IO layer is dead, your IO request queues that _should_ have been
very temporary may end up staying around for a long time. But I do think
that it makes sense to prioritize allocations that are known to be short-

(It might also allows us to allocate them from different pools and just
generally have other heuristics for cache behaviour - short-lived
allocations simply have different behaviour)


 \ /
  Last update: 2008-04-07 23:21    [W:0.046 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site