From owner-svn-src-head@freebsd.org Wed Nov 21 00:51:53 2018 Return-Path: Delivered-To: svn-src-head@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 474CB11444D3; Wed, 21 Nov 2018 00:51:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7539B8D23E; Wed, 21 Nov 2018 00:51:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id f6so2845345iob.1; Tue, 20 Nov 2018 16:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=DOKSpZD3j6NmNcE/HupWqcsuPUKxoyPBzemDaGVYHcuN2pD057BVOPj0BV2GjbfDJg 0yzJY9loz96kYfgiklb/x+8/ct8X8Kg6RC479LzrcR2XgiBlqB8Ko/9az3qYkOBmJSWj 9TZt2WGZYw99HmzaaYIxdm2KI0uznpWxCs1ldTe9JtKt/4yY7F69hRuRUu0GgZgxpUMZ eJwl/49HzkUMD5HjvX8SK6qOOyox7AoqUpthhTrCqFXgKGTXniSlbXxVkaEEjm6hiETj bTDHuSJL43b18g5nldWJqLM4uG15F5B4WHxeMgpGxz0i1CjK09nlSULLUd1CMEFm+2s/ SP0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=ahXPEf3nm2ZT4xM2UPlQ2b05+TqNQVmLYJ6xmx/Alx1o3juMdPcbmmeErYSIx7d3pJ MUy5vHmkHILB4R7Rip8jdEhUpHf7/uLr8FJgjoEUq1tLmvihOS6d7XZvg/lNj6KUgsEK suXO3noVh/dLSUR8jmyFWrAYVogwk5xnw4NV/DIITw8oAcz6LXm6TLO35td6t5giQlJx Ebw3/B73Uj+Cjg8fgsD13zrOozneVdl0FlMgc4QUXYfe6ak4HmVB8rsmAo1SJDzgujdy M1PUE/3wFdglrn6y3Lqo1xR3g7opRNRvli0XOatEwljM/8+BwYBau3uU5EsfFdHSu43d bXQw== X-Gm-Message-State: AA+aEWYZvLhglQiOEVIYV9lqZs6Y7J4ipA26jtPqZbMlIN4lg2gsakN0 Kdn+woTwkc3IjLXXzocfuhzwSG9E4Ak= X-Google-Smtp-Source: AFSGD/UNaFJRbl7SwsSatKnqiuHu4U93VpiNhBBnQ5yimiISNFwuduANmETYvScJHpX98T5dbfegrg== X-Received: by 2002:a6b:4f14:: with SMTP id d20-v6mr3469983iob.68.1542761511494; Tue, 20 Nov 2018 16:51:51 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id b192sm1083077itb.12.2018.11.20.16.51.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:51:50 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:51:48 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121005148.GF2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 7539B8D23E X-Spamd-Result: default: False [-2.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.93)[-0.926,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.91)[-0.915,0]; IP_SCORE(-0.28)[ip: (2.63), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:51:53 -0000 On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > On 18-11-20 19:35:15, Mark Johnston wrote: > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > Author: bwidawsk > > > Date: Tue Nov 20 22:49:19 2018 > > > New Revision: 340709 > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > Log: > > > linuxkpi: Add some basic swap functions > > > > > > These are used by kms-drm to determine various heuristics relate > > > memory conditions. > > > > > > The number of free swap pages is just a variable, and it can be > > > much cheaper by either adding a new getter, or simply extern'ing > > > swap_total. However, this patch opts to use the more expensive, > > > existing interface - since this isn't an operation in a high per > > > path. > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > kms-drm: > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > Approved by: emaste (mentor) > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > Added: > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > Modified: > > > head/sys/vm/vm_pageout.h > > > head/sys/vm/vm_swapout.c > > > > > > [...] > > > Modified: head/sys/vm/vm_swapout.c > > > ============================================================================== > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > @@ -961,3 +961,10 @@ 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; > > > +} > > > > From a look at how this is used, it should probably be pageproc rather > > than vmproc. There are various code paths that just check > > curproc == pageproc inline. > > > > Could I trouble you for a quick explanation of the difference between the two? 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.