From owner-svn-src-all@freebsd.org Wed Nov 21 00:35:22 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 1A2371143ED5; Wed, 21 Nov 2018 00:35:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 EB7DD8C69F; Wed, 21 Nov 2018 00:35:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x129.google.com with SMTP id h65so6502079ith.3; Tue, 20 Nov 2018 16:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=XHqZ+J86sQx8EPPZmM459+XHoqpv/pqzAPnc+DST7cv4D6W/96uJVIXhX1pSlJ3Fzb bkUMXdGimet6oUy1xXLiOVWj4EM3CYdyX0VInTWxJ8s4bIxs0Lwm0MMvkkH9RrnTbhVp 9kH5uO+jzEOb8RC/N1dsUTbROrLSawyBcyCTcZN5+7hhcFkO6s/I6E/KzKRwG2Ccnw42 qnWp7tjn9OK5v3UCMdj7DWlXzhc2ZNBl2Nyuic7y5dVkABjTvv8LpbuxLy1O/C8xPJum wKm74Bm+mRpVGZXmNbX5jrCZvVkGFwpgAbulCKlvUyAImN/392hnaZzsjoq68jwTWqBH PvWw== 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:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=blAEtpARzN7eoPMdVTmaqQwNGcZfKb2srougWCZeSw6QLagDrUgYBTpx+CiQRomB7I 7XmEKuR4Jt6/ppbqFcwjLx4X9TdeWurFyHXiL08JKHoMy/ooQrKy2PbkC/5UJFxfQZ51 fqq2HditirG0fHjf3490MS0Om6WeRotF6pP4la/NLXO5olqu3vO8hswe8rINSk2LHDHb xg2x9QClukCor3AnMEDhwV0C3Z6kO3BZ++W+ZaBS74RSCjLxQVb7ikDjdUGK4JQO57nV C8nSmuhtG6SuCjil7WNUo9g8pCgeySH5nY5BZsCVRL+HbE649JiEXsAQ1rNRnMwG8PVv fH8A== X-Gm-Message-State: AA+aEWZn2Cx5BqwTWvuRwgUdZMvw63UJmYrhc2EmnP2hykufhWVmsDFz y2Dob+M1UzQJpiopFHM92mrbGLjeTQk= X-Google-Smtp-Source: AJdET5dx1yUzdGFLqsmjFux50ddJc2N9LEIXOJ4qV+gepQ+4Doi77FNfqooxjOidq7Zfh/1AXrwV+w== X-Received: by 2002:a24:4052:: with SMTP id n79-v6mr3598292ita.99.1542760518232; Tue, 20 Nov 2018 16:35:18 -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 d128sm11777070iof.37.2018.11.20.16.35.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:35:17 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:35:15 -0500 From: Mark Johnston To: Ben Widawsky Cc: 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: <20181121003515.GE2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811202249.wAKMnJxH082469@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: EB7DD8C69F X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.15)[ip: (-6.70), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.1.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.98)[-0.981,0]; 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-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 00:35:22 -0000 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.