From owner-freebsd-current@freebsd.org Fri Dec 1 22:33:28 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 0EE23DB9135; Fri, 1 Dec 2017 22:33:28 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0069.outbound.protection.outlook.com [104.47.38.69]) (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 92E8C74742; Fri, 1 Dec 2017 22:33:27 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM (52.132.46.161) by YTOPR0101MB2169.CANPRD01.PROD.OUTLOOK.COM (52.132.46.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Fri, 1 Dec 2017 22:33:25 +0000 Received: from YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM ([fe80::f072:85d3:769:e6f8]) by YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM ([fe80::f072:85d3:769:e6f8%13]) with mapi id 15.20.0282.007; Fri, 1 Dec 2017 22:33:25 +0000 From: Rick Macklem To: Emmanuel Vadot CC: Konstantin Belousov , FreeBSD Current , "freebsd-fs@freebsd.org" , John Baldwin Subject: Re: Switch vfs.nfsd.issue_delegations to TUNABLE ? Thread-Topic: Switch vfs.nfsd.issue_delegations to TUNABLE ? Thread-Index: AQHTaEyAfy6q2cCLHkW9s1ZyeaxyRaMpzDeAgAAEfyqAAB1rAIAANPobgABJSsyAAAEe3oAA8S4AgAA7/XuAA3xyQg== Date: Fri, 1 Dec 2017 22:33:25 +0000 Message-ID: References: <20171128114136.10e44d5bcfd563e9b4ab5453@bidouilliste.com> <20171128110428.GN2272@kib.kiev.ua> <20171128142610.6ab535b0b8c6b5d372cd3f27@bidouilliste.com> <20171128134009.GQ2272@kib.kiev.ua> <20171128164132.290bf07218b16164db613242@bidouilliste.com> , <20171129144040.29a10234aa5fb1cfa2611bfc@bidouilliste.com>, 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; YTOPR0101MB2169; 6:lWyj7vkBUH3fXtWJ2TTA2A0tMPfqDRnVXsfaCVLmLmanW8Po/nuQNmLbKqkwa4rUIfF5/rYA2UoIa/cyEEWuhIvmfU2xtBKJuYYK4vIoZhVovuvsnHsSHY5AhITwixcrlWVmDY6Kqi/+DjcdtMXcTFrLN0zVbzwTJWBgxgi9jLZa8p/jldD2wBhi17TBrotJizNbTfYUk9lxsE3BVNbbJpe6e1/3mOy+z7xdSE0vazsjWuVm/ixxvLiSCI5b/ONau6X8lVRl71f6iEXqIa4bFtndnYIvZbMtIgNAftOWwudMCWfvlJt+aQCae30HFmCOU+Vk60YRkkuOpQ4zcViDjEtdWhCCJmjAOjBU9CrCZnE=; 5:F+x51kXHcY9xV3glzJiRiR6KSteVKuhN0rUaz5d90j6/qgYVgKHjEIrQA6pJSzD4aBBzdtftbebxoSY+KN+Wt3d8Oh5hk9NAMXvEDBjjw8mAup7hPCq+oxxmoyllF15cfDUGqO0c/c2bJSRtF1rKWbLhNJ9GV0dcRRlo+0nQDFA=; 24:+QpjuEx4ikiHzJRyWDIDrrbyjCP8+nMc/vN2qkFHf/iIqhF/xxDQCvfgdQtOXGa9R6LfVPcs9EIwGx1o7oiuyIEV2/+hpiwTQ3rwZg1mK/I=; 7:i5hurOlsHVjf2Uc539srOChuTnYNE33YZQcxN6HoItnjcQw17E7SEqDA0nne+RJbvWwzjQ5ZlzYfnFAaO2gX5mGoZwWC4f3GdoT+4bs1BhqdOVGp0K4pXr8EJxmFZQX9Hj1Vh61+JAQIMgkGW0Jjiwbi2X6y20ih9sOgZJ2oDDaoQQTzvSNCDVlvhZwjMhqHVKc3zksAqFByY1yZfADs8J7GU2Wc/jDfQutFK4QeWSZG8Ooyk719ok7OYgu9encd x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 85be4969-18e4-4eb5-c965-08d5390b8933 x-microsoft-antispam: UriScan:(18154293887054); BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(8989060)(201703031133081)(201702281549075)(8990040)(5600026)(4604075)(2017052603286); SRVR:YTOPR0101MB2169; x-ms-traffictypediagnostic: YTOPR0101MB2169: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(75325880899374)(18154293887054); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(3002001)(10201501046)(93006095)(93001095)(6041248)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011); SRVR:YTOPR0101MB2169; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:YTOPR0101MB2169; x-forefront-prvs: 05087F0C24 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(376002)(24454002)(189002)(199003)(102836003)(2906002)(81156014)(39060400002)(99286004)(14454004)(86362001)(101416001)(53546010)(4326008)(478600001)(229853002)(6916009)(8676002)(68736007)(33656002)(106356001)(2950100002)(54356011)(3280700002)(97736004)(81166006)(7696005)(25786009)(105586002)(53936002)(9686003)(6246003)(55016002)(54906003)(316002)(74316002)(786003)(3660700001)(6506006)(5250100002)(74482002)(2900100001)(189998001)(93886005)(305945005)(5660300001)(8936002)(6306002)(76176011)(6436002)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB2169; H:YTOPR0101MB2172.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) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 85be4969-18e4-4eb5-c965-08d5390b8933 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2017 22:33:25.0839 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB2169 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 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, 01 Dec 2017 22:33:28 -0000 I have created D13327 on reviews.freebsd.org with a patch that keeps track of # of issued write delegations and allows nfsrv_checkgetattr() to return without acquiring the lock when it is 0. Hopefully kib@, jhb@ or someone who is familiar with the use of the atomic ops in the kernel can review it. (Where the counter code goes should be fine, but I am not sure I got the use of the atomic ops correct.) Hopefully Emmanuel can test the patch to see if it fixes his performance problem. rick ________________________________________ From: owner-freebsd-current@freebsd.org = on behalf of Rick Macklem Sent: Wednesday, November 29, 2017 12:28:05 PM To: Emmanuel Vadot Cc: Konstantin Belousov; FreeBSD Current; freebsd-fs@freebsd.org Subject: Re: Switch vfs.nfsd.issue_delegations to TUNABLE ? Emmanuel Vadot wrote: [stuff snipped] > I haven't test by I can say that it will work, I actually wondered at >first doing that. The problem with this patch is what I tried to >describe in my first and following mails, since you can turn on and off >delegation you can still have delegation (so nfsrv_delegatecnt > 0) >even if the sysctl is =3D=3D 0. That's why I went to the tunable way, seem= s >cleaner to me as disabling delegation doesn't really disable them for >current client. Yes, if you have delegations enabled and then disable them, there will be delegations issued for a "while". During that time, the code in nfsrv_checkgetattr() does need to check for them. Since no new delegations will be issued, the outstanding ones will go away when the client chooses to return them. (You can force this on the client by doing a dismount/mount, at least for the FreeBSD client.) Alternately, rebooting the server forces the clients to "recover" delegatio= ns and, if they are disabled, that fails. (Actually the recover succeeds, but = with a flag set that tells the client it must return them asap.) All the tunable does is make it impossible to disable them without rebooting, but otherwise the effect is the same. I have a patch that keeps a separate counter for write delegations (which are the ones you care about) using atomics to maintain the value. (That will be similar but somewhat better than what this patch does.= ) rick [lots more snipped] _______________________________________________ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"