From patchwork Mon May 20 05:40:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tobin C. Harding" X-Patchwork-Id: 10949949 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 3D8D51390 for ; Mon, 20 May 2019 05:43:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D8722864A for ; Mon, 20 May 2019 05:43:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 214C32864E; Mon, 20 May 2019 05:43:10 +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,DKIM_SIGNED, DKIM_VALID,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 9DD7B2862A for ; Mon, 20 May 2019 05:43:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F3556B0274; Mon, 20 May 2019 01:43:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7A3C56B0275; Mon, 20 May 2019 01:43:08 -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 6B9756B0276; Mon, 20 May 2019 01:43:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 4D30D6B0274 for ; Mon, 20 May 2019 01:43:08 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id q32so13217442qtk.10 for ; Sun, 19 May 2019 22:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BWgf9mQL60frF07ii2U3Yx/gnin3umDFroib+xOOshw=; b=t4IqVD2JOJWfgEmS6HWhyoJcq6E0ok2NNvR/ndyNSFQKLVgnooHnC4KbSXO6DPBn2s 7disMB4OziPmjRK0h6ljoHUtwOYlzJodXkOgKacRHYSR2kXUZwj8sxb9FRmGAMUYB70q TzrFnnNtoz+MHRhyc9Aw+ITk6t4NjhLgyGQ/FlHEd1AVSeW0irlq/XWl/Tf0x8Ixgcxc UyjiTJ0Xr0ecEEXnKTFqaGiojfG4J3JqBlpy4YiTSFOYyTWot8iQum1WibP3QXIxgcoF Jq68AvXFkzslFywWeWQ8y4B3ls8IhOaDcVUBpwFJ91xyDTGDd2rA0rVZN0sI9c1Fhvzq TfCg== X-Gm-Message-State: APjAAAUKBdl8Jm00ZNpZcIJhgLVg4jzwAMie3WZGj/XedeEsO4CGOd1+ vP7A9g1cSyHg4ZYWdOMz/0B/efAyxykSn1wuGL8maCe9ISv0msAzDFfyxSBU/VgYY0evitp2Dfg IMoK9sLcZ9G+otd0+4qGfy7vjh8Ag3FeCs94Ts+/eId4iRY03vxMOcYI10YkLEoU= X-Received: by 2002:a37:b4c6:: with SMTP id d189mr57411648qkf.173.1558330988002; Sun, 19 May 2019 22:43:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwis8az85ijfJiecv/3cPCPGNUqV20X2uAqfUskYqXoMeTNK+vV+OTr+blh5Qd4zA0uAtaH X-Received: by 2002:a37:b4c6:: with SMTP id d189mr57411605qkf.173.1558330987036; Sun, 19 May 2019 22:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558330987; cv=none; d=google.com; s=arc-20160816; b=jOs4Nkn2wapHZ3Qxr6+vdOmIKu8XD+VKA17Nbb7pV/zM1PfZwjE5YII8UjRRII6x0h x/Tcg0UprCiVNuTGc/kh9OKPP2N/e04bwEPzlGQU+IqhUGevbovqRCWFSCz5ZhdGSxev u8RF9xtjeaBLJ3LAz2iN7Bk7HJryde+3PazebRwbMPpFtUzMTh3Vgwnf2ERAqnA6MLBH g4B/vODtnBvDzkLjm+m7pFcysGyY5E6HGZFxpM2+twg4HNgh+51ZdoR6XJIVt6ESvjbk W4biBw0o2FL3ajWeYXOW9r6f9U/hq30BK+p1s6lKbuRBTtizt1LM4uA5XE2yaMmXaOKK RL/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BWgf9mQL60frF07ii2U3Yx/gnin3umDFroib+xOOshw=; b=A6IXwPrw9L5q8Y/Bx/zd8Q06TlA+AWQt9DQYa1rXNLcbRVyK0Az6FqSVVC1sxG5dN2 +7jSlCrWmzhtNpkDFdnWWkH7es9XZzD941kVslhrzDGte75wtdhMTDbfIivTSmHkw0+E HCqM4YMs3uQSS3LJedRDoeUmLstoWk1VGQzUJQ3NuePG9o8haK8KkRpkx0nvD4j1xh0j v5SGO8m2C+4IgdDVrE8SrCGqJyeoBHuzJuBY/IfniGoR6XV6eCf9e5s6ZTelXlbLZ22r JqP0ppamnrFHaEWDp3YHqwIb9y5KrfGMmeW8gV25OF5RKp8XF4dfRiOVrIdGzH8Jwarn nm5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LhKqHj9w; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com. [66.111.4.230]) by mx.google.com with ESMTPS id u5si2283273qta.21.2019.05.19.22.43.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 22:43:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 as permitted sender) client-ip=66.111.4.230; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=LhKqHj9w; spf=softfail (google.com: domain of transitioning tobin@kernel.org does not designate 66.111.4.230 as permitted sender) smtp.mailfrom=tobin@kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 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 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