Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4554874yba; Sun, 19 May 2019 22:47:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYUkPNsayygKyTk+y8qK9mmbYh8Ur7zqF/gg7bynuyaZEluuxE5o4I2YR/ThRaJndJNeXQ X-Received: by 2002:a17:902:163:: with SMTP id 90mr74809410plb.212.1558331234114; Sun, 19 May 2019 22:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558331234; cv=none; d=google.com; s=arc-20160816; b=ZvB4BhhWNn6pQD3LqyAzEVjROVfNNWxHkYCu/m9KL3d3EqT0Hd3ojLC/7mv+JUDwfI 4Q0iIMyCOBaNJYFGE79yYF4+z0f+MIUKB2Fso8NtZ+a2fvoduTfsEofAAwef+j+BOnj5 hwKbNZ9ryXhZTsOj4ushgb2nF+KfNXZsOo6izWd9IZoQSkASnpRyyuvkkjXf8tceg7qt QOB4D+KsIVRU3oB4R1jiqxI5HDogkLxrryI2sk5w62p0chk2AnFI03VUigGbx0DjsHgO 2pljXapQe764hrbls+MChBWGR3Wo7o5MuKkDSDFCKxzR1RAhjq75gDxVZHG30Q2N4dgP Pdfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BWgf9mQL60frF07ii2U3Yx/gnin3umDFroib+xOOshw=; b=bsvCc7osokYy5A3Je7SURBUPIGGmpafSWkmvcYTouIgLo09hCbEyirDPSJ/+CJEbqG Ai3zSmRlCwDznSwf0/NCpuo+z8fYPVs3+YzC5FWM22zjgxKlbOGFyJ1Mm9VrbCnU2kmC W6bL3NCHQ8yw1Zcjfp4HEshq3Gkpn5JPVm9/wxKqYXc5fuo17AllJhfmmBbN98wBQ3e8 I0fvj0ys2gq/CpWUoPA1TIlIgqwZRPP4k3ckykNq4V670lktBtX9BWjfBm+AFMUVEUVD wK/I3tmKrPKaKqhL4Q6RCObtOVr6Q81sAGSt5Xrkg3faOjGP6j6Uxtg7bFN7PbLknd9/ MvHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LhKqHj9w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si16652869pga.514.2019.05.19.22.46.59; Sun, 19 May 2019 22:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LhKqHj9w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730492AbfETFnI (ORCPT + 99 others); Mon, 20 May 2019 01:43:08 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:46491 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfETFnI (ORCPT ); Mon, 20 May 2019 01:43:08 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id BB657115CB; Mon, 20 May 2019 01:43:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 20 May 2019 01:43:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=BWgf9mQL60frF07ii2U3Yx/gnin3umDFroib+xOOshw=; b=LhKqHj9w zvjIxq0G2O5k2GycyyiBsamzi2rk2+Lf+YY+F5xR7uqTFhkUs01LFET99pHIduQs zOM4rZdOSvJ/+z966a1bZjVfEqSxqIESB2sj2qYi/MyuhQjzu91wrVGuA9y2tEt/ krfRq77gRiJ8tckBxpUTJnqfd3NJOGBYPJN2U39hcDUUkSJSWZSjJ0xSt1+Ea1O1 +jt7qGo8NnY9WOhtrB/Q8GgsmaFNzTIQ9zSeGHSaxKOlKiD0s5oDmFpMAD46hK7W JEhgU6aa+NeSITEQ9r1zxvFsz532rqKkHToJnh6sHAdJRobsuaRB9jd+5RQ66NuX WpprC/lEu1nFAw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtjedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepfdfvohgs ihhnucevrdcujfgrrhguihhnghdfuceothhosghinheskhgvrhhnvghlrdhorhhgqeenuc fkphepuddvgedrudeiledrudehiedrvddtfeenucfrrghrrghmpehmrghilhhfrhhomhep thhosghinheskhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgepudeh X-ME-Proxy: Received: from eros.localdomain (124-169-156-203.dyn.iinet.net.au [124.169.156.203]) by mail.messagingengine.com (Postfix) with ESMTPA id 3664D80060; Mon, 20 May 2019 01:42:58 -0400 (EDT) From: "Tobin C. Harding" To: Andrew Morton , Matthew Wilcox Cc: "Tobin C. Harding" , Roman Gushchin , Alexander Viro , Christoph Hellwig , Pekka Enberg , David Rientjes , Joonsoo Kim , Christopher Lameter , Miklos Szeredi , Andreas Dilger , Waiman Long , Tycho Andersen , Theodore Ts'o , Andi Kleen , David Chinner , Nick Piggin , Rik van Riel , Hugh Dickins , Jonathan Corbet , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v5 16/16] dcache: Add CONFIG_DCACHE_SMO Date: Mon, 20 May 2019 15:40:17 +1000 Message-Id: <20190520054017.32299-17-tobin@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520054017.32299-1-tobin@kernel.org> References: <20190520054017.32299-1-tobin@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In an attempt to make the SMO patchset as non-invasive as possible add a config option CONFIG_DCACHE_SMO (under "Memory Management options") for enabling SMO for the DCACHE. Whithout this option dcache constructor is used but no other code is built in, with this option enabled slab mobility is enabled and the isolate/migrate functions are built in. Add CONFIG_DCACHE_SMO to guard the partial shrinking of the dcache via Slab Movable Objects infrastructure. Signed-off-by: Tobin C. Harding --- fs/dcache.c | 4 ++++ mm/Kconfig | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c index 0dfe580c2d42..96063e872366 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3072,6 +3072,7 @@ void d_tmpfile(struct dentry *dentry, struct inode *inode) } EXPORT_SYMBOL(d_tmpfile); +#ifdef CONFIG_DCACHE_SMO /* * d_isolate() - Dentry isolation callback function. * @s: The dentry cache. @@ -3144,6 +3145,7 @@ static void d_partial_shrink(struct kmem_cache *s, void **_unused, int __unused, kfree(private); } +#endif /* CONFIG_DCACHE_SMO */ static __initdata unsigned long dhash_entries; static int __init set_dhash_entries(char *str) @@ -3190,7 +3192,9 @@ static void __init dcache_init(void) sizeof_field(struct dentry, d_iname), dcache_ctor); +#ifdef CONFIG_DCACHE_SMO kmem_cache_setup_mobility(dentry_cache, d_isolate, d_partial_shrink); +#endif /* Hash may have been set up in dcache_init_early */ if (!hashdist) diff --git a/mm/Kconfig b/mm/Kconfig index aa8d60e69a01..7dcea76e5ecc 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -265,6 +265,13 @@ config SMO_NODE help On NUMA systems enable moving objects to and from a specified node. +config DCACHE_SMO + bool "Enable Slab Movable Objects for the dcache" + depends on SLUB + help + Under memory pressure we can try to free dentry slab cache objects from + the partial slab list if this is enabled. + config PHYS_ADDR_T_64BIT def_bool 64BIT -- 2.21.0