From owner-freebsd-current@freebsd.org Fri Oct 6 19:02:51 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 8A89CE3ED88 for ; Fri, 6 Oct 2017 19:02:51 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0085.outbound.protection.outlook.com [104.47.37.85]) (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 3391D6B5FE for ; Fri, 6 Oct 2017 19:02:49 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM (52.132.78.18) by YQXPR0101MB2101.CANPRD01.PROD.OUTLOOK.COM (52.132.77.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 6 Oct 2017 19:02:48 +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; Fri, 6 Oct 2017 19:02:48 +0000 From: Rick Macklem To: "freebsd-current@freebsd.org" Subject: RFC how to use kernel procs/threads efficiently Thread-Topic: RFC how to use kernel procs/threads efficiently Thread-Index: AQHTPtSLQYujf8n5KEGHc2bjAF54kg== Date: Fri, 6 Oct 2017 19:02:48 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YQXPR0101MB2101; 6:/6PHd1Uwbt0gf3k7wsPx34sKmltxV5wH1DGKq75upgaeo3wq6N6gV0ltAL9QbIEjWQI/cAu1/Xlu7buynpAMK0vYoSeWCW06O+LMHVaE/NV02DpdjPgLIvlGJjqTnJz4uA6IGXitdFqbNTa3FMb5FMTkLxntBV0aKcWOXvGY/9fuQQI/uS3webeY+rbbWWu9OnPgA1n8ol+X67hFYa3xsYzFwX9d5R134xx7OZ8isa2NwxUxxEjfVcYFo6gHqkvJGQfyV3hdc+sB/gVVPNjjes0tJfSmqa+nrXZ+D+DHD3Jw8Ac07tQccSCQzDHWJDFrRpH2marx79B1Qjev1fjDDg==; 5:ApmVwg0ZaK/N1gESgwXVF7vOhi7Q6fkOP/zYhkqckoUJYGgCsDwyB7Ua61vdwR4RL1zd9jdndoht2k2YpvBNcprqwcigx45ldwA3TTwGJOWZQwtOmtXJGsnnv+ifEHklT2cmotrcKJKgBR9bXmgmjA==; 24:eSWDH0FIbT9smvfAsvOjbYAWrFx+LfDBdLhYJfPnnZs2j/bWAc7ftu1jSCDCaLkkYBkYyD0TwFUZK7iTVn5WM27kqUNVP2ZvhMub2fo2cTY=; 7:LnQmv+u7EbG3U6q+F7hWnWVNLXVSEwNRJlUXwYS8x0Qy4NrxNPHXVfnr7UoRxdY/PUdO1de0XecFI8zIE3JlOQdLUO13yAes+Z0/SDxAmI0Z0N0h3XXGBx5kgPPpVyBgvoL/gQtquXa6sIcQ3gtvUmJb1X3P3MjSHqIUOML1mMMZBcetVdb5U20MjJimHFa8bqc7HPMGNlacwZeKeyDnqMkqmp3fT5DBQtbJ2UEMx7M= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 6a1c896c-b30a-4c60-2427-08d50cecd623 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:YQXPR0101MB2101; x-ms-traffictypediagnostic: YQXPR0101MB2101: x-exchange-antispam-report-test: UriScan:(158342451672863)(5213294742642); 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)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123562025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:YQXPR0101MB2101; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:YQXPR0101MB2101; x-forefront-prvs: 0452022BE1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(97736004)(86362001)(105586002)(53936002)(9686003)(101416001)(3280700002)(50986999)(7696004)(5250100002)(33656002)(81156014)(14454004)(54356999)(81166006)(8936002)(478600001)(2900100001)(189998001)(786003)(74316002)(2906002)(2501003)(25786009)(305945005)(8676002)(68736007)(5640700003)(2351001)(3660700001)(6436002)(106356001)(102836003)(6916009)(316002)(55016002)(6506006)(74482002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:YQXPR0101MB2101; H:YQXPR0101MB0997.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; 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: 06 Oct 2017 19:02:48.5516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQXPR0101MB2101 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: Fri, 06 Oct 2017 19:02:51 -0000 Hi, I have now dropped the client side of Flexible File Layout for pNFS into he= ad and I believe it is basically working. Currently when talking to mirrored DS servers, it does the Write and Commit RPCs to the mirrors serially. This works, but is inefficient w.r.t. elapsed= to to completion. To do them concurrently, I need separate kernel processes/threads to do the= m. I can think of two ways to do this: 1 - The code that I have running in projects/pnfs-planb-server for the pNFS= server side does a kproc_create() to create a kernel process that does the R= PC and then krpc_exit()s. - This was easy to code and works. However, I am concerned that there= is going to be excessive overheads from doing all the kproc_create()s = and kproc_exit()s? Anyone know if these calls will result in large overheads? 2 - I haven't coded this, but the other way I can think of to do this is to create a pool of threads (kthread_create() is sufficient in this case= , I think?) and then hand each RPC to an available thread so it can do th= e RPC. - Other than a little more complex coding, the main issue I see with = this one is "How many threads and when to create more/less of them.". Anyhow, any comments w.r.t. the merits of either of the above approaches (or a suggestion of other ways to do this) would be appreciated, rick=