On Sun, Jul 03, 2011 at 09:15:21PM +0100, Owain Ainsworth wrote:
> so all allocators obey it, not just uvm_pagealloc (which is increasingly
> rarely called). This actually makes it a lot harder to deadlock the
> machine under very heavy memory pressure (uvm_pglistalloc for 7 pages
> when you have 7 pages left, for example).
>
> I have been using variants of this diff on my machines for months.
>
> I have discussed doing this with ariane@ many many times. here's the
> diff:
>
> ok?
One nitpick below.
> @@ -835,6 +858,20 @@ retry: /* Return point after sleeping.
> fnsegs = 0;
>
> uvm_lock_fpageq();
> +
> + /*
> + * fail if any of these conditions are true:
> + * [1] there really are no free pages, or
> + * [2] only kernel "reserved" pages remain and
> + * the we are not allowed to use them.
> + * [3] only pagedaemon "reserved" pages remain and
> + * the requestor isn't the pagedaemon.
> + */
> + if (((uvmexp.free - ptoa(count)) <= uvmexp.reserve_kernel &&
> + (flags & UVM_PLA_USERESERVE) == 0) ||
> + ((uvmexp.free -ptoa(count)) <= uvmexp.reserve_pagedaemon &&
^
I'd like to see a space after that dash.
> + !is_pdaemon))
> + goto fail;
>
> retry_desperate:
> /*
I'd like to see this in.
With that fix, ok ariane@
--
Ariane