From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 28 22:46:41 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE8610656A6 for ; Fri, 28 Jan 2011 22:46:41 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id B15A38FC23 for ; Fri, 28 Jan 2011 22:46:40 +0000 (UTC) Received: by qwj9 with SMTP id 9so3791837qwj.13 for ; Fri, 28 Jan 2011 14:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=XroTaRrO0JKhNBQeexwtf3O6PVo0t0+1l+pmCU7d9qg=; b=c8nUuRS9KMQ9L5wLBl4DNAqinzVLWDOzWIGvO5OYefq0u14P3OuCPi2ZQVBKeFJ0Ly Geid4pPdq/4J6F/RVQ1Rw/SCXWQkeDyji6lwrs+BW+43jszpGVv1EiXxkJYibGmJYcFN Og2JpjOWjD2t2I3VeSWrmGGGX4v29MsU7AGyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=toI6Qc4nefF+CeCuVD4X0zMWxIbEuIBPTXmpeMjQR70CjqlgW7JB75S0v2Fu3uj+6S Hiw4zQ3LsirqEHF4lYaC+iWk9YlhatPj9igRszq1dr3w2OUtRA7EwvF9EoBly7tRxBJk h2UKqLO8h1iv+E9bfKgHxuFjD0EaMA3gOaPWw= Received: by 10.229.235.4 with SMTP id ke4mr3281972qcb.63.1296254799808; Fri, 28 Jan 2011 14:46:39 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.67.2 with HTTP; Fri, 28 Jan 2011 14:45:59 -0800 (PST) In-Reply-To: <20110128223703.GA91590@tops.skynet.lt> References: <20110128152505.GP75125@dan.emsphone.com> <20110128211834.GA84881@tops.skynet.lt> <20110128223703.GA91590@tops.skynet.lt> From: Ivan Voras Date: Fri, 28 Jan 2011 23:45:59 +0100 X-Google-Sender-Auth: mgGpk7GmGWTBibmhA-vSLB79jP4 Message-ID: To: Gleb Kurtsou Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Dan Nelson Subject: Re: Namecache lock contention? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 22:46:41 -0000 On 28 January 2011 23:37, Gleb Kurtsou wrote: >> * The dtrace output I've send is from around thirty seconds of >> operation, so around 2000 PHP runs. (PHP in this case is FastCGI, so >> the processes are persistent instead of constantly respawning). In >> these 2000 runs there have been around 20,000 rw-block events in >> cache_lookup - which is strange. > Are there rename, rmdir calls? - these purge namecache. > If cache is empty, VOP_LOOKUP acquires write lock to populate the cache. No, only creates and deletes on files, no directory operations at all. >> * Here's another dtrace output without rwlock mutex inlining, showing >> a different picture than what I've earlier thought: most rw-blocks >> events are in wlock! http://ivoras.net/stuff/rw-block-noinline.txt =C2= =A0-- >> there are also some blocks without a rwlock function in the trace; I >> don't understand how rwlock inlining is implemented, maybe the readers >> are always inlined? > Add options RWLOCK_NOINLINE, recompiling with -O0 might also be good > idea. That's what I meant by "without rwlock mutex inlining". The default -O2 is enough - aggressive inlining only begins at -O3.