From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21467C2B9F8 for ; Tue, 25 May 2021 10:17:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4A3D6128D for ; Tue, 25 May 2021 10:17:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4A3D6128D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8ED2B6B006C; Tue, 25 May 2021 06:17:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 893406B006E; Tue, 25 May 2021 06:17:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42E5B6B0070; Tue, 25 May 2021 06:17:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id F28576B006C for ; Tue, 25 May 2021 06:17:46 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 776E0180ACF6C for ; Tue, 25 May 2021 10:17:46 +0000 (UTC) X-FDA: 78179352132.24.A17FE82 Received: from outbound-smtp10.blacknight.com (outbound-smtp10.blacknight.com [46.22.139.15]) by imf12.hostedemail.com (Postfix) with ESMTP id 9706B2D4 for ; Tue, 25 May 2021 10:17:37 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp10.blacknight.com (Postfix) with ESMTPS id AD5CF1C3C49 for ; Tue, 25 May 2021 11:17:44 +0100 (IST) Received: (qmail 1239 invoked from network); 25 May 2021 10:17:44 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.23.168]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 25 May 2021 10:17:44 -0000 Date: Tue, 25 May 2021 11:17:42 +0100 From: Mel Gorman To: Vlastimil Babka Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Sebastian Andrzej Siewior , Thomas Gleixner , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn Subject: Re: [RFC 02/26] mm, slub: allocate private object map for validate_slab_cache() Message-ID: <20210525101742.GK30378@techsingularity.net> References: <20210524233946.20352-1-vbabka@suse.cz> <20210524233946.20352-3-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210524233946.20352-3-vbabka@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf12.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9706B2D4 X-Stat-Signature: noh8femmy6wx3qnag1o39p5rywbnqewy X-HE-Tag: 1621937857-90145 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: On Tue, May 25, 2021 at 01:39:22AM +0200, Vlastimil Babka wrote: > validate_slab_cache() is called either to handle a sysfs write, or from a > self-test context. In both situations it's straightforward to preallocate a > private object bitmap instead of grabbing the shared static one meant for > critical sections, so let's do that. > > Signed-off-by: Vlastimil Babka > > > > @@ -4685,10 +4685,17 @@ static long validate_slab_cache(struct kmem_cache *s) > int node; > unsigned long count = 0; > struct kmem_cache_node *n; > + unsigned long *obj_map; > + > + obj_map = bitmap_alloc(oo_objects(s->oo), GFP_KERNEL); > + if (!obj_map) > + return -ENOMEM; > Most callers of validate_slab_cache don't care about the return value except when the validate sysfs file is written. Should a simply informational message be displayed for -ENOMEM in case a writer to validate fails and it's not obvious it was because of an allocation failure? It's a fairly minor concern so whether you add a message or not Acked-by: Mel Gorman -- Mel Gorman SUSE Labs