From patchwork Thu Aug 30 21:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10582911 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 3A8E25A4 for ; Thu, 30 Aug 2018 21:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A9602BE90 for ; Thu, 30 Aug 2018 21:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E3072C24B; Thu, 30 Aug 2018 21:55:30 +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 B41B42BE90 for ; Thu, 30 Aug 2018 21:55:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0CD86B5392; Thu, 30 Aug 2018 17:55:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BBBE56B5393; Thu, 30 Aug 2018 17:55:28 -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 AD4B56B5394; Thu, 30 Aug 2018 17:55:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f200.google.com (mail-qt0-f200.google.com [209.85.216.200]) by kanga.kvack.org (Postfix) with ESMTP id 7F2E56B5392 for ; Thu, 30 Aug 2018 17:55:28 -0400 (EDT) Received: by mail-qt0-f200.google.com with SMTP id j9-v6so10368143qtn.22 for ; Thu, 30 Aug 2018 14:55:28 -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=27qSdB4R+5fj6ojbKn5UX+txRAsw3HNL5gHuIPJBDu4=; b=bE39q4VNWrJFzOMKARy351c26jq4qL16nTWJ5cKVcBzRi4H7D/LNKpueIMaRWOXPqr dsmecYut4CU4teRNiAq/6+QACLQ3Gm2tteDl4iEEFeK0Z//Fda76luP/j36W5/S9b7sV s7/5ZQHuV2/eZfx6hThXR24XIgCOqibq9UoG5SXwVgUwgRfbUGzcnQa59At40m63tCF7 1dEQi56iQ7AoquqFP0YR6O8tGh4q4+UYUoEfiudglRk3FJmfMCniSQKOLgKYcW92s529 8itGHFcB0Vkwdbr/6CGvDmlu3Qb4WOYPeI9VJRUWDYA940B0TTRoF1q3Rb3eSZYETlp3 7Qhw== 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: APzg51DqbYn3Av8VQCY3Ggyv9CZG6DucDA6tW8STYkTWudoKogrX+eVA tBf3ydoVRYIPAeACEQEWsYtGg2yTKBQe1IeXcHG465H8lTS3zB86zBz1mMdKl3LGcbImJgMmCn8 lAhMooj8ZSbggsO8g4UU3MViW21ND3rtQYqNPWRBGHRcJqf0d6Hk+G8P1wNnBH3Ex3g== X-Received: by 2002:a37:9d0c:: with SMTP id g12-v6mr13116870qke.230.1535666128301; Thu, 30 Aug 2018 14:55:28 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb2bH7aCh6h7stzamHLbfj9Kgxit/qVzi+bZcCjWAJNYqE+oQ/LPjbPYc/awvLM2qo1Q07R X-Received: by 2002:a37:9d0c:: with SMTP id g12-v6mr13116846qke.230.1535666127665; Thu, 30 Aug 2018 14:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535666127; cv=none; d=google.com; s=arc-20160816; b=XjGQOG0YzEIO1klcmpkPf1U/5thpPXp0RefiBD6f0edkGGK2JXtAu1y6XuJW4pTLG8 k8KIOP+z0cgZsAdUZGeKF+9p8kqsqTKcTY3ZkOZrIlrIAqL8iZCZ9KjcSuhtM5NJ1J5u puV4ONiZewx6RyIwdMnNF9J+s5I03OgSfPzrnMUk1bnrZKxu+IjmLRF1kcA5MeooEzYq kbvizD1MOfFR9kge7/n61wO66G7+Fb2dGSLxRemfiw2yX+9K6WmJXgfYn0zGEG+IlzAJ Yksxd6WovUdtryBll8cEibLns/NU2Wy+iANxqjsGdMpg9E9QsSoD0Cfq2F4elVnYACi5 BKZg== 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:arc-authentication-results; bh=27qSdB4R+5fj6ojbKn5UX+txRAsw3HNL5gHuIPJBDu4=; b=Qnx4VnrPVWDigucyJ4zVQVIeDAzU70nPCQvN096nAVz4yKtAt7ZulI5bUZAdsCmxer gjGhR5qjwhzxpR0GruSbYvJEA21ShTmk3a2pNZO/YZXikL9phfbJKjNWCf1AN/HWOWk2 FK2kjZ8oJGmj9j0KRBE56DHK5ASDAOzXtIC3JtyDxOgUOWRjucMAL5aKz8rMVuBozFEB jxL8pBbhp7pUobCzN36/wMfKVxXLj86Vn6W5C1nTPpc3qBNwPUMWDL8h909XF+nOD/bR EP/MbaklW7ddmwVnfKiNyVu8Dpi8mHFpi7Hqb0/yrJK2zpSddp0IAMhRofLOnWrNqqW/ 0k4w== 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 y24-v6si3319412qve.2.2018.08.30.14.55.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 14:55:27 -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 2BA4180A0CDE; Thu, 30 Aug 2018 21:55:27 +0000 (UTC) Received: from llong.com (dhcp-17-8.bos.redhat.com [10.18.17.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id A66A02166B41; Thu, 30 Aug 2018 21:55:24 +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 v2 0/4] fs/dcache: Track # of negative dentries Date: Thu, 30 Aug 2018 17:55:03 -0400 Message-Id: <1535666107-25699-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.8]); Thu, 30 Aug 2018 21:55:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 30 Aug 2018 21:55:27 +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 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 | 22 +++++++++++------- fs/dcache.c | 54 ++++++++++++++++++++++++++++++++++++++++----- include/linux/dcache.h | 5 +++-- include/linux/fs.h | 9 ++++---- kernel/sysctl.c | 2 +- 5 files changed, 72 insertions(+), 20 deletions(-)