From nobody Wed Dec 29 17:25:07 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2CBB31928070; Wed, 29 Dec 2021 17:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JPJFH6SYpz4hVD; Wed, 29 Dec 2021 17:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADBEEE4; Wed, 29 Dec 2021 17:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BTHP7UO035199; Wed, 29 Dec 2021 17:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTHP7Jn035198; Wed, 29 Dec 2021 17:25:07 GMT (envelope-from git) Date: Wed, 29 Dec 2021 17:25:07 GMT Message-Id: <202112291725.1BTHP7Jn035198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Moore Subject: git: dd8ea1c755b3 - stable/13 - vm_reserv: fix zero-boundary error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dd8ea1c755b3cc2c9c4eaa8611a97ac8f0f9b755 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640798707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CfQew0O6OMSdbr0W2HU/cO90nubMJ41BGiATxAPDe+0=; b=cvCyVsvUwL31kNKzbMvqaoThzCe0Xbut7KbeM0PQ6sCyVPe0DGmdR2GaXbc2PbyjVkux+Y dbZDEJ+h9ZS/tcecKvC+JEyk6RPnokqFY2ePiTubKcuRgra1xG3VlpKV64YrZjGrN3UUVP 18yON4vYqEuKQUInegsStUBgN/rPkioayEtWtDEWsiYhFZR0OPqwGoxpJCAjLXT9p9nWSs 8zurq2kJml/T3ZILZCJvOJPBQC9eABxDcfk3ezlcWlHfIZkoUKeysXy35vkk64yVRJFIJZ AONNxZiyjDHAozwmwUkxopd/HinzmNYGaXWA9PmNDpXVX0ZPdOmy8nj7PvawXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640798707; a=rsa-sha256; cv=none; b=OmdtG/sBVP3mtBJglfvSNTCr0fj5l5UEm8lF2TihUa5CIQaLHDpZ7A90SzI3Ylxxexsvlh YIW8r1oElaWpVzqZrXEIdNF/Kums/JdgkjjtEZOHfyhcGNwbXbxBnGzqvy6Ne5bFE+wmND 5IE/UvQ5pl6LYIAJ1ETJr2mMlR6WRuf+TiBwhw+psCY7LhUzEPNXWLQCMiHDJ+gVoBmMlx 2Yl+WR0HmVSxjY68NYtpk+m4LdCsGK5Y4ERE9tvq1fcxiPtMcurl9zC3SHpAU1/EEUyAK9 heX4jQfsqJSCA+aaIrRKEE8TmsTG2e5aNiyq55lxYlxCpSmywoI4iLkPW8h3Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=dd8ea1c755b3cc2c9c4eaa8611a97ac8f0f9b755 commit dd8ea1c755b3cc2c9c4eaa8611a97ac8f0f9b755 Author: Doug Moore AuthorDate: 2021-12-26 17:40:27 +0000 Commit: Doug Moore CommitDate: 2021-12-29 17:23:48 +0000 vm_reserv: fix zero-boundary error Handle specially the boundary==0 case of vm_reserv_reclaim_config, by turning off boundary adjustment in that case. Reviewed by: alc Tested by: pho, madpilot (cherry picked from commit 49fd2d51f07fb29af3fd239f83f249c00cd84123) --- sys/vm/vm_reserv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index d578d67dbe59..f3344f8a9cd2 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -1332,7 +1332,7 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low, * doesn't include a boundary-multiple within it. Otherwise, * no boundary-constrained allocation is possible. */ - if (size > boundary) + if (size > boundary && boundary > 0) return (false); marker = &vm_rvd[domain].marker; queue = &vm_rvd[domain].partpop; @@ -1343,7 +1343,8 @@ vm_reserv_reclaim_contig(int domain, u_long npages, vm_paddr_t low, */ ppn_align = (int)(ulmin(ulmax(PAGE_SIZE, alignment), VM_LEVEL_0_SIZE) >> PAGE_SHIFT); - ppn_bound = (int)(MIN(MAX(PAGE_SIZE, boundary), + ppn_bound = boundary == 0 ? VM_LEVEL_0_NPAGES : + (int)(MIN(MAX(PAGE_SIZE, boundary), VM_LEVEL_0_SIZE) >> PAGE_SHIFT); vm_reserv_domain_scan_lock(domain);