Re: [PATCH] error path in setup_arg_pages() missesvm_unacct_memory()

From: Alan Cox
Date: Tue Sep 13 2005 - 06:33:33 EST


On Maw, 2005-09-13 at 01:40 -0700, Andrew Morton wrote:
> Kirill Korotaev <dev@xxxxx> wrote:
> >
> > maybe it is worth moving vm_acct_memory() out of
> > security_vm_enough_memory()?
>
> I think that would be saner, yes. That means that the callers would call
> vm_acct_memory() after security_enough_memory(), if that succeeded.

It would make much more sense to simply sed security_vm_enough_memory()
into security_vm_claim_memory() or a better name. You need to perform
the process as one thing otherwise two people checking for enough memory
may both succeed and then both reserve memory causing overcommits that
should not be permitted.

If you jut fix the name you get the right semantics still but without
the confusion.

Alan

-
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/