From: Michael Ellerman <mpe@ellerman.id.au>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
Kexec Mailing List <kexec@lists.infradead.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Hari Bathini <hbathini@linux.ibm.com>
Subject: Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents
Date: Thu, 23 Jul 2020 16:41:50 +1000 [thread overview]
Message-ID: <875zaeravl.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAFgQCTsgX9XWJ476dxT2csTuuhpaO3KSZN-EewZiZ0mBj3N4aQ@mail.gmail.com>
Pingfan Liu <kernelfans@gmail.com> writes:
> On Wed, Jul 22, 2020 at 12:57 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> Pingfan Liu <kernelfans@gmail.com> writes:
>> > A bug is observed on pseries by taking the following steps on rhel:
>> ^
>> RHEL
>>
>> I assume it happens on mainline too?
> Yes, it does.
>>
> [...]
>> > diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > index 1a3ac3b..def8cb3f 100644
>> > --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > @@ -372,6 +372,7 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb)
>> > invalidate_lmb_associativity_index(lmb);
>> > lmb_clear_nid(lmb);
>> > lmb->flags &= ~DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>> No error checking?
> Hmm, here should be a more careful design. Please see the comment at the end.
>>
>> > __remove_memory(nid, base_addr, block_sz);
>> >
>> > @@ -607,6 +608,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>> >
>> > lmb_set_nid(lmb);
>> > lmb->flags |= DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>> And here ..
>> >
>> > block_sz = memory_block_size_bytes();
>> >
>> > @@ -625,6 +627,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>> > invalidate_lmb_associativity_index(lmb);
>> > lmb_clear_nid(lmb);
>> > lmb->flags &= ~DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>>
>> And here ..
>>
>> > __remove_memory(nid, base_addr, block_sz);
>> > }
>> > @@ -877,9 +880,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
>> > break;
>> > }
>> >
>> > - if (!rc)
>> > - rc = drmem_update_dt();
>> > -
>> > unlock_device_hotplug();
>> > return rc;
>>
>> Whereas previously we did check it.
>
> drmem_update_dt() fails iff allocating memory fail.
That's true currently, but it might change in future.
> And in the failed case, even the original code does not roll back the
> effect of __add_memory()/__remove_memory().
Yeah hard to know what the desired behaviour is. If something fails we
at least need to print a message though, not silently swallow it.
> And I plan to do the following in V4: if drmem_update_dt() fails in
> dlpar_add_lmb(), then bails out immediately.
That sounds reasonable.
cheers
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
Kexec Mailing List <kexec@lists.infradead.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Hari Bathini <hbathini@linux.ibm.com>
Subject: Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents
Date: Thu, 23 Jul 2020 16:41:50 +1000 [thread overview]
Message-ID: <875zaeravl.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAFgQCTsgX9XWJ476dxT2csTuuhpaO3KSZN-EewZiZ0mBj3N4aQ@mail.gmail.com>
Pingfan Liu <kernelfans@gmail.com> writes:
> On Wed, Jul 22, 2020 at 12:57 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> Pingfan Liu <kernelfans@gmail.com> writes:
>> > A bug is observed on pseries by taking the following steps on rhel:
>> ^
>> RHEL
>>
>> I assume it happens on mainline too?
> Yes, it does.
>>
> [...]
>> > diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > index 1a3ac3b..def8cb3f 100644
>> > --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
>> > @@ -372,6 +372,7 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb)
>> > invalidate_lmb_associativity_index(lmb);
>> > lmb_clear_nid(lmb);
>> > lmb->flags &= ~DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>> No error checking?
> Hmm, here should be a more careful design. Please see the comment at the end.
>>
>> > __remove_memory(nid, base_addr, block_sz);
>> >
>> > @@ -607,6 +608,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>> >
>> > lmb_set_nid(lmb);
>> > lmb->flags |= DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>> And here ..
>> >
>> > block_sz = memory_block_size_bytes();
>> >
>> > @@ -625,6 +627,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
>> > invalidate_lmb_associativity_index(lmb);
>> > lmb_clear_nid(lmb);
>> > lmb->flags &= ~DRCONF_MEM_ASSIGNED;
>> > + drmem_update_dt();
>>
>>
>> And here ..
>>
>> > __remove_memory(nid, base_addr, block_sz);
>> > }
>> > @@ -877,9 +880,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
>> > break;
>> > }
>> >
>> > - if (!rc)
>> > - rc = drmem_update_dt();
>> > -
>> > unlock_device_hotplug();
>> > return rc;
>>
>> Whereas previously we did check it.
>
> drmem_update_dt() fails iff allocating memory fail.
That's true currently, but it might change in future.
> And in the failed case, even the original code does not roll back the
> effect of __add_memory()/__remove_memory().
Yeah hard to know what the desired behaviour is. If something fails we
at least need to print a message though, not silently swallow it.
> And I plan to do the following in V4: if drmem_update_dt() fails in
> dlpar_add_lmb(), then bails out immediately.
That sounds reasonable.
cheers
next prev parent reply other threads:[~2020-07-23 6:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 1:52 [PATCHv3 1/2] powerpc/pseries: group lmb operation and memblock's Pingfan Liu
2020-07-22 1:52 ` Pingfan Liu
2020-07-22 1:52 ` [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents Pingfan Liu
2020-07-22 1:52 ` Pingfan Liu
2020-07-22 4:57 ` Michael Ellerman
2020-07-22 4:57 ` Michael Ellerman
2020-07-23 2:27 ` Pingfan Liu
2020-07-23 2:27 ` Pingfan Liu
2020-07-23 6:41 ` Michael Ellerman [this message]
2020-07-23 6:41 ` Michael Ellerman
2020-07-23 13:27 ` Nathan Lynch
2020-07-23 13:27 ` Nathan Lynch
2020-07-24 12:24 ` Pingfan Liu
2020-07-24 12:24 ` Pingfan Liu
2020-07-24 16:50 ` Nathan Lynch
2020-07-24 16:50 ` Nathan Lynch
2020-07-23 14:41 ` [PATCHv3 1/2] powerpc/pseries: group lmb operation and memblock's Nathan Lynch
2020-07-23 14:41 ` Nathan Lynch
2020-07-28 6:39 ` Pingfan Liu
2020-07-28 6:39 ` Pingfan Liu
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=875zaeravl.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=hbathini@linux.ibm.com \
--cc=kernelfans@gmail.com \
--cc=kexec@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.