Date: Fri, 1 Dec 2017 22:33:25 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Emmanuel Vadot <manu@bidouilliste.com> Cc: Konstantin Belousov <kostikbel@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org>, "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>, John Baldwin <jhb@freebsd.org> Subject: Re: Switch vfs.nfsd.issue_delegations to TUNABLE ? Message-ID: <YTOPR0101MB21725833F06CD189CAC6CCA5DD390@YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <YTXPR0101MB217489EADB0945CFCD608E73DD3B0@YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM> References: <20171128114136.10e44d5bcfd563e9b4ab5453@bidouilliste.com> <20171128110428.GN2272@kib.kiev.ua> <20171128142610.6ab535b0b8c6b5d372cd3f27@bidouilliste.com> <20171128134009.GQ2272@kib.kiev.ua> <YTOPR0101MB2172BE15A55BCA881F805AE6DD3A0@YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM> <20171128164132.290bf07218b16164db613242@bidouilliste.com> <YTOPR0101MB217255A72DD5E8555DF001E9DD3A0@YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM> <YTOPR0101MB217218369849273146801292DD3A0@YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM> <YTOPR0101MB21721E82EF605249D38064A1DD3A0@YTOPR0101MB2172.CANPRD01.PROD.OUTLOOK.COM>, <20171129144040.29a10234aa5fb1cfa2611bfc@bidouilliste.com>, <YTXPR0101MB217489EADB0945CFCD608E73DD3B0@YTXPR0101MB2174.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <owner-freebsd-current@freebsd.org>= on behalf of Rick Macklem <rmacklem@uoguelph.ca> 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTOPR0101MB21725833F06CD189CAC6CCA5DD390>