lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dfab603-5cc7-0e7d-50c3-c21bdb8598ca@suse.cz>
Date:   Wed, 6 Apr 2022 10:55:41 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     David Rientjes <rientjes@...gle.com>
Cc:     Christoph Lameter <cl@...ux.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Pekka Enberg <penberg@...nel.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        patches@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Oliver Glitta <glittao@...il.com>,
        Marco Elver <elver@...gle.com>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Hyeonggon Yoo <42.hyeyoo@...il.com>,
        Imran Khan <imran.f.khan@...cle.com>
Subject: Re: [PATCH v3 1/6] lib/stackdepot: allow requesting early
 initialization dynamically

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 <rientjes@...gle.com>

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) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ