mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: nathanl@linux.ibm.com, cheloha@linux.ibm.com
Subject: Re: [PATCH v2] powerpc/drmem: Don't compute the NUMA node for each LMB
Date: Mon, 4 Apr 2022 10:00:53 +0200	[thread overview]
Message-ID: <02d1e060-e0e4-92e0-ef88-7f237e36fa5c@linux.ibm.com> (raw)
In-Reply-To: <9d02405a-793e-bcf5-a424-470d9c82ec7d@csgroup.eu>

On 02/04/2022, 18:35:15, Christophe Leroy wrote:
> 
> 
> Le 05/08/2020 à 15:35, Laurent Dufour a écrit :
>> All the LMB from the same set of ibm,dynamic-memory-v2 property are
>> sharing the same NUMA node. Don't compute that node for each one.
>>
>> Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to
>> lmb_set_nid() have been made instead of 1022.
>>
>> This should prevent some soft lockups when starting large guests
>>
>> Code has meaning only if CONFIG_MEMORY_HOTPLUG is set, otherwise the nid
>> field is not present in the drmem_lmb structure.
>>
>> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
> 
> It looks like this patch was superseded by e5e179aa3a39 ("pseries/drmem:
> don't cache node id in drmem_lmb struct").

That patch has been superseded and can be dropped.

Thanks,
Laurent.


> If not, anyway it conflicts with that patch so it has to be rebased.
> 
> Thanks
> Christophe
> 
> 
>> ---
>>   arch/powerpc/mm/drmem.c | 25 ++++++++++++++++++++++++-
>>   1 file changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c
>> index b2eeea39684c..c11b6ec99ea3 100644
>> --- a/arch/powerpc/mm/drmem.c
>> +++ b/arch/powerpc/mm/drmem.c
>> @@ -402,6 +402,9 @@ static void __init init_drmem_v2_lmbs(const __be32
>> *prop)
>>       const __be32 *p;
>>       u32 i, j, lmb_sets;
>>       int lmb_index;
>> +#ifdef CONFIG_MEMORY_HOTPLUG
>> +    struct drmem_lmb *first = NULL;
>> +#endif
>>         lmb_sets = of_read_number(prop++, 1);
>>       if (lmb_sets == 0)
>> @@ -426,6 +429,15 @@ static void __init init_drmem_v2_lmbs(const __be32
>> *prop)
>>       for (i = 0; i < lmb_sets; i++) {
>>           read_drconf_v2_cell(&dr_cell, &p);
>>   +#ifdef CONFIG_MEMORY_HOTPLUG
>> +        /*
>> +         * Fetch the NUMA node id for the fist set or if the
>> +         * associativity index is different from the previous set.
>> +         */
>> +        if (first && dr_cell.aa_index != first->aa_index)
>> +            first = NULL;
>> +#endif
>> +
>>           for (j = 0; j < dr_cell.seq_lmbs; j++) {
>>               lmb = &drmem_info->lmbs[lmb_index++];
>>   @@ -438,7 +450,18 @@ static void __init init_drmem_v2_lmbs(const __be32
>> *prop)
>>               lmb->aa_index = dr_cell.aa_index;
>>               lmb->flags = dr_cell.flags;
>>   -            lmb_set_nid(lmb);
>> +#ifdef CONFIG_MEMORY_HOTPLUG
>> +            /*
>> +             * All the LMB in the set share the same NUMA
>> +             * associativity property. So read that node only once.
>> +             */
>> +            if (!first) {
>> +                lmb_set_nid(lmb);
>> +                first = lmb;
>> +            } else {
>> +                lmb->nid = first->nid;
>> +            }
>> +#endif
>>           }
>>       }
>>   }


      reply	other threads:[~2022-04-04  8:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  9:28 [PATCH] " Laurent Dufour
2020-08-05 10:43 ` kernel test robot
2020-08-05 12:23   ` Laurent Dufour
2020-08-05 13:35   ` [PATCH v2] " Laurent Dufour
2022-04-02 16:35     ` Christophe Leroy
2022-04-04  8:00       ` Laurent Dufour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02d1e060-e0e4-92e0-ef88-7f237e36fa5c@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=cheloha@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nathanl@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®