Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1073429pxb; Wed, 6 Apr 2022 08:06:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSl0UY9Rn5jqe5DGGa85APGjjtlM5tVCYwGZXCgO3phCe2gShc3BQz6Eqg5dNHENxwGhzj X-Received: by 2002:a54:4e11:0:b0:2ec:e0ee:ac29 with SMTP id a17-20020a544e11000000b002ece0eeac29mr3672001oiy.257.1649257588749; Wed, 06 Apr 2022 08:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649257588; cv=none; d=google.com; s=arc-20160816; b=B2i6LwoDF/EtDzuuYjf7h81EC6jbAgavYiFnAkokPkJjykoH644xY5nUEujRc18309 Ersvga9gy4FpZaUNIhEEnpVTaqeWRG9oggJYLg08DXRPkcL4Zq1tn19kWHs1byDa2Bt6 b0EhtY44QH0mGeXJwmsZ6l/ikHu6gY6VC904A+79SIxFBR//7jIcMRxTrPoc2044htna bvUwDrzGXwIZg5gBy6tJD+L/q+vx20n7u1Oo8Axr8zrLgBgsaHBDoGaqxl8CYFNBtm46 W5FjlEUdrMXA5c1Wyj3lM4gqAW/0vpYmRhGZjpWAQBbxKuo48OcLPosfO1U6o9JZwtzl ksYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=QO0Y8UZBC0+bYJouZVh23+IhfwEOZuUtdQE1ESyBkMA=; b=UIoIgpF+m8Q1S+gbTDD/BIQcZM7gTDcslwCj+d6q8XWJZexqTOfUxmew8kw+NWprJL 5qVBrkG2vreDtJmmDliWEJr5LJDWWVJ54VHuSCV2XXEDojGghBF5Rsli+uKKAPVmc/VB 2ofUX4Kl8mLe9mP33cIZ8iyxtCc8qS48RMD/ebJ9s/J8Hv0nVJO5CIWWMT5YjJn43hI+ lWqayTLX6YP616mP9La0LSQ6D/xbf/ob6UcYzLASTEr3aoWozGv8Mc1ogq/jObm4iH7Q vTnLuEqyXVty5cCAGuggh7EID2atIR66XsYh/40vP3q2lCpiYwHa5dzNCegJ9rsNX8qc u8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NwU4C2e4; dkim=neutral (no key) header.i=@suse.cz header.b=i1cRPUCs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m6-20020a056870a10600b000da716e618bsi10769888oae.20.2022.04.06.08.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:06:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=NwU4C2e4; dkim=neutral (no key) header.i=@suse.cz header.b=i1cRPUCs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 669BC3ADACB; Wed, 6 Apr 2022 05:53:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbiDFMzS (ORCPT + 99 others); Wed, 6 Apr 2022 08:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbiDFMy6 (ORCPT ); Wed, 6 Apr 2022 08:54:58 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 259FD1DF644 for ; Wed, 6 Apr 2022 01:55:43 -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 547011F7AC; Wed, 6 Apr 2022 08:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649235342; 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=QO0Y8UZBC0+bYJouZVh23+IhfwEOZuUtdQE1ESyBkMA=; b=NwU4C2e4Tn+oq/IPcFXOrXRJBPQor8IFoJW0eB49i2InkSAeDxJCveQInjCvigk6eIDOe2 b+zWTvF+CO3H8S0NfrMV/qoUDM/amMK9GGotK5SRmXtwF4scBAEe97K7LpjW8dGKTJsXpg m7G+BRlWsXL9xKuRudEnb/xnDLmhdQU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649235342; 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=QO0Y8UZBC0+bYJouZVh23+IhfwEOZuUtdQE1ESyBkMA=; b=i1cRPUCsyUax9UIgUcTNp9pDge2UDw8eo9QCFVxn1HZQAtYOzk5H3WawFOhtD0cRfD8Jxe 3ox4g6EA7xktCRDg== 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 1F6EF139F5; Wed, 6 Apr 2022 08:55:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZgnxBo5VTWLbdQAAMHmgww (envelope-from ); Wed, 06 Apr 2022 08:55:42 +0000 Message-ID: <9dfab603-5cc7-0e7d-50c3-c21bdb8598ca@suse.cz> Date: Wed, 6 Apr 2022 10:55:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 1/6] lib/stackdepot: allow requesting early initialization dynamically Content-Language: en-US To: David Rientjes Cc: Christoph Lameter , Joonsoo Kim , Pekka Enberg , Roman Gushchin , Andrew Morton , linux-mm@kvack.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, Oliver Glitta , Marco Elver , Mike Rapoport , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Imran Khan References: <20220404164112.18372-1-vbabka@suse.cz> <20220404164112.18372-2-vbabka@suse.cz> <8a13e52b-f4ff-4fd9-1f8a-fdea3868bc1@google.com> From: Vlastimil Babka In-Reply-To: <8a13e52b-f4ff-4fd9-1f8a-fdea3868bc1@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 4/5/22 23:40, David Rientjes wrote: > On Mon, 4 Apr 2022, Vlastimil Babka wrote: >> +int __init stack_depot_early_init(void) >> +{ >> + size_t size; >> + >> + /* This is supposed to be called only once, from mm_init() */ >> + if (WARN_ON(__stack_depot_early_init_passed)) >> + return 0; >> + >> + __stack_depot_early_init_passed = true; >> + >> + if (!__stack_depot_want_early_init || stack_depot_disable) >> + return 0; >> + >> + pr_info("Stack Depot early init allocating hash table with memblock_alloc\n"); >> + size = (STACK_HASH_SIZE * sizeof(struct stack_record *)); > > I think the kvcalloc() in the main init path is very unlikely to fail, but > perhaps this memblock_alloc() might? If so, a nit might be to include > this size as part of the printk. OK, added the hunk at the end of mail. Example: [0.062264] Stack Depot early init allocating hash table with memblock_alloc, 8388608 bytes > Either way: > > Acked-by: David Rientjes Thanks! diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 6c4644c9ed44..5ca0d086ef4a 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -186,8 +186,9 @@ int __init stack_depot_early_init(void) if (!__stack_depot_want_early_init || stack_depot_disable) return 0; - pr_info("Stack Depot early init allocating hash table with memblock_alloc\n"); size = (STACK_HASH_SIZE * sizeof(struct stack_record *)); + pr_info("Stack Depot early init allocating hash table with memblock_alloc, %zu bytes\n", + size); stack_table = memblock_alloc(size, SMP_CACHE_BYTES); if (!stack_table) {