From nobody Sun Dec 26 17:47:46 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 2EBEB1906F2A; Sun, 26 Dec 2021 17:47:47 +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 4JMStp6WW6z3Lsp; Sun, 26 Dec 2021 17:47:46 +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 BB80C67FF; Sun, 26 Dec 2021 17:47:46 +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 1BQHlkcr094983; Sun, 26 Dec 2021 17:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BQHlkIG094982; Sun, 26 Dec 2021 17:47:46 GMT (envelope-from git) Date: Sun, 26 Dec 2021 17:47:46 GMT Message-Id: <202112261747.1BQHlkIG094982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 49fd2d51f07f - main - 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/main X-Git-Reftype: branch X-Git-Commit: 49fd2d51f07fb29af3fd239f83f249c00cd84123 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640540866; 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=TtowCSCaHB0NYM0OBs+3U46yjniOL22Ta5J+RPIeKjQ=; b=aoCgvSkvJw1vwz4jHE++EHUW3TBgK6xtz0xujuRhnS1y5Ezm5QENEWBut9DVei0bbAbrmX 2+oqS0qfYA+Q24NIZ23aQPs2YpjFlSc9Oi7HSBHGaWA1pZ20E78F7AwhH75yjVlr0eNyVC IoIdPizlIyj8WbLDK+QOyS7bC1tRL7tM9T980l/St2S0cMOFX6NhLIPQnB2JWxErH5SBSZ YUNTiobGXWKr6K6fRz6YwiC6OHRtu0G8jHjxwj0rBsedy6puqt52No22ctA5yZLvfN0V6F uNOCYbjSkjN2fc8oW/WWgbm+7dO4kpcnlG0bCRPLyZP/a3lJuUxggPyDjmVPUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640540866; a=rsa-sha256; cv=none; b=cfl9D/Mo38TDVuLgeDkMDsG/iD0l6qSvt1dlEN7Evhi0PLjQ3KGm90AzVEzmFcUVy766bd rrJVodwCvIP52Gb7NJMN0PGzZMVK3x2O2Ff2jn5TfJQSZI1cWDi+xkLXLOMNVRbfMqM2K3 fVSFV9ygrmKK0dLkvJR1D6uS9jIe9TCLbt2Y6n9lTcoTqvgFD6N7E7Hk+GnkTQQyy3LeU2 Peoby2KrESHjSQ/n/LWpemoZN+/zKODN7XQpDAs3t4eI7EiLY/PIo/OL8lmEnKI1p6hZrv 6LFceuSZLE0eupkln61UR721M/NOqXVQP9A16P55COZMbUkq/kp+1yb225UQ6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=49fd2d51f07fb29af3fd239f83f249c00cd84123 commit 49fd2d51f07fb29af3fd239f83f249c00cd84123 Author: Doug Moore AuthorDate: 2021-12-26 17:40:27 +0000 Commit: Doug Moore CommitDate: 2021-12-26 17:40:27 +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 --- 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 3709283c5556..b4902942224d 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -1333,7 +1333,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 (NULL); marker = &vm_rvd[domain].marker; queue = &vm_rvd[domain].partpop; @@ -1344,7 +1344,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);