From patchwork Tue Sep 11 19:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10596193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B0F914F9 for ; Tue, 11 Sep 2018 19:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 446C429BD9 for ; Tue, 11 Sep 2018 19:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3810429D0A; Tue, 11 Sep 2018 19:18:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E96E829D0D for ; Tue, 11 Sep 2018 19:18:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9DB18E0004; Tue, 11 Sep 2018 15:18:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B4D7D8E0001; Tue, 11 Sep 2018 15:18:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A14B18E0003; Tue, 11 Sep 2018 15:18:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 789E78E0001 for ; Tue, 11 Sep 2018 15:18:36 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id q3-v6so21949864qki.4 for ; Tue, 11 Sep 2018 12:18:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=xQvh/a21GAzVAEGujjDeSAmQu3L5ezjmx+sT7Uq9HmY=; b=TTsJZxY6V84bBGASrWa91dhRPsXhXATrcpZaNupyHJ6gA0OOeCpBZ/kQlTICzhJ405 MRytyPr+K/xXQOhmBNAO0B9j6FzPhjgoXA22vS4UDTo4AGGVF4JVygNzrYpzTC8gseRv i+LkCCEP95hmUJeDWCTu3i94Zaio5p5/tfr+6Njxpjmu6m8F9S82aga/NLcCxLUcYLJI otQSGgGOWmM1u623MGq+BhEm6JsxHJU7FE+tsGsBBTUu9H4QIIce5OdamTUhhdIc2pef VI/qWuuvlO5oZebSMCoyJPANfwXKUldJ+qOzGeL/JRBgdj08E4F/aOhJ+G1yruNOG8WR KoXQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: APzg51Boed5fgx77y59GTlj+keCbYM6HG3IOdkAQhKNOVIUTDg+plmOM 1JZrK2VP+E1fNKNOQAG9RM3//NXDu2aM57T3Y+sMGdCnUJRSOxaKa03kJV8lcJ3QMusuKtuPa8l oDD7Dllav/hKVhN6Qrk5KlHbgV7zVdfDkX5jgr3NhfI98dr5vtmMPgoPbPzAYDp5N2w== X-Received: by 2002:a0c:e94e:: with SMTP id n14-v6mr19601168qvo.187.1536693516188; Tue, 11 Sep 2018 12:18:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaiJB7zQnwAkavTYQCRpQK+OMwgvkncz89gy7Zs0TGyaXRR7WSq8Pvi488g8QNFcEm9vpmP X-Received: by 2002:a0c:e94e:: with SMTP id n14-v6mr19601106qvo.187.1536693514791; Tue, 11 Sep 2018 12:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536693514; cv=none; d=google.com; s=arc-20160816; b=bNgV/yAdV9NATwuUGpEnURbV56p3NKQ/17qzYmpp4CtnMbLCcrg6e0jEBEbDhdMOm3 oQILmfEhesP336R8/3pAhBCEtbirdOmvNfB2/VRcGELx9VuKjzgvR2Oi/TaUQZmDT/pz 58CogbfJQjRtOsGC7S6DU5oDoRImglPwA/4WwRIa/ferokXsm7P7nEXjXY92QKKPB3Lf 0BCBkK0b2eyD1HXIN6W5XDFhPs/bRHr2msgEqUfD9S41zdSTUUbNcn5qr2jGz23hgGHp Y+klltvYTf9BJVyjQPl/gkC6/20sFMTUvIBR+RaJdNcz3Q/5xUS49FB6Q9KgMpogjnvm IvwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=xQvh/a21GAzVAEGujjDeSAmQu3L5ezjmx+sT7Uq9HmY=; b=BtXNYTWG1f4+z9s8xCQ4oTw9a1gdbHvxs8vlvFTiDwAe27Xwd+tkzUAtclFcFpJV+K 0lwRxxEPqfrulHus/aWrPhWsbkJl5KLcTBY3BfTgebM5nwcZoFauSLAfsa2fHmMxKhVE GcbP9/7HZT3Q3m7klOPdAusStKdbLbMs1agDI+6+w3vz+VU6uAyiR2B/U+XSUltM52qh YlJGPxYYQAOHg7X2rYCUPESYqpabBcp/8SllnvrjHmpllKoGUZdz9p+KtkOxXAWVPGcf HZN3NnDIIjUZBQc12LxZHdHin/uD1TwXISBwAT4Syw1o5HrPKSloNsN4u+7zvJ+t5Rki Hi5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id 97-v6si6142473qva.253.2018.09.11.12.18.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 12:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of longman@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of longman@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 398754023ECB; Tue, 11 Sep 2018 19:18:34 +0000 (UTC) Received: from llong.com (ovpn-123-172.rdu2.redhat.com [10.10.123.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE3EE2166BA3; Tue, 11 Sep 2018 19:18:30 +0000 (UTC) From: Waiman Long To: Alexander Viro , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, "Luis R. Rodriguez" , Kees Cook , Linus Torvalds , Jan Kara , "Paul E. McKenney" , Andrew Morton , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , James Bottomley , "Wangkai (Kevin C)" , Michal Hocko , Waiman Long Subject: [PATCH v3 0/4] fs/dcache: Track # of negative dentries Date: Tue, 11 Sep 2018 15:18:22 -0400 Message-Id: <1536693506-11949-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 11 Sep 2018 19:18:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 11 Sep 2018 19:18:34 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP v2->v3: - With confirmation that the dummy array in dentry_stat structure was never a replacement of a previously used field, patch 3 is now reverted back to use one of dummy field as the negative dentry count instead of adding a new field. v1->v2: - Clarify what the new nr_dentry_negative per-cpu counter is tracking and open-code the increment and decrement as suggested by Dave Chinner. - Append the new nr_dentry_negative count as the 7th element of dentry-state instead of replacing one of the dummy entries. - Remove patch "fs/dcache: Make negative dentries easier to be reclaimed" for now as I need more time to think about what to do with it. - Add 2 more patches to address issues found while reviewing the dentry code. - Add another patch to change the conditional branch of nr_dentry_negative accounting to conditional move so as to reduce the performance impact of the accounting code. This patchset addresses 2 issues found in the dentry code and adds a new nr_dentry_negative per-cpu counter to track the total number of negative dentries in all the LRU lists. Patch 1 fixes a bug in the accounting of nr_dentry_unused in shrink_dcache_sb(). Patch 2 removes the ____cacheline_aligned_in_smp tag from super_block LRU lists. Patch 3 adds the new nr_dentry_negative per-cpu counter. Patch 4 removes conditional branches in nr_dentry_negative accounting code. Various filesystem related tests were run and no statistically significant changes in performance was observed. Waiman Long (4): fs/dcache: Fix incorrect nr_dentry_unused accounting in shrink_dcache_sb() fs: Don't need to put list_lru into its own cacheline fs/dcache: Track & report number of negative dentries fs/dcache: Eliminate branches in nr_dentry_negative accounting Documentation/sysctl/fs.txt | 26 +++++++++++++--------- fs/dcache.c | 54 ++++++++++++++++++++++++++++++++++++++++----- include/linux/dcache.h | 7 +++--- include/linux/fs.h | 9 ++++---- 4 files changed, 74 insertions(+), 22 deletions(-)