From patchwork Tue Sep 11 19:18:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 10596195 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 982AA14BD for ; Tue, 11 Sep 2018 19:18:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9054229BD9 for ; Tue, 11 Sep 2018 19:18:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 849B429D0D; Tue, 11 Sep 2018 19:18:43 +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 2A72429BD9 for ; Tue, 11 Sep 2018 19:18:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13DD28E0003; Tue, 11 Sep 2018 15:18:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 115FE8E0001; Tue, 11 Sep 2018 15:18:38 -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 02BCD8E0003; Tue, 11 Sep 2018 15:18:37 -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 CA7F38E0001 for ; Tue, 11 Sep 2018 15:18:37 -0400 (EDT) Received: by mail-qt0-f200.google.com with SMTP id q26-v6so25770803qtj.14 for ; Tue, 11 Sep 2018 12:18:37 -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=4B/Wm4vURCyVHVLH/q3jpiYPWlPN176DKvy63T1eH4Y=; b=uSivED7rHVk4fmwidsnPwM/ExHEPlmAhkRRa3cZ39a2QR6DhuFY67HZEyiZ9zXKgHI Yaxgohr23LYDu+9DKRenf7BO83aRdr2XF707cjdGCSA6qIKB3Q9HPNdF9NQIPPC2N45/ YXoUWUYs4J7YaalgRdkDpM1+ioODZhVEkbKS3Kpc6ozeXmS6cxDc0NY9sgF2fLyVfXg6 rsIlHl9wujadjSJs8tHJuQLvrjxCFyagjnnOc/rvy2SY+R0GAgZWEE809oIsRBtN3TZ9 p95GLjX9ZA6kRXFFZPYmtlRJLcv6pbu0OYVe75T0+q7Je/R2V81gnRORXQPMm9+6w9+D YfzQ== 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: APzg51Co64gkOwgkALtNZtu9U4ERO8ceiLET0BpS49cHSy9SlbWVzM+S dpYbMN6YiwJd26ype50evmcCZ78YzHg45ONGNs3RlB+YvGjujubzkUGp2Nq2gdVbmbQyV7GkIbC E0rV8QotkIZT8SeCAZh4xzWp9zwEpIbKlmH7ghcJBbHDpfUfSrsj9E7Yo6BHCqZjTVA== X-Received: by 2002:a0c:e792:: with SMTP id x18-v6mr19458518qvn.143.1536693517538; Tue, 11 Sep 2018 12:18:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZWh0DLLo4G3H54/NfI84WfbqFDRzNSwdi5sTyoalqSQAaPRi7Iv5WW6YuL3m+9RaTE79+S X-Received: by 2002:a0c:e792:: with SMTP id x18-v6mr19458493qvn.143.1536693516990; Tue, 11 Sep 2018 12:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536693516; cv=none; d=google.com; s=arc-20160816; b=BNSJ7fTLgHM0KpOok/pW6IsFZ64ili9Fwo1KmI5cj2L4Silm2WbLDjPpDywzUINvBo J8/fCIztcMzB9ZkXTO56WHxIjXX3oU4xNCAy36RK7yerWUlKbl2odNAz5OSVjLksIWDp O071CtcMK085NA67whwNzMN1YAZgLssZCIBhDJ+ZeYTfIMikd3M6NVlf4Zk67bX4ZzJy EflesxG0BmIioBPjFCx/XTxiMG+oR6bStIfnI1m+agCHW31i3qG/QeXChNOqTfo11uIN 9V5VikGyFpfhGBcuI2q8Vvm0fKi1VAQp7QuGK42qo3nH2UMjaa1byqMUn/sURjk0njB+ sx+w== 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=4B/Wm4vURCyVHVLH/q3jpiYPWlPN176DKvy63T1eH4Y=; b=SPGDLrAbCH65qMCU1To6lx0gk+fXDUzjHez6hwkODUvIwFlhjZdoYkk1GWXa+XzgAV 7KIKuiCGzzRg6f3khjEz0caonCL1JD9jygX21uZ5uZsnQBwoe6+ktD6TVTi47T4gIRs2 cHPWht3t+o1Pib+pg5vOWw5LAmqp1aGldivyNOhA4rMQBgsl19NfsUG0D4S+XpybhFI3 sFehMuub+lJhPKQZWcvOWL3PfVqFjws13NUNaP5fhYUpMFfZDnRslsC9GnGHTiqGn97Z 5QDwDAoA3GpKm3ZVDTMqN9HWfgnZ3EQBGG9bOWfzqz4Zt9PDLsi8+o2J14BUGruOEuzv 0QyA== 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 k42-v6si8512915qtf.286.2018.09.11.12.18.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 12:18:36 -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 8DEC74023ECC; Tue, 11 Sep 2018 19:18:36 +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 773B82166BA3; Tue, 11 Sep 2018 19:18:35 +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 2/4] fs: Don't need to put list_lru into its own cacheline Date: Tue, 11 Sep 2018 15:18:24 -0400 Message-Id: <1536693506-11949-3-git-send-email-longman@redhat.com> In-Reply-To: <1536693506-11949-1-git-send-email-longman@redhat.com> References: <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:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 11 Sep 2018 19:18:36 +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;