From owner-svn-src-all@freebsd.org Sun Oct 22 20:43:51 2017 Return-Path: Delivered-To: svn-src-all@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 95146E34855; Sun, 22 Oct 2017 20:43:51 +0000 (UTC) (envelope-from mjg@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 61DEB7421E; Sun, 22 Oct 2017 20:43:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9MKhoBr051511; Sun, 22 Oct 2017 20:43:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9MKho8t051509; Sun, 22 Oct 2017 20:43:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710222043.v9MKho8t051509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 22 Oct 2017 20:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324870 - in head/sys: amd64/include kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: amd64/include kern X-SVN-Commit-Revision: 324870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Oct 2017 20:43:51 -0000 Author: mjg Date: Sun Oct 22 20:43:50 2017 New Revision: 324870 URL: https://svnweb.freebsd.org/changeset/base/324870 Log: Make the sleepq chain hash size configurable per-arch and bump on amd64. While here cache-align chains. This shortens longest found chain during poudriere -j 80 from 32 to 16. Pushing this higher up will probably require allocation on boot. Modified: head/sys/amd64/include/param.h head/sys/kern/subr_sleepqueue.c Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Sun Oct 22 20:22:23 2017 (r324869) +++ head/sys/amd64/include/param.h Sun Oct 22 20:43:50 2017 (r324870) @@ -152,4 +152,8 @@ #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) +#ifdef SMP +#define SC_TABLESIZE 1024 /* Must be power of 2. */ +#endif + #endif /* !_AMD64_INCLUDE_PARAM_H_ */ Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Oct 22 20:22:23 2017 (r324869) +++ head/sys/kern/subr_sleepqueue.c Sun Oct 22 20:43:50 2017 (r324870) @@ -93,7 +93,10 @@ __FBSDID("$FreeBSD$"); * Constants for the hash table of sleep queue chains. * SC_TABLESIZE must be a power of two for SC_MASK to work properly. */ -#define SC_TABLESIZE 256 /* Must be power of 2. */ +#ifndef SC_TABLESIZE +#define SC_TABLESIZE 256 +#endif +CTASSERT(powerof2(SC_TABLESIZE)); #define SC_MASK (SC_TABLESIZE - 1) #define SC_SHIFT 8 #define SC_HASH(wc) ((((uintptr_t)(wc) >> SC_SHIFT) ^ (uintptr_t)(wc)) & \ @@ -137,7 +140,7 @@ struct sleepqueue_chain { u_int sc_depth; /* Length of sc_queues. */ u_int sc_max_depth; /* Max length of sc_queues. */ #endif -}; +} __aligned(CACHE_LINE_SIZE); #ifdef SLEEPQUEUE_PROFILING u_int sleepq_max_depth;