Re: [PATCH] staging: zcache: fix possible sleep under lock

From: Dan Carpenter
Date: Mon Aug 22 2011 - 17:12:58 EST


On Mon, Aug 22, 2011 at 02:49:45PM -0500, Seth Jennings wrote:
> Actually, should this be GFP_ATOMIC or GFP_NOWAIT?
>

GFP_ATOMIC is sort of a good default answer.

GFP_NOWAIT is normally used when you want to do something really
fast and if the allocation fails, you don't want to wait for it.
So if memory is short, and you drop a packet? Who cares! TCP has
error handling built in. Other than that, GFP_NOWAIT is used a lot
in the core kernel.

You could be right that GFP_NOWAIT is fine here. I don't know zcache
well enough to say. How bad is it if the allocation fails?

regards,
dan carpenter
--
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/