From owner-svn-src-stable@freebsd.org Wed Sep 6 07:07:00 2017 Return-Path: Delivered-To: svn-src-stable@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 3F053E17ADA; Wed, 6 Sep 2017 07:07:00 +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 C8BE6681BA; Wed, 6 Sep 2017 07:06:59 +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 v8676wmb007196; Wed, 6 Sep 2017 07:06:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8676wCX007195; Wed, 6 Sep 2017 07:06:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201709060706.v8676wCX007195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Sep 2017 07:06:58 +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: r323210 - 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: 323210 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@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 07:07:00 -0000 Author: kib Date: Wed Sep 6 07:06:58 2017 New Revision: 323210 URL: https://svnweb.freebsd.org/changeset/base/323210 Log: MFC r323018: Adjust interface of swapon_check_swzone() to its actual usage. PR: 221356 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 Wed Sep 6 07:04:29 2017 (r323209) +++ stable/11/sys/vm/swap_pager.c Wed Sep 6 07:06:58 2017 (r323210) @@ -2071,13 +2071,14 @@ done: /* * Check that the total amount of swap currently configured does not * exceed half the theoretical maximum. If it does, print a warning - * message and return -1; otherwise, return 0. + * message. */ -static int -swapon_check_swzone(unsigned long npages) +static void +swapon_check_swzone(void) { - unsigned long maxpages; + unsigned long maxpages, npages; + npages = swap_total / PAGE_SIZE; /* absolute maximum we can handle assuming 100% efficiency */ maxpages = uma_zone_get_max(swap_zone) * SWAP_META_PAGES; @@ -2088,9 +2089,7 @@ swapon_check_swzone(unsigned long npages) npages, maxpages / 2); printf("warning: increase kern.maxswzone " "or reduce amount of swap.\n"); - return (-1); } - return (0); } static void @@ -2158,7 +2157,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl nswapdev++; swap_pager_avail += nblks - 2; swap_total += (vm_ooffset_t)nblks * PAGE_SIZE; - swapon_check_swzone(swap_total / PAGE_SIZE); + swapon_check_swzone(); swp_sizecheck(); mtx_unlock(&sw_dev_mtx); }