From owner-svn-src-stable-11@freebsd.org Fri Oct 20 09:21:38 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58859E2C003; Fri, 20 Oct 2017 09:21:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C8B6F175; Fri, 20 Oct 2017 09:21:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K9LbX6060632; Fri, 20 Oct 2017 09:21:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K9LbJC060631; Fri, 20 Oct 2017 09:21:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710200921.v9K9LbJC060631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Oct 2017 09:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324796 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 324796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 09:21:38 -0000 Author: kib Date: Fri Oct 20 09:21:37 2017 New Revision: 324796 URL: https://svnweb.freebsd.org/changeset/base/324796 Log: MFC r324600, r324716: Evaluate the real size of the sblk_zone. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Fri Oct 20 09:10:49 2017 (r324795) +++ stable/11/sys/vm/swap_pager.c Fri Oct 20 09:21:37 2017 (r324796) @@ -540,7 +540,15 @@ swap_pager_swap_init(void) */ n -= ((n + 2) / 3); } while (n > 0); - if (n2 != n) + + /* + * Often uma_zone_reserve_kva() cannot reserve exactly the + * requested size. Account for the difference when + * calculating swap_maxpages. + */ + n = uma_zone_get_max(swblk_zone); + + if (n < n2) printf("Swap blk zone entries reduced from %lu to %lu.\n", n2, n); swap_maxpages = n * SWAP_META_PAGES;