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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,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 969F8C47084 for ; Tue, 25 May 2021 10:36:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40A3361420 for ; Tue, 25 May 2021 10:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40A3361420 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C94D46B006C; Tue, 25 May 2021 06:36:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6B906B006E; Tue, 25 May 2021 06:36:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B34F76B0070; Tue, 25 May 2021 06:36:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 815776B006C for ; Tue, 25 May 2021 06:36:55 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1AED798B6 for ; Tue, 25 May 2021 10:36:55 +0000 (UTC) X-FDA: 78179400390.07.7C14459 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf13.hostedemail.com (Postfix) with ESMTP id 674FFE000801 for ; Tue, 25 May 2021 10:36:48 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1621939013; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TAEMRMdeN7eHAUUj1q6dnzZ4Qoz3CinUiEpDsYlKJ+w=; b=dPEJS7SBHuQrhnYYxMm64ogIBl2jNaZbHM7T62kc1NN6ZDaqFHsjSC8JNY50E0Tk4PGnca I79plJEcVZ2BiCBtebbdBsFcsD9TGSUFMVrh4sJu9UkrgkJtbIWKPnVF+BZcTzdJYJARTb DG0hq3PmcZDP+eq/HpB69QzIi19jdU0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1621939013; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TAEMRMdeN7eHAUUj1q6dnzZ4Qoz3CinUiEpDsYlKJ+w=; b=YoJhgwCrsJH23vB/d4T5lQLcT8Payw4SCk4yD2sp3tuKET2sUxzVNU323S+xtY+x3yJt4V 39BVX6X5PWlk2uAA== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3377BAF11; Tue, 25 May 2021 10:36:53 +0000 (UTC) To: Mel Gorman 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 References: <20210524233946.20352-1-vbabka@suse.cz> <20210524233946.20352-3-vbabka@suse.cz> <20210525101742.GK30378@techsingularity.net> From: Vlastimil Babka Subject: Re: [RFC 02/26] mm, slub: allocate private object map for validate_slab_cache() Message-ID: Date: Tue, 25 May 2021 12:36:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210525101742.GK30378@techsingularity.net> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=dPEJS7SB; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=YoJhgwCr; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 674FFE000801 X-Stat-Signature: xwgiuxzjqkp5epc8qwq96xhaaocz7cni X-HE-Tag: 1621939008-722108 Content-Transfer-Encoding: quoted-printable 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 5/25/21 12:17 PM, Mel Gorman wrote: > 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 fro= m a >> self-test context. In both situations it's straightforward to prealloc= ate a >> private object bitmap instead of grabbing the shared static one meant = for >> critical sections, so let's do that. >>=20 >> Signed-off-by: Vlastimil Babka >> >> >> >> @@ -4685,10 +4685,17 @@ static long validate_slab_cache(struct kmem_ca= che *s) >> int node; >> unsigned long count =3D 0; >> struct kmem_cache_node *n; >> + unsigned long *obj_map; >> + >> + obj_map =3D bitmap_alloc(oo_objects(s->oo), GFP_KERNEL); >> + if (!obj_map) >> + return -ENOMEM; >> =20 >=20 >=20 > 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? he other callers are all in the effectively dead resiliency_test() code, = which has meanwhile been replaced in mmotm by kunit tests meanwhile. But it's t= rue those don't check the results either for now. > It's a fairly minor concern so whether you add a message or not I think I'll rather fix up the tests. Or do you mean that -ENOMEM for a s= ysfs write is also not enough and there should be a dmesg explanation for that= case? > Acked-by: Mel Gorman Thanks!