From patchwork Wed Sep 12 17:35:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10598107 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 B785715E2 for ; Wed, 12 Sep 2018 17:36:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A21DB2A7A7 for ; Wed, 12 Sep 2018 17:36:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C182A8AB; Wed, 12 Sep 2018 17:36:02 +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 31DF32A8D3 for ; Wed, 12 Sep 2018 17:36:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 19C8E8E0001; Wed, 12 Sep 2018 13:35:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0FBE68E0009; Wed, 12 Sep 2018 13:35:57 -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 E93328E0001; Wed, 12 Sep 2018 13:35:56 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id B676D8E0009 for ; Wed, 12 Sep 2018 13:35:56 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id e14-v6so2183410qtp.17 for ; Wed, 12 Sep 2018 10:35:56 -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:in-reply-to:references; bh=NG4GK7MEm4zVLJkpH5dLwetfVkqOQybKF9VPBRgpUfM=; b=pkpFDcE0GrNhSwgSzGA6iGgfuRntDNhF1mPM+dRUFoowqOqjDmYdt4HRdOXrthUw7V DVbLBN2m4UCgTOOGifDCnpDYP1l8OXHae//SQmoqNJAkxQgv+pNB3YLDjS894eoaHtpR SP4jSED3SyFB2jc8jHZyI1/luHJWvH3fbaN6Tm3ZivVP0aUMHvjhRAGfihwHQ7m+KXCH e9y4NV0M8GfGzkE358V26AUzbRtBHUeoqvRLkI5fsLjpm8TgndrljMGczS97jsgdePLE UMeBIy7X2cd/z99lkr+Dg7RjGhnruEkaa9/0rFZzR8h1d34BqKm02vis6Nc5hkAN5Ghx KeSg== 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: APzg51C64Wr7f38gR4Yo+mSMhCQBF92cTgSq+8p5iZXY6GvhDVAsxhd6 quLlw4WiTedwbr6ue644t80LFSNcegdzsm+VtAS4vojlQOVg3WqS+1oExwKk5F+QGd92oqBXfML no8F7f34z5kl5ZFjBT7rSrvQrP74GDMhKbwY1EsPtut0/rIbvwy2K8ScWWO/tikYtOQ== X-Received: by 2002:ac8:4691:: with SMTP id g17-v6mr2411842qto.137.1536773756538; Wed, 12 Sep 2018 10:35:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbTss50Cvo0gbhsh9dK8TXVndGkQQrKcY9+OyoSaWghoaRzVudtyLtobjSBhiRnV7cRcgCZ X-Received: by 2002:ac8:4691:: with SMTP id g17-v6mr2411784qto.137.1536773755665; Wed, 12 Sep 2018 10:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536773755; cv=none; d=google.com; s=arc-20160816; b=aIsQnmwpGg3TJ+qf2YNsjomczDLVCRxaCVcn1MQy+VQn7XvH9gQTPHje1aX4IejRwY yRez1btQwH+pbY0bS7XL14Mhaq3DVRNpFlFzH+xrVRd4zNl9JoOnIzADvbUghqjXBxyy FQpG7jgerclYWre7Y5OUCOviIJQhChVL66ceLETSjf1KuixhqiGdD6XLryPi7jSUOzkC VaKaJqkEMSnVHLu2vfOO/vOk7Tf45nhamO60aEG97450ywoPns3R8PII5lTxjcOZZZ0M kB6xlcRSVNVgK0Y7uDt0BC3/bwpb1YhbJTuRDWRU1lwSnQXXowKdgwp+rLPITMrEPo3U gS9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=NG4GK7MEm4zVLJkpH5dLwetfVkqOQybKF9VPBRgpUfM=; b=F9tWOw8iaR8FgV0OSFyb8BAw1J85mNvsp4PglzUbI+EBo39mTzypHnCCERyC3o95bB GWnLA9jfMxC1ss9yazH9NC/9dvifnGORnjknt1w3UxJDSrGX5tVQzjmyVfNjD37+yz5p /0Xx3EmoSQP2w/8C7c2DBHKelyfeBuRBFyaQBtwvkfKaE9eTtzl0jaf1VCtzYyB0FGb3 vo5pjngoEEKjSKJoPHyZdhxMXL+CrJura98cTU13bTGy1LKMd9zAV6CMJqh5roswO8ac Zt7NHS5G1fSaalEIfqkXacoCrSr2eGh04HS5E/Q7QBKzXETlvT3kbnybtBGxKlPf96FU 29Uw== 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 z30-v6si1194578qve.249.2018.09.12.10.35.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 10:35:55 -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 0E2B0804B4DB; Wed, 12 Sep 2018 17:35:55 +0000 (UTC) Received: from llong.com (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 78F742156899; Wed, 12 Sep 2018 17:35:54 +0000 (UTC) From: Waiman Long To: Alexander Viro , Jonathan Corbet , Andrew Morton 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" , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , James Bottomley , "Wangkai (Kevin C)" , Michal Hocko , Waiman Long Subject: [PATCH v4 2/3] fs: Don't need to put list_lru into its own cacheline Date: Wed, 12 Sep 2018 13:35:41 -0400 Message-Id: <1536773742-32687-3-git-send-email-longman@redhat.com> In-Reply-To: <1536773742-32687-1-git-send-email-longman@redhat.com> References: <1536773742-32687-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]); Wed, 12 Sep 2018 17:35:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 12 Sep 2018 17:35:55 +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 The list_lru structure is essentially just a pointer to a table of per-node LRU lists. Even if CONFIG_MEMCG_KMEM is defined, the list field is just used for LRU list registration and shrinker_id is set at initialization. Those fields won't need to be touched that often. So there is no point to make the list_lru structures to sit in their own cachelines. Signed-off-by: Waiman Long Reviewed-by: Dave Chinner --- include/linux/fs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 3332270..fd4cd8a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1443,11 +1443,12 @@ struct super_block { struct user_namespace *s_user_ns; /* - * Keep the lru lists last in the structure so they always sit on their - * own individual cachelines. + * The list_lru structure is essentially just a pointer to a table + * of per-node lru lists, each of which has its own spinlock. + * There is no need to put them into separate cachelines. */ - struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; - struct list_lru s_inode_lru ____cacheline_aligned_in_smp; + struct list_lru s_dentry_lru; + struct list_lru s_inode_lru; struct rcu_head rcu; struct work_struct destroy_work;