aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <bwidawsk@FreeBSD.org>2018-11-21 04:34:18 +0000
committerBen Widawsky <bwidawsk@FreeBSD.org>2018-11-21 04:34:18 +0000
commitf82dd310bb7595df632c154e0a9f5645cb414db6 (patch)
tree53278414b05ec2c2c6830ddea9f8684c03b2fb2c
parent14b520eaa25e291e54a19cf0b680ab909c671886 (diff)
downloadsrc-f82dd310bb7595df632c154e0a9f5645cb414db6.tar.gz
src-f82dd310bb7595df632c154e0a9f5645cb414db6.zip
linuxkpi: Use pageproc instead of vmproc
According to markj@: pageproc contains the page daemon and laundry threads, which are responsible for managing the LRU page queues and writing back dirty pages. vmproc's main task is to swap out kernel stacks when the system is under memory pressure, and swap them back in when necessary. It's a somewhat legacy component of the system and isn't required. You can build a kernel without it by specifying "options NO_SWAPPING" (which is a somewhat misleading name), in which vm_swapout_dummy.c is compiled instead of vm_swapout.c. Based on this, we want pageproc to emulate kswapd, not vmproc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D18061
Notes
Notes: svn path=/head/; revision=340720
-rw-r--r--sys/compat/linuxkpi/common/include/linux/swap.h3
-rw-r--r--sys/vm/vm_pageout.h2
-rw-r--r--sys/vm/vm_swapout.c7
3 files changed, 2 insertions, 10 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/swap.h b/sys/compat/linuxkpi/common/include/linux/swap.h
index e24a8a34f0cf..33f8de4721a4 100644
--- a/sys/compat/linuxkpi/common/include/linux/swap.h
+++ b/sys/compat/linuxkpi/common/include/linux/swap.h
@@ -45,7 +45,8 @@ get_nr_swap_pages(void)
static inline int
current_is_kswapd(void)
{
- return vm_curproc_is_vmproc();
+
+ return (curproc == pageproc);
}
#endif
diff --git a/sys/vm/vm_pageout.h b/sys/vm/vm_pageout.h
index 2e6fa6cda0b3..bae7e937f274 100644
--- a/sys/vm/vm_pageout.h
+++ b/sys/vm/vm_pageout.h
@@ -107,7 +107,5 @@ void vm_pageout_oom(int shortage);
void vm_swapout_run(void);
void vm_swapout_run_idle(void);
-bool vm_curproc_is_vmproc(void);
-
#endif /* _KERNEL */
#endif /* _VM_VM_PAGEOUT_H_ */
diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c
index e9461bb75419..140dabaf2fa3 100644
--- a/sys/vm/vm_swapout.c
+++ b/sys/vm/vm_swapout.c
@@ -961,10 +961,3 @@ swapout(struct proc *p)
p->p_swtick = ticks;
return (0);
}
-
-/* Used to determine if the current process is itself the reaper. */
-bool
-vm_curproc_is_vmproc(void)
-{
- return curproc == vmproc;
-}