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 A9169C2B9F8 for ; Tue, 25 May 2021 10:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8626B61417 for ; Tue, 25 May 2021 10:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbhEYKTT (ORCPT ); Tue, 25 May 2021 06:19:19 -0400 Received: from outbound-smtp24.blacknight.com ([81.17.249.192]:50724 "EHLO outbound-smtp24.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhEYKTP (ORCPT ); Tue, 25 May 2021 06:19:15 -0400 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp24.blacknight.com (Postfix) with ESMTPS id AE9E1C0BED 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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