Print this page
remove whole-process swapping
Long before Unix supported paging, it used process swapping to reclaim
memory. The code is there and in theory it runs when we get *extremely* low
on memory. In practice, it never runs since the definition of low-on-memory
is antiquated. (XXX: define what antiquated means)
You can check the number of swapout/swapin events with kstats:
$ kstat -p ::vm:swapin ::vm:swapout
*** 22,33 ****
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <mdb/mdb_param.h>
#include <mdb/mdb_modapi.h>
#include <sys/fs/ufs_inode.h>
#include <sys/kmem_impl.h>
--- 22,31 ----
*** 276,301 ****
leaky_grep((uintptr_t)mod.bss, mod.bss_size);
return (WALK_NEXT);
}
static int
leaky_thread(uintptr_t addr, const kthread_t *t, unsigned long *pagesize)
{
uintptr_t size, base = (uintptr_t)t->t_stkbase;
uintptr_t stk = (uintptr_t)t->t_stk;
- /*
- * If this thread isn't in memory, we can't look at its stack. This
- * may result in false positives, so we print a warning.
- */
- if (!(t->t_schedflag & TS_LOAD)) {
- mdb_printf("findleaks: thread %p's stack swapped out; "
- "false positives possible\n", addr);
- return (WALK_NEXT);
- }
-
if (t->t_state != TS_FREE)
leaky_grep(base, stk - base);
/*
* There is always gunk hanging out between t_stk and the page
--- 274,290 ----
leaky_grep((uintptr_t)mod.bss, mod.bss_size);
return (WALK_NEXT);
}
+ /*ARGSUSED*/
static int
leaky_thread(uintptr_t addr, const kthread_t *t, unsigned long *pagesize)
{
uintptr_t size, base = (uintptr_t)t->t_stkbase;
uintptr_t stk = (uintptr_t)t->t_stk;
if (t->t_state != TS_FREE)
leaky_grep(base, stk - base);
/*
* There is always gunk hanging out between t_stk and the page