From owner-svn-src-head@freebsd.org Sat Mar 11 16:35:38 2017 Return-Path: Delivered-To: svn-src-head@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 06E22D07D6E; Sat, 11 Mar 2017 16:35:38 +0000 (UTC) (envelope-from avg@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 B41ACC8; Sat, 11 Mar 2017 16:35:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2BGZa35045307; Sat, 11 Mar 2017 16:35:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2BGZauQ045304; Sat, 11 Mar 2017 16:35:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703111635.v2BGZauQ045304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 11 Mar 2017 16:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315077 - in head: sys/vm tools/tools/umastat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Mar 2017 16:35:38 -0000 Author: avg Date: Sat Mar 11 16:35:36 2017 New Revision: 315077 URL: https://svnweb.freebsd.org/changeset/base/315077 Log: uma: eliminate uk_slabsize field The field was not used beyond the initial keg setup stage anyway. MFC after: 1 month (if ever) Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/tools/tools/umastat/umastat.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Mar 11 16:00:49 2017 (r315076) +++ head/sys/vm/uma_core.c Sat Mar 11 16:35:36 2017 (r315077) @@ -1218,15 +1218,16 @@ keg_small_init(uma_keg_t keg) u_int memused; u_int wastedspace; u_int shsize; + u_int slabsize; if (keg->uk_flags & UMA_ZONE_PCPU) { u_int ncpus = (mp_maxid + 1) ? (mp_maxid + 1) : MAXCPU; - keg->uk_slabsize = sizeof(struct pcpu); + slabsize = sizeof(struct pcpu); keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { - keg->uk_slabsize = UMA_SLAB_SIZE; + slabsize = UMA_SLAB_SIZE; keg->uk_ppera = 1; } @@ -1236,8 +1237,8 @@ keg_small_init(uma_keg_t keg) * allocation bits for we round it up. */ rsize = keg->uk_size; - if (rsize < keg->uk_slabsize / SLAB_SETSIZE) - rsize = keg->uk_slabsize / SLAB_SETSIZE; + if (rsize < slabsize / SLAB_SETSIZE) + rsize = slabsize / SLAB_SETSIZE; if (rsize & keg->uk_align) rsize = (rsize & ~keg->uk_align) + (keg->uk_align + 1); keg->uk_rsize = rsize; @@ -1251,12 +1252,12 @@ keg_small_init(uma_keg_t keg) else shsize = sizeof(struct uma_slab); - keg->uk_ipers = (keg->uk_slabsize - shsize) / rsize; + keg->uk_ipers = (slabsize - shsize) / rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); memused = keg->uk_ipers * rsize + shsize; - wastedspace = keg->uk_slabsize - memused; + wastedspace = slabsize - memused; /* * We can't do OFFPAGE if we're internal or if we've been @@ -1277,9 +1278,9 @@ keg_small_init(uma_keg_t keg) * Historically this was not done because the VM could not * efficiently handle contiguous allocations. */ - if ((wastedspace >= keg->uk_slabsize / UMA_MAX_WASTE) && - (keg->uk_ipers < (keg->uk_slabsize / keg->uk_rsize))) { - keg->uk_ipers = keg->uk_slabsize / keg->uk_rsize; + if ((wastedspace >= slabsize / UMA_MAX_WASTE) && + (keg->uk_ipers < (slabsize / keg->uk_rsize))) { + keg->uk_ipers = slabsize / keg->uk_rsize; KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); #ifdef UMA_DEBUG @@ -1288,8 +1289,8 @@ keg_small_init(uma_keg_t keg) "maximum wasted space allowed = %d, " "calculated ipers = %d, " "new wasted space = %d\n", keg->uk_name, wastedspace, - keg->uk_slabsize / UMA_MAX_WASTE, keg->uk_ipers, - keg->uk_slabsize - keg->uk_ipers * keg->uk_rsize); + slabsize / UMA_MAX_WASTE, keg->uk_ipers, + slabsize - keg->uk_ipers * keg->uk_rsize); #endif keg->uk_flags |= UMA_ZONE_OFFPAGE; } @@ -1322,7 +1323,6 @@ keg_large_init(uma_keg_t keg) ("%s: Cannot large-init a UMA_ZONE_PCPU keg", __func__)); keg->uk_ppera = howmany(keg->uk_size, PAGE_SIZE); - keg->uk_slabsize = keg->uk_ppera * PAGE_SIZE; keg->uk_ipers = 1; keg->uk_rsize = keg->uk_size; @@ -1374,7 +1374,6 @@ keg_cachespread_init(uma_keg_t keg) pages = MIN(pages, (128 * 1024) / PAGE_SIZE); keg->uk_rsize = rsize; keg->uk_ppera = pages; - keg->uk_slabsize = UMA_SLAB_SIZE; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= SLAB_SETSIZE, Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat Mar 11 16:00:49 2017 (r315076) +++ head/sys/vm/uma_int.h Sat Mar 11 16:35:36 2017 (r315077) @@ -210,7 +210,6 @@ struct uma_keg { vm_offset_t uk_kva; /* Zone base KVA */ uma_zone_t uk_slabzone; /* Slab zone backing us, if OFFPAGE */ - uint16_t uk_slabsize; /* Slab size for this keg */ uint16_t uk_pgoff; /* Offset to uma_slab struct */ uint16_t uk_ppera; /* pages per allocation from backend */ uint16_t uk_ipers; /* Items per slab */ Modified: head/tools/tools/umastat/umastat.c ============================================================================== --- head/tools/tools/umastat/umastat.c Sat Mar 11 16:00:49 2017 (r315076) +++ head/tools/tools/umastat/umastat.c Sat Mar 11 16:35:36 2017 (r315077) @@ -374,7 +374,6 @@ main(int argc, char *argv[]) printf(" uk_rsize = %d\n", kz.uk_rsize); printf(" uk_maxpages = %d\n", kz.uk_maxpages); - printf(" uk_slabsize = %d\n", kz.uk_slabsize); printf(" uk_pgoff = %d\n", kz.uk_pgoff); printf(" uk_ppera = %d\n", kz.uk_ppera); printf(" uk_ipers = %d\n", kz.uk_ipers);