Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4527893rwb; Tue, 8 Aug 2023 09:43:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyQZ1mPH1MgIZiOqhKiIq9XZla+dbNzYMuPtgylLWYGVADcu2fIepIv1INU6K++KRaTLmE X-Received: by 2002:a05:6a00:3913:b0:687:6288:783d with SMTP id fh19-20020a056a00391300b006876288783dmr51319pfb.7.1691512989506; Tue, 08 Aug 2023 09:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691512989; cv=none; d=google.com; s=arc-20160816; b=iJMQaXUqtrv6Mt+W2pVZzk471eIemGuCnhambcZOhwkuK40Pr7G5euL05iq8zQGEvb I8txUp6WNvOGfcA4WGI9bBc2732zQZ8qGgSH2L7xrNgOUaa8rYuNO6EThUERhyRf5Nkm 65hHKkmU1FZyVjTWbES3Z+QOHjnn6RQUt50yPGm2E6mcKKzI10OwPJIskpznLPRLGC/t ycJbKqc2fCT1T0qjT7G4db2CO74Qo3mGdqaio58mDv/ZShMXS62OEO4SsnvHWEcH+Z5X k0WVh1upH5QHWXoLSBJVyfpZ8Bz2c2Dl1SlTBSIDVqWUkv1KWo0MYKPty8qB3jKzHZWh oXcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=a3DtkVdLGQHDYk90N/OXEPjHa8PNLxLzj/qp7wDJMuQ=; fh=sDCYtOtQNr4J8m+XjxLSaS1eoEDwapxZAeFBp4YZzdY=; b=U9h4GW8+rQlWMPYjMcB/tXmEofhnRMr9X1orcBQ1KY795oDybUiIgwlnFimJeExeF/ fMK/KcfW8DiutsoD73tMO7ncsNORG1tvilaEAs1CrAJhu8iZfwlWRSDTjs6Ks6EdNPff 6uDFX4T18RiRtAijK18HUTLgz7h+kRGl84TPehziBCdQsJp8c9SIN8Dj88QGRhtdiRU3 SKMX2b+g+cU1I4BY0ZMNmtgtvmTXl8lgUvpURYl6LbpZpSoLrIwrGqyZlFsHUkF4uKjM vCU9JwJi04thSIvFJwW56Y0j69h0Ft54zHKyrfEhwb4zCEQsuJqBGLDy8UQF+97YTLdm mAeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TM63PQDL; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a056a00239500b006878c40d5c1si7640538pfc.369.2023.08.08.09.42.57; Tue, 08 Aug 2023 09:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TM63PQDL; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232547AbjHHQV5 (ORCPT + 99 others); Tue, 8 Aug 2023 12:21:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbjHHQT4 (ORCPT ); Tue, 8 Aug 2023 12:19:56 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A219001 for ; Tue, 8 Aug 2023 08:49:00 -0700 (PDT) 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-out2.suse.de (Postfix) with ESMTPS id 244E520319; Tue, 8 Aug 2023 09:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1691488433; 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=TM63PQDL1/kV/0eRyfhNJd9mTnr0x7YZSgjc8gu+OShasFlpsvfTd29e6XuZUTzyIuOzKh epAVCCvXUWmkzTZ+F27l6Dqs/VEedrJReg+43nUQbnAOrW9MhnfDcJEo+daT4fyDfyI7+2 tuJoCLZ60xeq+ygkOsdBQLf9xHRywQI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1691488433; 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=PMYk4+pst66z0H1Ard3n4p3Ej4MlqgpLiQdaPFhRHz+PTuyTYA3lk/x+G2Bsq/DLk5blTG bJlASInXsVjsuJBA== 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 ED5F6139E9; Tue, 8 Aug 2023 09:53:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IP9CObAQ0mSBJQAAMHmgww (envelope-from ); Tue, 08 Aug 2023 09:53:52 +0000 From: Vlastimil Babka To: "Liam R. Howlett" , Matthew Wilcox , 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 v1 3/5] maple_tree: use slub percpu array Date: Tue, 8 Aug 2023 11:53:46 +0200 Message-ID: <20230808095342.12637-10-vbabka@suse.cz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230808095342.12637-7-vbabka@suse.cz> References: <20230808095342.12637-7-vbabka@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } /** -- 2.41.0