Re: [PATCH] scsi: fix sense_slab/bio swapping livelock

From: Christoph Lameter
Date: Tue Apr 08 2008 - 16:43:27 EST


On Mon, 7 Apr 2008, Hugh Dickins wrote:

> > Looking at mempool_alloc: Mempools may be used to do atomic allocations
> > until they fail thereby exhausting reserves and available object in the
> > partial lists of slab caches?
>
> Mempools may be used for atomic allocations, but I think that's not
> the case here. swap_writepage's get_swap_bio says GFP_NOIO, which
> allows (indeed is) __GFP_WAIT, and does not give access to __GFP_HIGH
> reserves.

Looks like that one of the issues here is that swap_writepage()
does not perform enough reclaim? If it would free more pages then
__scsi_get_command would still have pages to allocate and not drain
the reserves.

> Maybe PF_MEMALLOC and __GFP_NOMEMALLOC complicate the situation:
> I've given little thought to mempool_alloc's fiddling with the
> gfp_mask (beyond repeatedly misreading it).

Mempool_alloc()s use of the gfp_mask here suggests that it can potentially
drain all reserves and exhaust all available "slots" (partial slabs). Thus
it may regularly force any other user of the slab to hit the slow path
and potentially trigger reclaim. Could be a bit unfair.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/