From nobody Wed Dec 29 17:28:49 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 113831928DDF; Wed, 29 Dec 2021 17:28:50 +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 4JPJKY5l8sz4j24; Wed, 29 Dec 2021 17:28:49 +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 A4FE9E7F; Wed, 29 Dec 2021 17:28:49 +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 1BTHSncF035566; Wed, 29 Dec 2021 17:28:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTHSn35035565; Wed, 29 Dec 2021 17:28:49 GMT (envelope-from git) Date: Wed, 29 Dec 2021 17:28:49 GMT Message-Id: <202112291728.1BTHSn35035565@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: 53dd5ccce2ac - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 53dd5ccce2ac3bc8914d8c6d7dede927887503d9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640798929; 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=c8v35kiqB6Xspj+rLUcSsQ15is7H8idpapqmxRDonZc=; b=LqAnJsTUBq1RbRDcwmLpUUZj3rbMI7DV2BrPX7kqTDf7Y6EykmC98l9Cd706vZUIgVucWn jGT1961sXEito1IPaZbeP5d4cgWiUti5qxIPVtwJhneZPzYAcSj/BGd/0MYxWfUpYUJaTk R4YHI6ZJECH5Lwabbp8w6pX3e7+jgqyIIRq9ktUlY1RaGRKl7vbmGro4oCswISe2u28lPE FDKTQmE2PXM4nMvWa9Fxl4Z/SAuSTj0DjXNRsPvHMWvSbx/37QZvjOrJ3xiogcn75o3X/v U/7kqSO6CZ3f9u0+ih0zgWt1phMCRg18bE03BnqhybamRgEbnDzBFa/2Wj8KMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640798929; a=rsa-sha256; cv=none; b=lG7mbnb49Uh+R6ZEnj19FzLrWwXh0yaVjkMJbPtUqyZSIvHUGqczAc/OYpipTdiNWmCMee mFqfG0qP4DAJSg9ORwpx+ST+hxiIFTQoQY7L9jVa1GnrrYAqTF+D/f9TSnQUbUNOVyps5Z h81GKq7kVcxxoQDRpCy52Ik16hlD85M/Hpub5r/R42FKlNIJveK6mmNmKLGQkjl+bq4UlT mphot5fkD4sdlML7RpyIG0sc2znm3HAPsDAargmSckC2KzRUjVIERHInfFd5T282TGP0jN efwLKVsbAdxVShc0Tacl2RhKuiv4xhzUSfIKMRMnSiVooTW76tm1sqT7u0sCRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=53dd5ccce2ac3bc8914d8c6d7dede927887503d9 commit 53dd5ccce2ac3bc8914d8c6d7dede927887503d9 Author: Doug Moore AuthorDate: 2021-12-26 17:40:27 +0000 Commit: Doug Moore CommitDate: 2021-12-29 17:28:13 +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) (cherry picked from commit dd8ea1c755b3cc2c9c4eaa8611a97ac8f0f9b755) --- 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 189023257d07..98d9b23dea3e 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -1421,7 +1421,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; @@ -1432,7 +1432,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);