From patchwork Thu Aug 10 16:36:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13349719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBCF9C04FDF for ; Thu, 10 Aug 2023 16:36:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EE676B007D; Thu, 10 Aug 2023 12:36:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3396B007E; Thu, 10 Aug 2023 12:36:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE0976B0080; Thu, 10 Aug 2023 12:36:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CDD966B007B for ; Thu, 10 Aug 2023 12:36:36 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 773B21CA0D3 for ; Thu, 10 Aug 2023 16:36:36 +0000 (UTC) X-FDA: 81108748392.22.16A39C4 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf01.hostedemail.com (Postfix) with ESMTP id 92FCD40028 for ; Thu, 10 Aug 2023 16:36:34 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=izuGpZjT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=p6eqWXON; spf=pass (imf01.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691685394; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=a3DtkVdLGQHDYk90N/OXEPjHa8PNLxLzj/qp7wDJMuQ=; b=wanJrbRAn5xuS30pxeoEcP0esBk8UEJE8eQf4dQ0xQteew/shLFVa1VFF1NE+P0sQkh6ca K3zZF1HXwpB0D9AAbu0nfUzNj3zuhZC8WpEfRoYmCTHtV/NEdxCvgGhP3iXnHBZHl1A102 vZw3Z7g6AoinenCllFIVJ5ad/S6GX6I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691685394; a=rsa-sha256; cv=none; b=H0P1Nbx7KhO63tx7YHRiCpAzQsLQ7LfAdZKxcNlkHHgut/M54JvAQM+sQH6/k9YuEHmdB9 Boi5cV29qOzwK5jEplkQnOPXyopnlZSkDy2fXyd36zH074vokz91AmSKsZ3jNgBX2tnVZU es/zgCIboh6kPJN14EvkxkFjA7qv1rs= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=izuGpZjT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=p6eqWXON; spf=pass (imf01.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F036821878; Thu, 10 Aug 2023 16:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691685392; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a3DtkVdLGQHDYk90N/OXEPjHa8PNLxLzj/qp7wDJMuQ=; b=izuGpZjTDaa1X7FM+8xTm5XGp80s21t8mw95pR1CYB5uPp0dA8c+tZ0jgOTQBfSnlPUZXc vQiMiGKsA7yQKGOWxzUA/EX95/ge5PmBAW/5TI6OTaJmg4IENCoK0N2z6vsWBJv2ji8loT oEXgrJoEYRtt2UOfw5uspqh2z5YapbY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691685392; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a3DtkVdLGQHDYk90N/OXEPjHa8PNLxLzj/qp7wDJMuQ=; b=p6eqWXON9YDd4m3Wr/OaVX58a9pQHfuB4SGI9tgsmckkAANRrz+0BOIX9nWMdm6L9jpBej SEImetYJhoV2wgAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C432F139D1; Thu, 10 Aug 2023 16:36:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IMZJLxAS1WSEPQAAMHmgww (envelope-from ); Thu, 10 Aug 2023 16:36:32 +0000 From: Vlastimil Babka To: "Liam R. Howlett" , Matthew Wilcox , Suren Baghdasaryan , Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Vlastimil Babka Subject: [RFC v2 3/7] maple_tree: use slub percpu array Date: Thu, 10 Aug 2023 18:36:31 +0200 Message-ID: <20230810163627.6206-12-vbabka@suse.cz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230810163627.6206-9-vbabka@suse.cz> References: <20230810163627.6206-9-vbabka@suse.cz> MIME-Version: 1.0 X-Stat-Signature: 3ojzk6yisoicw7x9owabyk6hrg45f1jk X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 92FCD40028 X-Rspam-User: X-HE-Tag: 1691685394-344765 X-HE-Meta: U2FsdGVkX18b6wtLLOTK+T24gFUn+ZxBjOzTfA9h6RL8hujOnJadZU3A/FC0j4GQ0FyBZRFNMYWTQ/oPrPpq0fbzy0HO3s2tHuU9oGQvh7rmI0dRzjyE0VG4TzZ4wtHvXyo9DyfMa08ImfSrWIP6qWelxMXUwKvWmRmZ6IMNCAvLjofCy+KD6+9AZ+/iy2rt6MRmz5JsT9yDpkvcI0AQrBkV/gM3mOQ9yyI6kC1jT+NQP4BTf90hfoPcRRxkmuh5JWe+/FvqDKCJEOxrgCC2LLHLRjGrTjihPYl25OfquInM6vkUzv14fJ/vi+BZodPvwBlvbYVSd8piyGIzX1epVHqn4o8NfB/3h/31L+K1lr0dm4Nmbd0MO8t8T0u8LIFusuOwE8Hz6vaUrzuALBO5x686YxebYdlIN76qzQxjoeEtbvPhMoOdp3MnD12OmZwgJeYPSskRlDEbu9dzjM+788eynt60H0FblVFZXQy5hem4FXQe6S4gwj4THdsIvoBWQj0oT47rYpPg7ntLbrgVTa7iTE+Y3BITQrflkqBFw1KgfHUl8u0J1ONDV5dbCxNLxlBFkIbaJkHhQmj4Z21pDZ7f6EpRCyckdtRr8YTg8rtGGTLECSZTJpoUwSqjAgOsAFR7KtJCDdvYtZxwdLDxO+uF0ymeNvPPncAprEQFGFefXGTfSxPSTRSFTsA6dFvxdd5WHHdqLOuvcMx4j1bBEJPANxxXRPauFbEolkcZvUR3Q7FD3FS9HtL0ld+JLrYdeTG1YpG8mbBcu20t1GopuAgqn1bW7J4smcSr4bH0PcwAi+GOhUTzURbQidSV/jFLxZ6Es5ebccq5TQvI7005dcpEXeu82DOFNKzKSHkcgVpmXTqEKtYutIWcURlpSKH+DH23rpyE9CiCqaYm8E25lkeAWjJNZKn1leZr+mnUYbbjDZvAJm3sO18VZx1wi6sz0L9DcUVuCOB4hawioKR q9p9hYI7 y9yHz9uM7FT5cuFI0PWbeEcUGCjLH5ytBMrHctnLCFsCX+blpJAN1Nm6MfzqlCfUIRcIy03kJ5TdoQjBTNcsASvQ8QXmiEiArxp1a3rev538kI9dtMFUxCHxWcqT2USaoFhg4yYuxPAOVAdsuSeEbDfWJAs9t1nb2TrMBTYDCf50E6hwE2/iyck1ONhb9Ovxyhx56dyWa9UMOcUD3/XOxlDtMfNYTDwZkpOQXeeWglp+B2Adb+vSxiE4eIoHpVUYrwtguBqJEP4V4XMvUXF3KGOtF9VCINP3XNH5AznRK9hSxU2R0/o/xCjZUHg== 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: Just make sure the maple_node_cache has a percpu array of size 32. Will break with CONFIG_SLAB. --- lib/maple_tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 4dd73cf936a6..1196d0a17f03 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6180,9 +6180,16 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) void __init maple_tree_init(void) { + int ret; + maple_node_cache = kmem_cache_create("maple_node", sizeof(struct maple_node), sizeof(struct maple_node), - SLAB_PANIC, NULL); + SLAB_PANIC | SLAB_NO_MERGE, NULL); + + ret = kmem_cache_setup_percpu_array(maple_node_cache, 32); + + if (ret) + pr_warn("error %d creating percpu_array for maple_node_cache\n", ret); } /**