linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, nfont@linux.vnet.ibm.com
Subject: Re: [FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest
Date: Thu, 17 Aug 2017 15:28:20 +0530	[thread overview]
Message-ID: <20170817095820.GA18925@in.ibm.com> (raw)
In-Reply-To: <87valuxzqb.fsf@linux.vnet.ibm.com>

On Fri, Aug 11, 2017 at 02:12:04PM +0530, Aneesh Kumar K.V wrote:
> Bharata B Rao <bharata@linux.vnet.ibm.com> writes:
> 
> > For a PowerKVM guest, it is possible to specify a DIMM device in
> > addition to the system RAM at boot time. When such a cold plugged DIMM
> > device is removed from a radix guest, we hit the following warning in the
> > guest kernel resulting in the eventual failure of memory unplug:
> >
> > remove_pud_table: unaligned range
> > WARNING: CPU: 3 PID: 164 at arch/powerpc/mm/pgtable-radix.c:597 remove_pagetable+0x468/0xca0
> > Call Trace:
> > remove_pagetable+0x464/0xca0 (unreliable)
> > radix__remove_section_mapping+0x24/0x40
> > remove_section_mapping+0x28/0x60
> > arch_remove_memory+0xcc/0x120
> > remove_memory+0x1ac/0x270
> > dlpar_remove_lmb+0x1ac/0x210
> > dlpar_memory+0xbc4/0xeb0
> > pseries_hp_work_fn+0x1a4/0x230
> > process_one_work+0x1cc/0x660
> > worker_thread+0xac/0x6d0
> > kthread+0x16c/0x1b0
> > ret_from_kernel_thread+0x5c/0x74
> >
> > The DIMM memory that is cold plugged gets merged to the same memblock
> > region as RAM and hence gets mapped at 1G alignment. However since the
> > removal is done for one LMB (lmb size 256MB) at a time, the address
> > of the LMB (which is 256MB aligned) would get flagged as unaligned
> > in remove_pud_table() resulting in the above failure.
> >
> > This problem is not seen for hot plugged memory because for the
> > hot plugged memory, the mappings are created separately for each
> > LMB and hence they all get aligned at 256MB.
> >
> > To fix this problem for the cold plugged memory, let us mark the
> > cold plugged memblock region explicitly as HOTPLUGGED so that the
> > region doesn't get merged with RAM. All the memory that is discovered
> > via ibm,dynamic-memory-configuration is marked so(1). Next identify
> > such regions in radix_init_pgtable() and create separate mappings
> > within that region for each LMB so that they get don't get aligned
> > like RAM region at 1G (2).
> >
> > (1) For PowerKVM guests, all boot time memory is represented via
> > memory@XXXX nodes and hot plugged/pluggable memory is represented via
> > ibm,dynamic-memory-reconfiguration property. We are marking all
> > hotplugged memory that is in ASSIGNED state during boot as HOTPLUGGED.
> > With this only cold plugged memory gets marked for PowerKVM but
> > need to check how this will affect PowerVM guests.
> 
> Can you verify this on PowerVM too ? ie we should in most case not find
> anything under ibm,dynamic-memory-reconfiguration ?

Checked with a couple of PowerVM systems. Look like except for RMA which
is represented by memory@0, rest of the memory is coming under
ibm,dynamic-memory-reconfiguration. So the approach I have taken in this
fix wouldn't be optimal on PowerVM ?

Regards,
Bharata.

  reply	other threads:[~2017-08-17  9:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10  9:23 [FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest Bharata B Rao
2017-08-10 16:50 ` Reza Arbab
2017-08-10 20:38   ` Reza Arbab
2017-08-11  8:37   ` Aneesh Kumar K.V
2017-08-11 16:28     ` Reza Arbab
2017-08-11  8:42 ` Aneesh Kumar K.V
2017-08-17  9:58   ` Bharata B Rao [this message]
2017-09-01  6:53 ` Bharata B Rao
2017-09-01 14:11   ` Nathan Fontenot
2017-09-05  4:20     ` Bharata B Rao

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=20170817095820.GA18925@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=nfont@linux.vnet.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;
as well as URLs for NNTP newsgroup(s).