From owner-svn-src-all@freebsd.org Wed Nov 21 04:34:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D7881103C4B; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 053F06DDA0; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9F21B5A4; Wed, 21 Nov 2018 04:34:18 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL4YIsb062182; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL4YIfW062180; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811210434.wAL4YIfW062180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Wed, 21 Nov 2018 04:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340720 - in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Commit-Revision: 340720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 053F06DDA0 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.13)[0.132,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 04:34:19 -0000 Author: bwidawsk Date: Wed Nov 21 04:34:18 2018 New Revision: 340720 URL: https://svnweb.freebsd.org/changeset/base/340720 Log: 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 Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h head/sys/vm/vm_pageout.h head/sys/vm/vm_swapout.c Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 04:34:18 2018 (r340720) @@ -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 Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_pageout.h Wed Nov 21 04:34:18 2018 (r340720) @@ -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_ */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_swapout.c Wed Nov 21 04:34:18 2018 (r340720) @@ -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; -}