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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <44ce007d-8049-1cc9-7e2e-4ccb51a2867d@huawei.com>
Date:   Thu, 25 May 2023 09:28:57 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Mike Rapoport <rppt@...nel.org>
CC:     Anshuman Khandual <anshuman.khandual@....com>,
        <20230519105321.333-1-ssawgyw@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <tsahu@...ux.ibm.com>, <ssawgyw@...il.com>
Subject: Re: [PATCH] memblock: update numa node of memblk reserved type



On 2023/5/24 23:33, Mike Rapoport wrote:
> On Wed, May 24, 2023 at 02:47:26PM +0800, Kefeng Wang wrote:
>>
>> On 2023/5/24 12:59, Anshuman Khandual wrote:
>>>

>>>
>>> __memblock_dump_all() gets called only when memblock_debug is enabled.
>>> This helper should be called directly inside memblock_dump_all() right
>>> at the beginning, regardless of memblock_debug.
>>
>> This is my first though, but I found there are still many memblock_alloc and
>> memblock_reserve after memblock_dump_all(), so I update it twice,
>>
>> 1) __memblock_dump_all()
>> 2) memblock_debug_show()
>>
>> and without the above two interface, no one care about the reserved node
>> info, so I put memblock_reserved_update_node into __memblock_dump_all().
>   
> We don't care about the reserved node info and __memblock_dump_all()
> actually does not print node info for reserved regions unless somebody
> explicitly sets the node id on a reserved memory.
> 
> So instead of updating reserved memory node info I'd rather avoid printing
> it in debugfs.

Ok, will skip nid = MAX_NUMNODES in debug show

diff --git a/mm/memblock.c b/mm/memblock.c
index c5c80d9bcea3..e6033de1f76d 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2169,17 +2169,19 @@ static int memblock_debug_show(struct seq_file 
*m, void *private)
  {
         struct memblock_type *type = m->private;
         struct memblock_region *reg;
-       int i, j;
+       int i, j, nid;
         unsigned int count = ARRAY_SIZE(flagname);
         phys_addr_t end;

         for (i = 0; i < type->cnt; i++) {
                 reg = &type->regions[i];
                 end = reg->base + reg->size - 1;
+               nid = memblock_get_region_node(reg);

                 seq_printf(m, "%4d: ", i);
                 seq_printf(m, "%pa..%pa ", &reg->base, &end);
-               seq_printf(m, "%4d ", memblock_get_region_node(reg));
+               if (nid != MAX_NUMNODES)
+                       seq_printf(m, "%4d ", nid);
                 if (reg->flags) {
                         for (j = 0; j < count; j++) {
                                 if (reg->flags & (1U << j)) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ