dragonfly.git
12 years agokernel - Correct unaligned results in alist_free_info()
Matthew Dillon [Sat, 19 Nov 2011 07:12:06 +0000 (23:12 -0800)]
kernel - Correct unaligned results in alist_free_info()

* alist_free_info() needs to return a power-of-2-sized and power-of-2
  aligned result in order for the caller to be able to use the information
  to allocate the resulting space.

* Fixes an issue where the kernel is unable to return a big chunk of the
  reserved DMA space back to the kernel free pool, resulting in a lot of
  wasted memory.

12 years agokernel - Implement a contiguous memory reserve for contigmalloc()
Matthew Dillon [Sat, 19 Nov 2011 05:04:00 +0000 (21:04 -0800)]
kernel - Implement a contiguous memory reserve for contigmalloc()

* We initially reserve the lower 1/4 of memory or 256MB, whichever is
  smaller.  The ALIST API is used to manage the memory.

* Once device initialization is complete, and before int is executed,
  we reduce the reserve and return pages to the normal VM paging queues.
  The reserve is reduced to ~16MB or 1/16 total memory, whichever is
  smaller.

* This can be adjusted with a tunable 'vm.dma_reserved'.

* contigmalloc() now tries the DMA reserve first.  If it fails it falls
  back to the original contigmalloc() code.  contigfree() determines whether
  the pages belong to the DMA reserve or not and will either return them
  to the reserve or free them to the normal paging queues as appropriate.

  VM pages in the reserve are left wired and not busy, and they are returned
  to the reserve in the same state.  This greatly simplifies operations that
  act on the reserve.

* Fix various bits of code that contigmalloc()'d but then kfree()'d instead
  of contigfree()'d.

12 years agokernel - Revamp subr_alist and get it ready for use
Matthew Dillon [Sat, 19 Nov 2011 04:57:16 +0000 (20:57 -0800)]
kernel - Revamp subr_alist and get it ready for use

* Fix numerous bugs in the bighint code.

* Add API functions to allow static initialization.

* When shortcutting chunks we still should flesh out the parent's whole
  array.  This makes alist_free_info() easier to implement.

* Implement alist_free_info() which provides information on the largest
  trailing chunk available (with some restrictions).  This is used to
  chop down a large preinitialization.

* Implement an allocate-after-block feature to alist_alloc()

* Implement natural alignment and boundary handling.  Allocations can only
  be in powers of 2 internally with odd-sized allocations allocating the
  larger size and then piecemeal-freeing the trailing portion.  This also
  has the effect of ensuring that the boundary and alignment will always
  be the nearest greater or equal power of 2 to the allocation request size.

12 years agokernel - Fix incorrect assertion in lwkt_token_swap()
Matthew Dillon [Fri, 18 Nov 2011 20:03:09 +0000 (12:03 -0800)]
kernel - Fix incorrect assertion in lwkt_token_swap()

* The bounds check for the two tokens was off by one, resulting in a crash
  under certain circumstances.

12 years agokernel - Fix swapcached problems when max-swap use reached (2)
Matthew Dillon [Fri, 18 Nov 2011 19:51:18 +0000 (11:51 -0800)]
kernel - Fix swapcached problems when max-swap use reached (2)

* Fix bug in last commit

12 years agokernel - Fix swapcached problems when max-swap use reached
Matthew Dillon [Fri, 18 Nov 2011 18:48:09 +0000 (10:48 -0800)]
kernel - Fix swapcached problems when max-swap use reached

* A calculation could reverse-index the limit counter and cause
  swapcached to eat an excessive amount of cpu, causing other
  processes to stall.

* Fixes network problems between avalon and the dragonfly core network.

12 years agokernel - Document vm_map_lookup_entry() better in vm/vm_map.c
Matthew Dillon [Fri, 18 Nov 2011 16:14:16 +0000 (08:14 -0800)]
kernel - Document vm_map_lookup_entry() better in vm/vm_map.c

* Add some additional code documentation.

* Issue a required cpu_ccfence() after a variable load when checking the
  vm_map_entry hint.  With the map locked shared the hint can still be
  updated concurrently even though the value, once loaded, will point to
  a stable structure.

12 years agokernel - Adjust tlb invalidation in the x86-64 pmap code
Matthew Dillon [Fri, 18 Nov 2011 16:10:41 +0000 (08:10 -0800)]
kernel - Adjust tlb invalidation in the x86-64 pmap code

* Use a locked bus cycle instruction to clear pte's in all cases.

* Remove unnecessary vm_page_hold() when removing a page table page pv.
  The page is still wired so a hold is not needed.

* Do not issue invalidation interlocks when populating a user pte, the
  invalidations issued when the user pte is removed are sufficient.

  Kernel pte's still appear to need an interlock.  It is unclear why
  (possibly early PG_PS replacement issues).

* Revamp pmap_enter() to fix a race case which could allow PG_M to get
  lost.  Any protection or wiring change fully removes the pte before
  loading a revised pte.

12 years agokernel - Fix marker in sysctl_kern_proc()
Matthew Dillon [Fri, 18 Nov 2011 16:09:11 +0000 (08:09 -0800)]
kernel - Fix marker in sysctl_kern_proc()

* The marker wasn't being marked as a marker, resulting in a
  kernel panic when two or more 'ps' commands are running concurrently
  and one blocks.

12 years agokernel - Cleanup and document
Matthew Dillon [Fri, 18 Nov 2011 16:08:24 +0000 (08:08 -0800)]
kernel - Cleanup and document

* Cleanup and document various bits of code.

12 years agorc.d/routing: Add change_routes support
Sepherosa Ziehau [Fri, 18 Nov 2011 09:38:45 +0000 (17:38 +0800)]
rc.d/routing: Add change_routes support

12 years agotbridge(9) - add man page
Alex Hornung [Fri, 18 Nov 2011 08:55:56 +0000 (08:55 +0000)]
tbridge(9) - add man page

12 years agodfregress.8 - Add info on writing testcases
Alex Hornung [Fri, 18 Nov 2011 08:26:08 +0000 (08:26 +0000)]
dfregress.8 - Add info on writing testcases

12 years agonetisr: Expose netmsg_sync_handler to avoid code duplication
Sepherosa Ziehau [Fri, 18 Nov 2011 08:42:11 +0000 (16:42 +0800)]
netisr: Expose netmsg_sync_handler to avoid code duplication

12 years agonetstat(1): Renumber the nlist[] array indices.
Sascha Wildner [Fri, 18 Nov 2011 04:41:57 +0000 (05:41 +0100)]
netstat(1): Renumber the nlist[] array indices.

I overlooked this during the atalk removal.

Reported-by: ftigeot
12 years agonetstat(1): Remove another unused prototype.
Sascha Wildner [Thu, 17 Nov 2011 21:41:05 +0000 (22:41 +0100)]
netstat(1): Remove another unused prototype.

12 years agonetgraph: Add module dependencies.
Sascha Wildner [Thu, 17 Nov 2011 21:28:09 +0000 (22:28 +0100)]
netgraph: Add module dependencies.

12 years agodfregress,dfr2text - add man pages
Alex Hornung [Fri, 18 Nov 2011 01:13:01 +0000 (01:13 +0000)]
dfregress,dfr2text - add man pages

12 years agodfregress - misc minor fixes/ make more verbose
Alex Hornung [Wed, 16 Nov 2011 17:07:58 +0000 (17:07 +0000)]
dfregress - misc minor fixes/ make more verbose

 * man page is coming soon :)

12 years agodfregress,tbridge - Move into usr.bin and sys/dev
Alex Hornung [Wed, 16 Nov 2011 10:46:08 +0000 (10:46 +0000)]
dfregress,tbridge - Move into usr.bin and sys/dev

 * cleanup of the testcases, remove duplicates, consolidate in
   test/testcases.

12 years agonetstat(1): Remove some unused prototypes.
Sascha Wildner [Thu, 17 Nov 2011 20:08:36 +0000 (21:08 +0100)]
netstat(1): Remove some unused prototypes.

12 years agokernel - Fix additional races in lwp_signotify()
Matthew Dillon [Thu, 17 Nov 2011 18:44:16 +0000 (10:44 -0800)]
kernel - Fix additional races in lwp_signotify()

* lwp_signotify() was improperly scheduling threads whos td_gd is on the
  local cpu without checking the SINTR flags.  This can catch a thread in
  the middle of being transitioned to another cpu and cause havoc.

* Only schedule the thread if the SINTR flags are set.

* We can't call setrunnable() from an IPI so adjustments have to be made
  in the remote cpu to set the lp's lwp_stat state before issuing the IPI
  and only do the scheduling of its thread from the IPI function.

Reported-by: ftigeot
12 years agokernel - more procfs work
Matthew Dillon [Thu, 17 Nov 2011 17:17:51 +0000 (09:17 -0800)]
kernel - more procfs work

* uiomove_frombuf() takes care of indexing uio_offset and checking its
  range for us so we don't have to do it ourselves, clean up use cases
  in procfs.

* Generate somewhat more consistent text output for /proc/<pid>/map by
  formatting the map entry range with static widths.

* ps_nargvstr is a signed number, do a better range check on it.

12 years agokernel - Fix ps/thread-exit and other related ps races
Matthew Dillon [Thu, 17 Nov 2011 17:04:53 +0000 (09:04 -0800)]
kernel - Fix ps/thread-exit and other related ps races

* Adjust sysctl_kern_proc()'s kernel thread scanning code to use a marker
  instead of depending on td remaining on its proper list.  Otherwise
  blocking conditions can rip td out from under us or move it to another
  cpu, potentially resulting in a crash or livelock.  Index the scan
  backwards to avoid live-locking continuous adds to the list.

* Fix a potential race is the zombie removal code vs a ps, p->p_token was
  being released too early.

* Adjust lwkt_exit() to wait for the thread's hold count to drop to zero
  so lwkt_hold() works as advertised.

12 years agosendfile: Use asynchronized pru_send when ever possible
Sepherosa Ziehau [Thu, 17 Nov 2011 13:42:29 +0000 (21:42 +0800)]
sendfile: Use asynchronized pru_send when ever possible

On Phenom 9550 (4 core, 2.2GHz):
8 parallel netperf -H 127.0.0.1 -t TCP_SENDFILE -P0 (4 runs, unit: Mbps)

old  10509.48  12364.60  11930.55  11104.94
new  21031.34  20165.39  19888.42  19896.47

This give 70% ~ 90% performance improvement

12 years agoprotosw: Add PR_ASYNC_SEND, mainly to make sure async pru_send is supported
Sepherosa Ziehau [Thu, 17 Nov 2011 12:01:17 +0000 (20:01 +0800)]
protosw: Add PR_ASYNC_SEND, mainly to make sure async pru_send is supported

Currently on IP/TCP and IPv6/TCP set this flag

12 years agokernel -- vkernel64's trap_pfault should use VM_FAULT_BURST for usermode faults.
Venkatesh Srinivas [Thu, 17 Nov 2011 02:30:11 +0000 (18:30 -0800)]
kernel -- vkernel64's trap_pfault should use VM_FAULT_BURST for usermode faults.

From x86-64 trap_pfault.

12 years agoMerge branch 'master' of /repository/git/dragonfly
Venkatesh Srinivas [Thu, 17 Nov 2011 02:10:41 +0000 (18:10 -0800)]
Merge branch 'master' of /repository/git/dragonfly

12 years agokernel -- token: Two shared token DEBUG_LOCKS tests.
Venkatesh Srinivas [Thu, 17 Nov 2011 02:07:47 +0000 (18:07 -0800)]
kernel -- token: Two shared token DEBUG_LOCKS tests.

* New warning when a pool token is taken in shared mode.

* KASSERT when trying to take an exclusive token with that token
  already held shared.

Both tests are only active under DEBUG_LOCKS.

12 years agosystat - unsigned expansion to proper display >= 2G values on 32 bit boxes
Matthew Dillon [Thu, 17 Nov 2011 01:56:39 +0000 (17:56 -0800)]
systat - unsigned expansion to proper display >= 2G values on 32 bit boxes

* Rename putlong() to put64(), and have it takes an intmax_t argument
  instead of a long.

12 years agokernel - Move VM objects from pool tokens to per-vm-object tokens
Matthew Dillon [Wed, 16 Nov 2011 22:59:34 +0000 (14:59 -0800)]
kernel - Move VM objects from pool tokens to per-vm-object tokens

* Move VM objects from pool tokens to per-vm-object tokens.

* This fixes booting issues on i386 with vm.shared_fault=1 (pool
  tokens would sometimes coincide with the token used for kernel_object
  which causes problems on i386 due to the pmap code's use of
  kernel_map/kernel_object).

12 years agokernel - Try to fix procfs readdir race
Matthew Dillon [Wed, 16 Nov 2011 20:29:20 +0000 (12:29 -0800)]
kernel - Try to fix procfs readdir race

* procfs_allocvp() may have a pfs/vnode race which the vget() may not
  completely address.  For now make sure we can't race a vnode teardown
  when attempting to acquire a vnode with vget().

12 years agokernel - Do not use shared tokens for kernel_map
Matthew Dillon [Wed, 16 Nov 2011 19:51:29 +0000 (11:51 -0800)]
kernel - Do not use shared tokens for kernel_map

* This primarily handles a case where i386 systems can deadlock on a
  shared token -> exclusive token sequence during a page fault, because
  the i386 pmap code uses kernel_object to manage page table pages.

  x86-64 page fault code does not but for now just make the change globally.

* Should not effect performance

* Change the default for vm_

* Change the default for vm.shared_fault back to 1.

Reported-by: ejc
Submitted-by: vsrinivas
12 years agokernel - Fix bug in procfs_ioctl()
Matthew Dillon [Wed, 16 Nov 2011 18:58:32 +0000 (10:58 -0800)]
kernel - Fix bug in procfs_ioctl()

* needed pfs_pfind() instead of pfind().

Reported-by: ftigeot
12 years ago<sys/socket.h>: Bring back PF_APPLETALK too, to unbreak building lang/ruby18.
Sascha Wildner [Wed, 16 Nov 2011 18:03:23 +0000 (19:03 +0100)]
<sys/socket.h>: Bring back PF_APPLETALK too, to unbreak building lang/ruby18.

Reported-by: Eric J. Christeson <eric.j.christeson@gmail.com>
12 years agokernel - Do not call pmap_enter() in vm_fault_page*()
Matthew Dillon [Wed, 16 Nov 2011 17:12:58 +0000 (09:12 -0800)]
kernel - Do not call pmap_enter() in vm_fault_page*()

* Do not call pmap_enter() from vm_fault_page*().  This function can be
  called from foreign pmap contexts and thus the current cpu's bit may
  not be set in the target pmap cpumask.  Any pmap_enter() operation will
  thus not properly synchronize with other users of the pmap (particularly
  other foreign users).

* In addition, for callers of the umtx*() function calling pmap_enter()
  is inefficient as the correct page might already be faulted in.  Now
  because we are no longer updating the page in the pmap an older page
  may still exist in the pmap (mapped read-only as it was originally COW).

  This page may no longer be correct because the umtx*() functions
  modify the contend of the page returned by vm_fault_page() without
  necessarily mapping it.  So to keep the user visibility into the memory
  correct we unmap the old page when vm_fault_page() has to do a COW.

  This is slightly more burdensome for fork() but far less burdomsome
  for the umtx system calls and also allows procfs_memrw to work properly.

* procfs uses vm_fault_page*() to access command line arguments for
  any process and umtx*() uses it to access the memory page the umtx
  is operating in.  Relative to procfs the user process pmap is foreign
  (i.e. the current cpu's bit is not set in its pm_active) and cannot
  be properly updated via a vm_fault_page*() from procfs anyway, so the
  above new behavior for vm_fault_page*() is even more correct for
  procfs use cases.

12 years agokernel - Handle degenerate cases for fill_*regs*()
Matthew Dillon [Wed, 16 Nov 2011 17:00:26 +0000 (09:00 -0800)]
kernel - Handle degenerate cases for fill_*regs*()

* These routines can be called with the lwp in various states of disrepair
  so check for NULL and return EINVAL if required pieces are missing.

12 years agokernel - Fix races in procfs
Matthew Dillon [Wed, 16 Nov 2011 16:47:29 +0000 (08:47 -0800)]
kernel - Fix races in procfs

* Use cache_copy to acquire a stable textnch

* Do not try to access the vmspace (for process args) for processes
  in the SIDL or SZOMB state as it may be a moving target even with
  the process PHOLD()en.

12 years agokernel - Fix token ordering in sysctl_kern_proc_args(), sysctl_kern_proc_cwd()
Matthew Dillon [Wed, 16 Nov 2011 16:40:40 +0000 (08:40 -0800)]
kernel - Fix token ordering in sysctl_kern_proc_args(), sysctl_kern_proc_cwd()

* We have to PHOLD() first, then get p->p_token, not the other way around.
  Use pfind() instead of pfindn().

* Extract and ref the the ncdir from p->p_fd before calling cache_fullpath()
  on it to ensure stability.

12 years agokernel - Attempt to make procfs MPSAFE (3)
Matthew Dillon [Wed, 16 Nov 2011 05:48:59 +0000 (21:48 -0800)]
kernel - Attempt to make procfs MPSAFE (3)

* More fixes to silly bugs.  Well, I did say 'attempt' :-)

12 years agokernel - Fix VM page race when exec maps a page
Matthew Dillon [Wed, 16 Nov 2011 04:33:18 +0000 (20:33 -0800)]
kernel - Fix VM page race when exec maps a page

* When vm_page_grab() is called with VM_ALLOC_RETRY allow failures due to
  page races and retry automatically.

12 years agokernel - Attempt to make procfs MPSAFE (2)
Matthew Dillon [Wed, 16 Nov 2011 03:36:58 +0000 (19:36 -0800)]
kernel - Attempt to make procfs MPSAFE (2)

* Disallow access to processes which are trying to exit.

12 years agokernel - Attempt to make procfs MPSAFE
Matthew Dillon [Wed, 16 Nov 2011 03:28:24 +0000 (19:28 -0800)]
kernel - Attempt to make procfs MPSAFE

* pfs_pfind() now acquires the p->p_token in addition to its PHOLD().

* Replace PRELE()'s with pfs_pdone() which releases the token along
  with PRELE()

* Double-check the validity of nch's passed to cache_fullpath().  This
  probably still needs work.

Reported-by: swildner
12 years agosocket: Properly inherit AUTOLOWAT and AUTOSIZE from listen socket
Sepherosa Ziehau [Wed, 16 Nov 2011 02:23:04 +0000 (10:23 +0800)]
socket: Properly inherit AUTOLOWAT and AUTOSIZE from listen socket

The soreserve and pru_attach could set these two flags internally,
so the original code will only retain those two flags but not clear
them if the listen socket does not have them.  We now explicitly
check those two flags and then set or clear them accordingly.

12 years agotcp: Fix the dangling socket reference in the async sending message
Sepherosa Ziehau [Wed, 16 Nov 2011 01:38:27 +0000 (09:38 +0800)]
tcp: Fix the dangling socket reference in the async sending message

It is possible that tcp input path or tcp timers to drop the socket
reference and put the socket into disconnected state, when there
are still asynchronized sending messages pending on the netisr
message port.  If the user space program choose to close the tcp
socket under this situation, then the socket will be directly
freed on the syscall path since the socket has already been
disconnected, so the pending asynchronized sending messages on the
netisr message port will reference freed socket, thus cause
panic later on.

Fix the problem by explicit "sync" the netisr, which could have
pending asynchronized sending messages, before freeing the socket
on the soclose path.

12 years agokernel - Major signal path adjustments (2)
Matthew Dillon [Wed, 16 Nov 2011 00:39:59 +0000 (16:39 -0800)]
kernel - Major signal path adjustments (2)

* Add missing case that was causing kill to not wakeup threads sitting
  in lwkt_sleep().

12 years agokernel - Major signal path adjustments to fix races, tsleep race fixes, +more
Matthew Dillon [Tue, 15 Nov 2011 23:23:41 +0000 (15:23 -0800)]
kernel - Major signal path adjustments to fix races, tsleep race fixes, +more

* Refactor the signal code to properly hold the lp->lwp_token.  In
  particular the ksignal() and lwp_signotify() paths.

* The tsleep() path must also hold lp->lwp_token to properly handle
  lp->lwp_stat states and interlocks.

* Refactor the timeout code in tsleep() to ensure that endtsleep() is only
  called from the proper context, and fix races between endtsleep() and
  lwkt_switch().

* Rename proc->p_flag to proc->p_flags

* Rename lwp->lwp_flag to lwp->lwp_flags

* Add lwp->lwp_mpflags and move flags which require atomic ops (are adjusted
  when not the current thread) to the new field.

* Add td->td_mpflags and move flags which require atomic ops (are adjusted
  when not the current thread) to the new field.

* Add some freeze testing code to the x86-64 trap code (default disabled).

12 years agokernel - Fix DEBUG_LOCKS races
Matthew Dillon [Tue, 15 Nov 2011 23:13:04 +0000 (15:13 -0800)]
kernel - Fix DEBUG_LOCKS races

* DEBUG_LOCKS can race when shared tokens are in use.  Attempt to fix the
  problem.

Reported-by: tuxillo
12 years agokernel - Try to fix vrevoke() race/crash
Matthew Dillon [Tue, 15 Nov 2011 23:11:58 +0000 (15:11 -0800)]
kernel - Try to fix vrevoke() race/crash

* Try to fix situations where inactive vnodes are assocatied with a
  device.

Reported-by: marino
12 years agokernel - Normalize use of sys/buf2.h for last commit
Matthew Dillon [Tue, 15 Nov 2011 23:09:02 +0000 (15:09 -0800)]
kernel - Normalize use of sys/buf2.h for last commit

* We always include both sys/buf.h and sys/buf2.h

12 years agokernel: Fix building with 'options UDF'.
Sascha Wildner [Tue, 15 Nov 2011 15:31:19 +0000 (16:31 +0100)]
kernel: Fix building with 'options UDF'.

12 years agokernel - Greatly improve shared memory fault rate concurrency / shared tokens
Matthew Dillon [Tue, 15 Nov 2011 09:02:24 +0000 (01:02 -0800)]
kernel - Greatly improve shared memory fault rate concurrency / shared tokens

This commit rolls up a lot of work to improve postgres database operations
and the system in general.  With this changes we can pgbench -j 8 -c 40 on
our 48-core opteron monster at 140000+ tps, and the shm vm_fault rate
hits 3.1M pps.

* Implement shared tokens.  They work as advertised, with some cavets.

  It is acceptable to acquire a shared token while you already hold the same
  token exclusively, but you will deadlock if you acquire an exclusive token
  while you hold the same token shared.

  Currently exclusive tokens are not given priority over shared tokens so
  starvation is possible under certain circumstances.

* Create a critical code path in vm_fault() using the new shared token
  feature to quickly fault-in pages which already exist in the VM cache.
  pmap_object_init_pt() also uses the new feature.

  This increases fault-in concurrency by a ridiculously huge amount,
  particularly on SHM segments (say when you have a large number of postgres
  clients).  Scaling for large numbers of clients on large numbers of
  cores is significantly improved.

  This also increases fault-in concurrency for MAP_SHARED file maps.

* Expand the breadn() and cluster_read() APIs.  Implement breadnx() and
  cluster_readx() which allows a getblk()'d bp to be passed.  If *bpp is not
  NULL a bp is being passed in, otherwise the routines call getblk().

* Modify the HAMMER read path to use the new API.  Instead of calling
  getcacheblk() HAMMER now calls getblk() and checks the B_CACHE flag.
  This gives getblk() a chance to regenerate a fully cached buffer from
  VM backing store without having to acquire any hammer-related locks,
  resulting in even faster operation.

* If kern.ipc.shm_use_phys is set to 2 the VM pages will be pre-allocated.
  This can take quite a while for a large map and also lock the machine
  up for a few seconds.  Defaults to off.

* Reorder the smp_invltlb()/cpu_invltlb() combos in a few places, running
  cpu_invltlb() last.

* An invalidation interlock might be needed in pmap_enter() under certain
  circumstances, enable the code for now.

* vm_object_backing_scan_callback() was failing to properly check the
  validity of a vm_object after acquiring its token.  Add the required
  check + some debugging.

* Make vm_object_set_writeable_dirty() a bit more cache friendly.

* The vmstats sysctl was scanning every process's vm_map (requiring a
  vm_map read lock to do so), which can stall for long periods of time
  when the system is paging heavily.  Change the mechanic to a LWP flag
  which can be tested with minimal locking.

* Have the phys_pager mark the page as dirty too, to make sure nothing
  tries to free it.

* Remove the spinlock in pmap_prefault_ok(), since we do not delete page
  table pages it shouldn't be needed.

* Add a required cpu_ccfence() in pmap_inval.c.  The code generated prior
  to this fix was still correct, and this makes sure it stays that way.

* Replace several manual wiring cases with calls to vm_page_wire().

12 years agovkernel: Remove unused variable.
Sascha Wildner [Tue, 15 Nov 2011 06:58:57 +0000 (07:58 +0100)]
vkernel: Remove unused variable.

12 years agops - Fix broken column alignment for programs w/ large RSS/VSZ
Matthew Dillon [Tue, 15 Nov 2011 04:01:41 +0000 (20:01 -0800)]
ps - Fix broken column alignment for programs w/ large RSS/VSZ

* A RSS or VSZ >= 1GB is displayed in gigabytes with a decimal point
  to naturally draw the human eye to the distinction.

* Fixes the broken column alignment which occurs in these cases

12 years agosystat - Handle larger numbers, cleanup
Matthew Dillon [Tue, 15 Nov 2011 03:30:11 +0000 (19:30 -0800)]
systat - Handle larger numbers, cleanup

* Print more precision for numbers greater than 999k

* Normalize displayed values so everything is in bytes
  (converted to kBytes, mBytes, gBytes, etc as required).

* Remove the -pv 1 contention display, which is not currently
  operational in the kernel anyway.

12 years agokernel: Kill an obsolete comment.
Sascha Wildner [Tue, 15 Nov 2011 02:42:45 +0000 (03:42 +0100)]
kernel: Kill an obsolete comment.

Reported-by: vsrinivas
12 years agodrm.4: Add some words about using both an on-board and another card with DRI.
Sascha Wildner [Tue, 15 Nov 2011 02:05:06 +0000 (03:05 +0100)]
drm.4: Add some words about using both an on-board and another card with DRI.

Submitted-by: Juan Francisco Cantero Hurtado <iam@juanfra.info>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2178>

12 years agoemx: Use MPSAFE callout
Sepherosa Ziehau [Tue, 15 Nov 2011 01:25:10 +0000 (09:25 +0800)]
emx: Use MPSAFE callout

12 years ago<sys/socket.h>: Re-add AF_APPLETALK to unbreak building net/netatalk (pkgsrc).
Sascha Wildner [Mon, 14 Nov 2011 19:49:40 +0000 (20:49 +0100)]
<sys/socket.h>: Re-add AF_APPLETALK to unbreak building net/netatalk (pkgsrc).

Reported-by: Max Herrgard <herrgard@gmail.com>
12 years agodfregress - An automated test driver and framework
Alex Hornung [Sun, 30 Oct 2011 01:21:59 +0000 (01:21 +0000)]
dfregress - An automated test driver and framework

 * dfregress is a simple test framework and test automation driver. It
   supports both normal userland testcases and kernel test cases.

 * It's key aim is to make it simple, if not outright dead easy, to
   write test cases. A test case is a simple program using
   printf/fprintf and exit - no magic needed. A kernel test case is a
   very small module that just needs to implement a few functions and
   call a logging and result function.

 * Sample output of the text frontend (Frontends are explained further
   down the text): http://leaf.dragonflybsd.org/~alexh/dfregress.txt

 * dfregress is very UNIXy, it uses makefiles to build the testcases,
   stdout/stderr redirection from the testcases (no fancy output
   functions needed in the testcases) and evaluates the normal return
   value of the testcase (no need to call fancy functions).

 * For kernel testcases it is a bit different - you do have to call
   functions to log output and to log the result, but it is very simple,
   hardly any overhead.

 * The test driver assumes that testcases are in the testcases/
   directory, but it supports several command line options.

 * The tests to run, including several options, are specified in the
   runlist file. An example runlist including all the testcases is
   included as config/runlist.run. Options that can be specified are:
   - timeout: (in seconds) after which the test is aborted if it hasn't
     finished.
   - test type (userland, kernel or buildonly)
   - make: which 'make' tool to use to build the test cases. Defaults to
     'make', but could also be 'gmake', etc.
   - nobuild: doesn't build the testcase and tries to directly execute
     it.
   - pre, post: external pre-run and post-run commands, e.g. to set up a
     vn device and to tear it down. This is to avoid duplication in test
     cases, the common setup can be factored out.
   - intpre, intpost: similar to the above, but it assumes that the
     testcase, when passed the parameter 'pre', will do the pre-setup,
     and when passed 'post' will do the post-test cleanup/setup/etc.
   - any number of command line arguments that are passed to the test
     case. (See the crypto/ test examples in the runlist).

 * A range of sample testcases are available in
   test/dfregress/testcases/sample, including a kernel testcase sample.

 * Note that many of the test cases in the testcases/ directory have
   been copied from elsewhere in the main repository and are,
   temporarily at least, duplicated.

 * The test driver is completely separated from the frontends. The test
   driver outputs the test run results in an XML-like format (plist)
   that can easily be parsed using proplib. Python and Ruby also have
   plist modules that could be used to parse the output.

 * The only available frontend is a simple C program that will parse the
   intermediate format to an easy to read plain text format. Additional
   frontends can be written in any language, as long as it is possible
   to load plists. Frontends are in the fe/ directory.

 * XXX: the default options (currently just the timeout) are still
   hardcoded in config.c.

 * The NOTES file gives details on how the test execution occurs and
   what result code can be raised at which point. This document, and a look
   at the generated plist, is all you need to write a new frontend that,
   for example, generates beautiful HTML output.
   For completeness sake, a part of NOTES is reproduced under the main commit
   message - specifically the part detailing the execution of a single test
   case.

======
Execution of a single test case:
======
1) chdir to testcase directory
        - if it fails, set RESULT_PREFAIL (sysbuf is of interest), goto (6)

2) build testcase (make) (unless nobuild flag is set).
        + build_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          build command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
        - if the build command has a non-zero exit value, set the result to
          BUILDFAIL, unless it's a buildonly test case, in which it is set to
          the actual result value (TIMEOUT, SIGNALLED, FAIL)
          goto (6)

3) run 'pre' command if intpre or pre is set.
        + precmd_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
        - if the pre command has a non-zero exit value, set RESULT_PREFAIL and
          goto (6)

4) run actual testcase, depending on type
        + stdout_buf is used for stdout
        + stderr_buf is used for stderr
        - for BUILDONLY: set RESULT_PASS since the build already succeeded
        - for userland and kernel: run the testcase, possibly as a different
          user (depending on the runas option), set the result to the actual
          result value (TIMEOUT, SIGNALLED, FAIL, NOTRUN)
        - if there is an internal driver error (that leads to not running the
          command), RESULT_NOTRUN is set (sysbuf is of interest)

5) run 'post' command if intpost or post is set.
        + postcmd_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          command), set RESULT_POSTFAIL (sysbuf is of interest), goto (6)
        - if the post command has a non-zero exit value, set RESULT_POSTFAIL
          and goto (6)

6) clean testcase directory (make clean) (unless nobuild flag is set).
        + cleanup_buf is used for stdout/stderr and system (driver error) buffer
        - no further action.

7) results are saved.

12 years agotcp: Use the MSL set to the rt_metrics whenever possible
Sepherosa Ziehau [Mon, 14 Nov 2011 14:31:18 +0000 (22:31 +0800)]
tcp: Use the MSL set to the rt_metrics whenever possible

12 years agort_metrics: Add rmx_msl to record user-set MSL
Sepherosa Ziehau [Mon, 14 Nov 2011 14:04:45 +0000 (22:04 +0800)]
rt_metrics: Add rmx_msl to record user-set MSL

12 years agostatfs.2: Fix indentation and add a missing .Pp.
Sascha Wildner [Mon, 14 Nov 2011 02:34:53 +0000 (03:34 +0100)]
statfs.2: Fix indentation and add a missing .Pp.

12 years agostress2: Fix a bug introduced in 3647609110201ad09b8c7b945941765be8924123.
Sascha Wildner [Mon, 14 Nov 2011 02:11:56 +0000 (03:11 +0100)]
stress2: Fix a bug introduced in 3647609110201ad09b8c7b945941765be8924123.

Even though we use statvfs() for a couple of things now, we still need
to statfs() too for getting at f_mntfromname[].

12 years agokernel: Fix linux emulation build.
Sascha Wildner [Sun, 13 Nov 2011 19:47:22 +0000 (20:47 +0100)]
kernel: Fix linux emulation build.

12 years agokernel - Improve per-cpu caching of pv_entry's
Matthew Dillon [Sun, 13 Nov 2011 17:39:14 +0000 (09:39 -0800)]
kernel - Improve per-cpu caching of pv_entry's

* The vm_zone (zalloc) code needs to be replaced with objcache, but until
  we do continue improving certain critical paths in it.

* Burst fill an empty per-cpu cache to reduce overheads when working with
  large numbers of processes with large shared address spaces (postgres,
  mysql, etc).  This reduces contention under heavy use situations.

12 years agokernel - Certain sysv_shm administrative functions still need the mp_lock
Matthew Dillon [Sun, 13 Nov 2011 17:37:38 +0000 (09:37 -0800)]
kernel - Certain sysv_shm administrative functions still need the mp_lock

* Fix a few races, particularly with the NATTCH counter, that can prevent
  the deletion of shm segments.

12 years agolibc - Bring dmalloc in for x86-64
Matthew Dillon [Sun, 13 Nov 2011 17:31:01 +0000 (09:31 -0800)]
libc - Bring dmalloc in for x86-64

* Bring in a much faster allocator for x86-64.  DMalloc is a slab alloctor
  with dynamic slab sizing capabilities, allowing slabs to be used for
  all allocation sizes.  This simplifies the code paths considerably.

* DMalloc is optimized for heavy-use situations but will still retain a
  run size similar to the old nmalloc code.  The VSZ is going to be quite
  a bit bigger, though.  The best test is w/mysqld as mysql[d] allocates
  and frees memory at a very high rate.

* DMalloc is almost completely lockless.  Slabs become owned by threads
  which can then manipulate them trivially.  Frees can operate on foreign
  slabs in a lockless manner.  A depot is used primarily as a catch-all
  for thread exits.

Written-by: Matthew Dillon
12 years agoipcs - Cleanup output format
Matthew Dillon [Sun, 13 Nov 2011 00:00:33 +0000 (16:00 -0800)]
ipcs - Cleanup output format

* Cleanup the output format a bit so fields don't run into each other

12 years agokernel - Add syscall quick return path for x86-64
Matthew Dillon [Sat, 12 Nov 2011 23:04:56 +0000 (15:04 -0800)]
kernel - Add syscall quick return path for x86-64

* Flag the case where a sysretq can be performed to quickly return
  from a system call instead of having to execute the slower doreti
  code.

* This about halves syscall times for simple system calls such as
  getuid(), and reduces longer syscalls by ~80ns or so on a fast
  3.4GHz SandyBridge, but does not seem to really effect performance
  a whole lot.

Taken-From: FreeBSD (loosely)

12 years agokernel - Use MPSAFE callouts for TCP
Matthew Dillon [Sat, 12 Nov 2011 19:28:31 +0000 (11:28 -0800)]
kernel - Use MPSAFE callouts for TCP

* Use MP callouts for tcp timers.  Since the timers do not usually fire
  this isn't that big a deal but it's still far more correct and it reduces
  lock contention.

12 years agokernel - Implement degenerate timeout case for select() and poll()
Matthew Dillon [Sat, 12 Nov 2011 19:26:43 +0000 (11:26 -0800)]
kernel - Implement degenerate timeout case for select() and poll()

* When select() or poll() are called with no descriptors and only a
  timeout, call nanosleep1() instead of using tsleep() to generate
  a more precise time delay.

* Significantly improves postgresql's performance.

12 years agokernel - Expose nanosleep1() to other kernel source files
Matthew Dillon [Sat, 12 Nov 2011 19:25:38 +0000 (11:25 -0800)]
kernel - Expose nanosleep1() to other kernel source files

* Expose nanosleep1() to other kernel source files

* Add additional sysctls to control behavior.

12 years agokernel - Remove MP lock from sysv semaphore code
Matthew Dillon [Sat, 12 Nov 2011 16:53:05 +0000 (08:53 -0800)]
kernel - Remove MP lock from sysv semaphore code

* Replace with per-semaphore pool locks for now.

12 years agokernel - Fix overflows and races in zalloc()
Matthew Dillon [Sat, 12 Nov 2011 16:51:18 +0000 (08:51 -0800)]
kernel - Fix overflows and races in zalloc()

* Fix a 32 bit overflow which would crash machines with large amounts of
  ram once the number of PV entries (in bytes) exceeds the 2GB mark.

* Refactor the page allocation to allow vm_page_alloc() and friends to block.

* Don't depend on being unqueued, wire the related pages.

12 years agokernel - Add missing dsched_exit_thread() and friends
Matthew Dillon [Sat, 12 Nov 2011 06:53:58 +0000 (22:53 -0800)]
kernel - Add missing dsched_exit_thread() and friends

* In the lwp_create()/lwp_fork() failure path we have to clean up
  the dsched stuff before scrapping the LWP.

Reported-by: swildner
12 years agokernel - Fix IPI signaling issue, add a few assertions
Matthew Dillon [Sat, 12 Nov 2011 06:31:27 +0000 (22:31 -0800)]
kernel - Fix IPI signaling issue, add a few assertions

* Change the low-level IPI code to physically disable interrupts when
  waiting for the ICR status bit to clear and issuing a new IPI.  It
  appears that on Intel cpus it is possible for (with circumstantial
  evidence) a LAPIC EOI to busy the command sequencer.

  Thus if interrupts are enabled inside a critical section, even if all
  they do is EOI the LAPIC and IRET, this can prevent an IPI from being
  sent if the interrupt occurs at just the right moment during an IPI
  operation.

* Because IPIs are already limited to one per target cpu at any given
  moment via gd->gd_npoll we can also do away with the ipiq polling
  code that was inside the ICR wait.

* Add a few assertions to try to catch other possible MP problems.

  Assert that TDF_TSLEEPQ is not set when freeing a thread.

  Assert that the cpusync ipiq does not overflow.

  Assert that the vm_object hold count does not go negative.

Reported-by: ftigeot
12 years agokernel = Fix tsleep(), remove MAILBOX signals, change signalset locks for LWPs
Matthew Dillon [Sat, 12 Nov 2011 06:27:22 +0000 (22:27 -0800)]
kernel = Fix tsleep(), remove MAILBOX signals, change signalset locks for LWPs

* tsleep() was improperly calling lwkt_gettoken() and potentially blocking
  prior to sleeping, which it isn't supposed to do.

  This may have been the cause of several odd panics and corruption, though
  no smoking gun was found.

* Change access to lp->lwp_siglist to use a spinlock instead of a token.
  Add a per-LWP spinlock in addition to the per-LWP token.

* Remove MAILBOX signals (which require p->p_token).  These are no longer
  used.

12 years agokernel - Upgrade buffer space tracking variables from int to long
Matthew Dillon [Sat, 12 Nov 2011 06:20:12 +0000 (22:20 -0800)]
kernel - Upgrade buffer space tracking variables from int to long

* Several bufspace-related buffer cache parameters can now overflow a
  32 bit integer on machines with large amounts (~64G+) of memory.
  Change these to long.

  bufspace, maxbufspace, maxbufmallocspace, lobufspace, hibufspace,
  lorunningspace, hirunningspace, dirtybufspace,
  dirtybufspacehw, runningbufspace, lodirtybufspace, hidirtybufspace.

* Also requires an API change to libkcore/libkinfo which effects top.

12 years agoinstaller: Check the user-entered swap size against our actual limits, too.
Sascha Wildner [Fri, 11 Nov 2011 19:36:13 +0000 (20:36 +0100)]
installer: Check the user-entered swap size against our actual limits, too.

12 years agoinstaller: Adjust maximum swap recommendation to our current limits.
Sascha Wildner [Fri, 11 Nov 2011 19:04:02 +0000 (20:04 +0100)]
installer: Adjust maximum swap recommendation to our current limits.

Which are 32G on i386 and 512G on x86_64.

12 years agokernel - Add required critical section around tsleep_remove()
Matthew Dillon [Fri, 11 Nov 2011 18:51:28 +0000 (10:51 -0800)]
kernel - Add required critical section around tsleep_remove()

* The tsleep_remove() call requires a critical section to avoid
  racing a wakeup interrupt.

* And assert the requirement in tsleep_remove() itself.

12 years agokernel - Fix deadlock in pmap_page_protect()
Matthew Dillon [Fri, 11 Nov 2011 18:40:36 +0000 (10:40 -0800)]
kernel - Fix deadlock in pmap_page_protect()

* Fix a deadlock situation where we attempt to get a spin lock while
  interlocked.  Not a good idea.

Reported-by: ftigeot
12 years agoNuke AppleTalk support.
Sascha Wildner [Fri, 11 Nov 2011 04:20:43 +0000 (05:20 +0100)]
Nuke AppleTalk support.

It has been broken for a while, too.

Various bits and pieces still remain, mainly in documentation, which
I'll mop up on the weekend.

I hope I haven't cut too deep but I don't think so.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2169>

12 years agokernel - Wait for I/O to finish in vm_object_terminate()
Matthew Dillon [Fri, 11 Nov 2011 03:42:59 +0000 (19:42 -0800)]
kernel - Wait for I/O to finish in vm_object_terminate()

* It is possible for swap I/O to be in progress when terminating a VM
  object, wait for any such I/O to complete before attempting to free
  the page.

* Fixes a panic which can occur under heavy loads.

Reported-by: John Marino
12 years agokernel - Fix numerous performance problems with the pageout daemon
Matthew Dillon [Fri, 11 Nov 2011 03:31:24 +0000 (19:31 -0800)]
kernel - Fix numerous performance problems with the pageout daemon

* The VM page queues were not being fully utilized, causing the pageout
  daemon to calculate incorrect average page counts for deactivation/freeing.
  This caused the pageout daemon to dig into the active queue even when it
  did not need to.

* The pageout daemon was incorrectly calculating the maxscan value for each
  queue.  It was using the aggregate count (across all 256 queues) instead of
  the per-queue count, resulting in long stalls when memory is low.

* Clean up the PQ_L2* knobs, constants, and other cruft, reducing them to
  the essentials for our goals.

Reported-by: vsrinivas, thesjg, luxh, etc
12 years agokernel - Performance improvements during heavy memory/IO use
Matthew Dillon [Fri, 11 Nov 2011 00:32:10 +0000 (16:32 -0800)]
kernel - Performance improvements during heavy memory/IO use

* Remove the vm.vm_load logic, it was breaking things worse and fixing
  things not so much.

* Fix a bug in the pageout algorithm that was causing the PQ_ACTIVE queue
  to drain excessively, messing up the LRU/activity algorithm.

* Rip out hammer_limit_running_io and instead just call waitrunningbufspace().

* Change the waitrunningbufspace() logic to add a bit of hyseresis and to
  fairly block everyone doing write I/O, otherwise some threads may be
  blocked while other threads are allowed to proceed while the buf_daemon
  is trying to flush stuff out.

12 years agokernel - Fix p->p_lock race and remove unused procedures
Matthew Dillon [Thu, 10 Nov 2011 20:25:09 +0000 (12:25 -0800)]
kernel - Fix p->p_lock race and remove unused procedures

* Remove vm_waitproc() (move its vmspace_exitfree() call to the one place
  that calls vm_waitproc()).

* Remove cpu_proc_wait(), which only called pmap_dispose_proc().

* Remove pmap_dispose_proc(), which only had an (incorrect) assertion in it
  and otherwise did nothing.

* Wait for the p->p_lock count to drop to zero before calling
  vmspace_exitfree(), and then wait again afterwords now that there
  are absolutely no possible references to (p) left.

12 years agovkernel - Add leaf customization target
Matthew Dillon [Thu, 10 Nov 2011 20:20:53 +0000 (12:20 -0800)]
vkernel - Add leaf customization target

* Add a convenience target

12 years agokernel - Increase maximum supported physical memory to 32TB
Matthew Dillon [Thu, 10 Nov 2011 18:04:26 +0000 (10:04 -0800)]
kernel - Increase maximum supported physical memory to 32TB

* Increase the maximum supported physical memory to 32TB (untested), by
  increasing the number of DMAP PDPs we reserve in the PML4E from 1 to 32.

12 years agokernel - Allow vm_page_alloc() to return NULL in bio_page_alloc()
Matthew Dillon [Thu, 10 Nov 2011 18:03:27 +0000 (10:03 -0800)]
kernel - Allow vm_page_alloc() to return NULL in bio_page_alloc()

* Alloc the allocation race case to occur in bio_page_alloc().  Callers
  will handle the case.

Reported-by: ftigeot
12 years agokernel - Deoptimize refcount case
Matthew Dillon [Thu, 10 Nov 2011 18:02:30 +0000 (10:02 -0800)]
kernel - Deoptimize refcount case

* Make sure the compiler does not optimize the loading of *countp as the
  value can change out from under us.  It's volatile anyway but don't take
  any chances.

12 years agokernel - Remove ad-hoc increment/decrement of vm->vm_sysref
Matthew Dillon [Thu, 10 Nov 2011 18:00:57 +0000 (10:00 -0800)]
kernel - Remove ad-hoc increment/decrement of vm->vm_sysref

* Remove the ad-hoc increment/decrement of vm->vm_sysref when pulling data
  out for a ps.  Acquire p->p_token instead.

  This is an attempt to determine whether these adhoc operations are
  responsible for causing a race that results in the seg-fault issue we
  see on monster.

12 years agokernel - Fix overflows in vm_zone.c
Matthew Dillon [Wed, 9 Nov 2011 10:22:27 +0000 (02:22 -0800)]
kernel - Fix overflows in vm_zone.c

* Numerous fields have to be size_t or long and several calculations have
  to be cast to size_t.

* Allows the pv_entry zalloc zone to exceed 2GB of KVM.

12 years agokernel - Increase default shared pages per process for x86-64
Matthew Dillon [Wed, 9 Nov 2011 10:21:21 +0000 (02:21 -0800)]
kernel - Increase default shared pages per process for x86-64

* Increase from 200 to 2000 per process.  This is a temporary fix until a
  better one based on max physical memory can be found.

* For vkernel64 increase from 200 to 1000.

Reported-by: ftigeot
12 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 9 Nov 2011 01:53:12 +0000 (02:53 +0100)]
bsd-family-tree: Sync with FreeBSD.

12 years agokernel - Fix lwp_create() kernel corruption and panic in error path
Matthew Dillon [Wed, 9 Nov 2011 00:10:38 +0000 (16:10 -0800)]
kernel - Fix lwp_create() kernel corruption and panic in error path

* We were forgetting to remove the lwp's thread from gd_tdallq, resulting
  in corruption of the queue.

Reported-by: swildner
12 years agokernel - Rearrange page adds in vm_add_new_page()
Matthew Dillon [Tue, 8 Nov 2011 23:41:05 +0000 (15:41 -0800)]
kernel - Rearrange page adds in vm_add_new_page()

* We were previously alternating between the head and tail of the PQ_FREE
  queues when adding new vm pages, but not zeroing the pages being placed
  at the tail.

* Instead of alternating place 1/16 of the new pages on the tail of the
  queue, zero them, and properly mark them PG_ZERO.

* This should reduce physical page fragmentation during early boot when
  drivers need to allocate contiguous low phys-memory pages.

12 years agokernel - Beef up vm_contig allocation checks
Matthew Dillon [Tue, 8 Nov 2011 23:38:16 +0000 (15:38 -0800)]
kernel - Beef up vm_contig allocation checks

* Beef up vm_contig allocation checks by also requiring the PQ_CACHE page
  to not be held or wired or unmanaged, and assert that it is not mapped
  or dirty.

* When utilizing PQ_FREE pages ignore any held pages and assert that
  the pages are not dirty in addition to not having an object.

* Do not clear PG_SBUSY when allocating a page (though it shouldn't be set
  anyway, we still shouldn't unconditionally clear the bit).

12 years agokernel - reformulate some of the pmap code to adhere to the new rules
Matthew Dillon [Tue, 8 Nov 2011 19:44:38 +0000 (11:44 -0800)]
kernel - reformulate some of the pmap code to adhere to the new rules

* hold_count can now be adjusted asynchronously so it cannot be used to
  count the number of pte's in a page table page.  Use wire_count instead.

* On i386 there is no extra wire_count for the page table page mapping itself
  so the pmap_release code should never find a page table page other than the
  page directory page itself.

* Reformulate the *ptep checks in x86-64's pmap_scan() code to avoid races.

* Document why busy pages can sometimes be found in the PQ_FREE queues.

* Document that other than finding a busy page, pages in PQ_FREE should be
  ready to go.

* It is possible for a wired page to wind up on the inactive queue, the
  pageout daemon has to deal with the case by dequeueing it.