Re: sysctl spinning (was: Re: ps Causes Hard Hang)

From: Bruce Evans <bde_at_zeta.org.au>
Date: Thu, 4 Mar 2004 22:56:10 +1100 (EST)
On Thu, 4 Mar 2004, Don Lewis wrote:

> Hmn, it looks like vm_page_max_wired is dynamically set to one third of
> free system memory in vm_pageout().
>
>         /* XXX does not really belong here */
>         if (vm_page_max_wired == 0)
>                 vm_page_max_wired = cnt.v_free_count / 3;
>
> I was under the impression that it was one third of physical memory.

The variable is only set on system startup, and then the free memory is
not very different from physical memory (except on machines with too
little memory, and then the free memory is even more relevant for setting
memory limits).

> Should the failure to wire the buffer be mapped to a different errno?

I think so (at least for very large requests).

> There may be cases when it is valid to retry the request.
>
> The code that loops on EAGAIN was added in the rev 1.63 of
> kern_sysctl.c.

I think EAGAIN was only meant for retrying after transient changes
to the data.

Bruce
Received on Thu Mar 04 2004 - 02:56:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:46 UTC