Date: Mon, 16 Apr 2018 15:20:32 +0200 From: Niels Kobschaetzki <niels@kobschaetzki.net> To: Rick Macklem <rmacklem@uoguelph.ca>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: High rate of NFS cache misses after upgrading from 10.3-prerelease to 11.1-release Message-ID: <a2c63a00-d672-e626-127b-ba0a350371e1@kobschaetzki.net> In-Reply-To: <YQBPR0101MB1042D2F0CE2575EB4F17588ADDB20@YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM> References: <ce3712c0-626e-c8f2-3bba-933cf359bcef@kobschaetzki.net> <YQBPR0101MB1042D2F0CE2575EB4F17588ADDB20@YQBPR0101MB1042.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
On 04/14/2018 03:49 AM, Rick Macklem wrote: > If you go into ncl_getattrcache() {it's in sys/fs/nfsclient/nfs_clsubs.c} > and add a printf() for "time_second" and "np->n_mtime.tv_sec" near the > top, where it calculates "timeo" from it. > Running this hacked kernel might show you if either of these fields is bogus. > (You could then printf() "timeo" and "np->n_attrtimeo" just before the "if" > clause that increments "attrcache_misses", which is where the cache misses > happen to see why it is missing the cache.) > If you could do this for the 10.3 kernel as well, this might indicate why the > miss rate has increased? I just checked the code to see if I can figure out where exactly I have to put the printf(). And then I saw that there are ifdefs for NFS_ACDEBUG which seems to be a kernel option. When I add NFS_ACDEBUG in the config-file for the kernel, the build fails with an /usr/src/sys/amd64/conf/ACDEBUG: unknown option "NFS_ACDEBUG" I looked in sysctl.h and there it isn't defined. Do I do something wrong or did this sysctl-tunable got lost at some point in time? Can I just use this code by removing the ifdef for getting information? Sorry, my C is not really existent, thus I have to ask :/ The parts (except the part that looks at the sysctl looks like this): #ifdef NFS_ACDEBUG if (nfs_acdebug>1) printf("ncl_getattrcache: initial timeo = %d\n", timeo); #endif …… #ifdef NFS_ACDEBUG if (nfs_acdebug > 2) printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n", nmp->nm_acregmin, nmp->nm_acregmax, nmp->nm_acdirmin, nmp->nm_acdirmax); if (nfs_acdebug) printf("ncl_getattrcache: age = %d; final timeo = %d\n", (time_second - np->n_attrstamp), timeo); #endif I would remove the ifdefs and the "if (nfs_acdebug …)" Niels
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a2c63a00-d672-e626-127b-ba0a350371e1>