From owner-freebsd-net@freebsd.org Mon Apr 16 13:20:42 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5797CF82808 for ; Mon, 16 Apr 2018 13:20:42 +0000 (UTC) (envelope-from niels@kobschaetzki.net) Received: from hatchetman.psychedelicpirate.com (unknown [IPv6:2001:1560:a000:2:49bf:3916:e713:6ddd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C33DE7D42B for ; Mon, 16 Apr 2018 13:20:41 +0000 (UTC) (envelope-from niels@kobschaetzki.net) Received: from hatchetman.psychedelicpirate.com (localhost [127.0.0.1]) by hatchetman.psychedelicpirate.com (OpenSMTPD) with ESMTP id 7d50f145; Mon, 16 Apr 2018 15:20:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=kobschaetzki.net; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=WhD0kE+Fo9LenJ7hIyDoQ2Ge1fg=; b=e0LCmutFBrenb3sYit 9cQ710c33sC3V1D0E5SOEEl8TSibAcgGXqc1kXPDaUO65qh8pRm3MXsOwVCpV/+t W9Q3f/E8Bc303NsqMXettGOJFIjiFuX2dB77Gr1p/D588WEvdHBbzujzpAp9stCM C+Dfd5rnFwM619DKPt7HXa+B4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=kobschaetzki.net; h=subject :to:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; q=dns; s=selector1; b=U fQbtcs3LPItlsIBgB/Xij8wvbF4kb3kCGZvLvYWHp7lbm52u5Qpy5Q1FCUDEO1pb iyhNQHtZWVR1BKYypS82VCMjwox/aOn2RvbIyvyNZbbh5bwnyJk3zzf53aTmd4ao j6dnr0Hi2e5TBafPkp7K1laOI9ETc3jDyl8NKNSmlE= Received: from hatchetman.psychedelicpirate.com (localhost [127.0.0.1]) by hatchetman.psychedelicpirate.com (OpenSMTPD) with ESMTP id c21c31da; Mon, 16 Apr 2018 15:20:33 +0200 (CEST) Received: from [213.73.110.159] (sam.InterDotNet.de [213.73.110.159]) by mail.kobschaetzki.net (OpenSMTPD) with ESMTPSA id dfe2f83c (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Mon, 16 Apr 2018 15:20:32 +0200 (CEST) Subject: Re: High rate of NFS cache misses after upgrading from 10.3-prerelease to 11.1-release To: Rick Macklem , "freebsd-net@freebsd.org" References: From: Niels Kobschaetzki Message-ID: Date: Mon, 16 Apr 2018 15:20:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 13:20:42 -0000 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