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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC534C4332F for ; Wed, 6 Apr 2022 08:58:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F8B28D0008; Wed, 6 Apr 2022 04:55:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A8B08D0003; Wed, 6 Apr 2022 04:55:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 698808D0008; Wed, 6 Apr 2022 04:55:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 5994B8D0003 for ; Wed, 6 Apr 2022 04:55:54 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 18B9A183DC8CE for ; Wed, 6 Apr 2022 08:55:44 +0000 (UTC) X-FDA: 79325846208.22.359A116 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf20.hostedemail.com (Postfix) with ESMTP id 80DF81C0017 for ; Wed, 6 Apr 2022 08:55:43 +0000 (UTC) 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-Stat-Signature: 5b1hajbahwrsuzbsd7t8jcun5t1m9tsz Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=NwU4C2e4; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=i1cRPUCs; dmarc=none; spf=pass (imf20.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 80DF81C0017 X-HE-Tag: 1649235343-105998 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 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) {