VM idle page zeroing

Matthew Dillon dillon at apollo.backplane.com
Mon May 17 08:55:57 PDT 2010


:Hi,
:
:Attached is a patch that changes a few things:
:
:1) Removes the CVS ID; that was vestigial, I forgot I'd included that.
:
:2) Rename idlezero_count back to cnt_prezero; this is because this is the 
:original name (in FreeBSD and in DragonFly). I don't feel strongly about 
:this at all - is it reasonable to try to match up sysctl names or not 
:worth it?

    Since it isn't part of the primary vmstats structure, no.  It's better
    to keep it categorized with the other idlezero sysctls.

:3) Change vm_page_zero_check() to return the reason that the check failed.

    Well, I think a better solution here would be to just do a separate
    check to calculate the tsleep time and not try to build it into
    vm_page_zero_check().  Or, alternatively, have vm_page_zero_check()
    return the tsleep time (where a value of 0 indicates that page zeroing
    should occur).

:4) In vm_pagezero(), switch tsleep to sleep for a variable amount of time; 
:by default it is still hz/10, now called DEFAULT_SLEEP_TIME. If 
:vm_page_zero_check() failed because zeroing was either disabled or because
:we hit the ZIDLE_HI limit, mark ourselves to sleep for a long time 
:(hz*10). If we are lower than the upper limit by higher than the low 
:limit, or we are below the low limit, restore the sleep time.

    The concept is fine.  The implementation is a bit complex for what
    it does.

:5) Set zero_state when we hit the high mark and clear when we fall below 
:the low mark; this restores the hysteresis formerly present.

    Yes, I noticed the hysteresis seemed to be off.  Instead of using
    a separate variable here you can integrate the hysteresis state into
    the primary state.  e.g. STATE_IDLE_LO, STATE_IDLE_HI.

:Other thoughts - before we enter the mainloop, perhaps a sleep without a 
:timeout, if idlezero_enable = 0? Then the enable/disable sysctl could be a 
:SYSCTL_PROC which wakes it up; this would minimize the (admittedly tiny) 
:load on systems on which it is disabled.
:...
:Thoughts on any of this?
:
:Thanks,
:-- vs

    No, this isn't necessary.  Nobody is going to notice a few microseconds
    during the boot sequence.

						-Matt






More information about the Kernel mailing list