From owner-freebsd-current@freebsd.org Tue Oct 10 12:33:35 2017 Return-Path: Delivered-To: freebsd-current@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 5F5B2E30322 for ; Tue, 10 Oct 2017 12:33:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0070.outbound.protection.outlook.com [104.47.38.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0E667FB28; Tue, 10 Oct 2017 12:33:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM (52.132.78.18) by YQXPR0101MB2149.CANPRD01.PROD.OUTLOOK.COM (52.132.79.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 12:33:33 +0000 Received: from YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM ([fe80::7548:a72a:e054:70d5]) by YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM ([fe80::7548:a72a:e054:70d5%13]) with mapi id 15.20.0077.011; Tue, 10 Oct 2017 12:33:33 +0000 From: Rick Macklem To: Julian Elischer , Ian Lepore , "freebsd-current@freebsd.org" Subject: Re: RFC how to use kernel procs/threads efficiently Thread-Topic: RFC how to use kernel procs/threads efficiently Thread-Index: AQHTPtSLQYujf8n5KEGHc2bjAF54kqLXMAcAgATKEsSAAGx4AIAAoaxw Date: Tue, 10 Oct 2017 12:33:33 +0000 Message-ID: References: <1507317060.86205.268.camel@freebsd.org> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQXPR0101MB2149; 6:NEo3i6F1UXs8PBBRuw0mwq6KZLlew76ldSWUa/xiisEukMPEYqSyYHlsp5LNtb6Bj/XzFR52m4fAtSzzu0SacFltUAcQhLZSIR7nb0nK4AzwLuHugXS+QKerXq/qVjWt0BI/L9tXBEXPC0cXYHMaguB7TrLJgUZ0/d6jxVp21FQY7cr6zigRs55xtaMGKOimYk0DEPx5oWMgMVcxMl2ZtNOKmRSm2i3zGParrEgBkqZdpgtuZr+BhXDYtEYKIdwrNYsn0QnsgeaUry6t2W24LGaMIWcMcZ8WKoVUtiGd+RxVW12fYmfgytX53nS03qDab2XUGJ+pq9iYL5TlTr2yEg==; 5:A89tvlleoDvfnt9g1WcfWcgYhz//FgGp28+dq03Wq1gF5Ftq1xHfd6oBPHjzjysNT23oVnfRjri4vbvHqEcNrzWDC2eX/FCxgvCf4AgqSGfeTdm+ALqQhHo4wYwZCZyqMCRTkamyt2g0QNIN/xs2pA==; 24:JOxK7SFvfTFQ51Jwq1SmbF2uo1nTbm5Tippwym5ANQh3BWCrsoiGv+qQarQpPy+bZ7MgSbT/OpZqnfC9Pnx6mf4pcbgc+QuyIpUn4IP4ryI=; 7:Bd9qUiHlFzppfFJ7iaS7blMNWx/wvhg8xHNrZCrtAIz8PlYFBrd1PATKlw0xrlL8c0sh+AbYR0ihczTmT6XDP75ikaHeBjkBja/8YXjx8qdjjQ7fMl3ggnDG2HyzxVyt9rD8CkAQKJpgVOJ0uoeyxMlrAYVNoSYhazIGMSdSKMCkX3CnB9w3E7ZM6ap/c0Pu7GT1Pdb5ELakClN7wvjsvX209QQHDNXfqyZMpBUMdsw= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 294e57a0-00e8-45b0-8a86-08d50fdb1eea x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:YQXPR0101MB2149; x-ms-traffictypediagnostic: YQXPR0101MB2149: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:YQXPR0101MB2149; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:YQXPR0101MB2149; x-forefront-prvs: 04569283F9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(51914003)(24454002)(377454003)(199003)(76104003)(189002)(2900100001)(50986999)(101416001)(76176999)(5250100002)(53936002)(9686003)(3660700001)(86362001)(7696004)(229853002)(6246003)(25786009)(2906002)(33656002)(6506006)(5660300001)(105586002)(97736004)(450100002)(3280700002)(316002)(106356001)(102836003)(189998001)(8676002)(74482002)(55016002)(2950100002)(54356999)(2501003)(14454004)(478600001)(6436002)(8936002)(81156014)(74316002)(81166006)(68736007)(305945005)(93886005)(110136005)(786003); DIR:OUT; SFP:1101; SCL:1; SRVR:YQXPR0101MB2149; H:YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2017 12:33:33.2953 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQXPR0101MB2149 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:33:35 -0000 Julian Elischer wrote: [stuff snipped] >On 10/10/17 4:25 am, Rick Macklem wrote: >> --> As such, having a fixed reasonable # of threads is probably the best >> that can be done. >> - The current patch has the # of threads as a sysctl with a defau= lt of 32. >why not set it to ncpu or something? Well, each of these threads will do an RPC, which means a couple of short bursts of CPU and then sleep the rest of the time waiting for the RPC reply to come back from the Data Server. As such, it would seem to me that you would want a lot more threads than CPUs on the machine? However, setting the default to "N * ncpu" seems better than just a fixed "= 32" to me. (For nfsd, the current default is 8 * ncpu, so maybe that is a good default for this too?) What do you think? Thanks for the comment, rick