Re: GFP_FAIL?

Marcelo Tosatti (marcelo@conectiva.com.br)
Tue, 25 Sep 2001 15:43:41 -0300 (BRT)


On Mon, 24 Sep 2001, Pavel Machek wrote:

> Hi!
>
> I need to alloc as much memory as possible, *but not more*. I do not
> want to OOM-kill anything. How do I do this? Tried GFP_KERNEL, will
> oom-kill. GFP_USER will OOM-kill, too.

Currently, you can't.

I've added a GFP_FAIL flag at 2.4.5-ac1 to be used by the bounce buffering
allocation code to avoid highmem deadlocks, but it was removed due to no
more need.
(http://oss.sgi.com/projects/xfs/mail_archive/0103/msg00110.html is a
similar patch which I proposed to the XFS people)

The only problem by of a GFP_FAIL flag for some users is that it cannot
fail _too_ easily. Think about the SCSI layer trying to allocate big
memory chunks to do more effective (bigger) scatter-gather transfers.

If we use GFP_FAIL to mean "get memory without any efforts", the
scatter-gather big tables are never going to happen, thus we'll have
crappy performance. For _those_ kind of allocations, we want to try a bit
more instead failing so easily. See?

Thats why I think Linus will not like such a flag with no exact meaning.

Well, ask him. :)

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