linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@techadventures.net>
To: akpm@linux-foundation.org
Cc: mhocko@suse.com, dan.j.williams@intel.com,
	yasu.isimatu@gmail.com, rppt@linux.vnet.ibm.com,
	malat@debian.org, linux-kernel@vger.kernel.org,
	pavel.tatashin@microsoft.com, jglisse@redhat.com,
	Jonathan.Cameron@huawei.com, rafael@kernel.org, david@redhat.com,
	dave.jiang@intel.com, linux-mm@kvack.org,
	alexander.h.duyck@linux.intel.com,
	Oscar Salvador <osalvador@suse.de>
Subject: [PATCH 0/5] Do not touch pages/zones during hot-remove path
Date: Mon, 15 Oct 2018 17:30:29 +0200	[thread overview]
Message-ID: <20181015153034.32203-1-osalvador@techadventures.net> (raw)

From: Oscar Salvador <osalvador@suse.de>

This patchset aims to solve [1] and [2] issues.
Due to the lack of feedback of previous versions, I decided to go safe,
so I reverted some of the changes I did in RFCv3:

 1) It is no longer based on [3], although the code would be easier and
    the changes less.

 2) hotplug lock stays in HMM/devm, mainly because I am not sure whether
    it is ok to leave the kasan calls out of lock or not.
    If we think that this can be done, the hotplug lock can be moved
    within add/del_device_memory, which would be nicer IMHO.

 3) Although I think that init_currently_empty_zone should be protected
    by the spanlock since it touches zone_start_pfn, I decided to leave
    it as it is right now.
    The main point of moving it within the lock was to be able to move
    move_pfn_range_to_zone out of the hotplug lock for HMM/devm code.
    
The main point of this patchset is to move all the page/zone handling
from the hot-remove path, back to the offlining stage.
In this way, we can better split up what each part does:

  * hot-add path:
    - Create a new resource for the hot-added memory
    - Create memory sections for the hot-added memory
    - Create the memblocks representing the hot-added memory

  * online path:
    - Re-adjust zone/pgdat nr of pages (managed, spanned, present)
    - Initialize the pages from the new memory-range
    - Online memory sections

  * offline path:
    - Offline memory sections
    - Re-adjust zone/pgdat nr of pages (managed, spanned, present)

  * hot-remove path:
    - Remove memory sections
    - Remove memblocks
    - Remove resources

So, hot-add/remove stages should only care about sections and memblocks.
While all the zone/page handling should belong to the online/offline stage.

Another thing is that for the sake of reviewability, I split the patchset
in 5 parts, but pathc3 could be combined into patch4.
 
This patchset is based on top of mmotm.

[1] https://patchwork.kernel.org/patch/10547445/
[2] https://www.spinics.net/lists/linux-mm/msg161316.html
[3] https://patchwork.kernel.org/cover/10613425/

Oscar Salvador (5):
  mm/memory_hotplug: Add nid parameter to arch_remove_memory
  mm/memory_hotplug: Create add/del_device_memory functions
  mm/memory_hotplug: Check for IORESOURCE_SYSRAM in
    release_mem_region_adjustable
  mm/memory_hotplug: Move zone/pages handling to offline stage
  mm/memory-hotplug: Rework unregister_mem_sect_under_nodes

 arch/ia64/mm/init.c            |   6 +-
 arch/powerpc/mm/mem.c          |  14 +---
 arch/s390/mm/init.c            |   2 +-
 arch/sh/mm/init.c              |   6 +-
 arch/x86/mm/init_32.c          |   6 +-
 arch/x86/mm/init_64.c          |  11 +---
 drivers/base/memory.c          |   9 ++-
 drivers/base/node.c            |  38 ++---------
 include/linux/memory.h         |   2 +-
 include/linux/memory_hotplug.h |  21 ++++--
 include/linux/node.h           |   9 ++-
 kernel/memremap.c              |  13 ++--
 kernel/resource.c              |  16 +++++
 mm/hmm.c                       |  35 +++++-----
 mm/memory_hotplug.c            | 142 +++++++++++++++++++++++++----------------
 mm/sparse.c                    |   6 +-
 16 files changed, 177 insertions(+), 159 deletions(-)

-- 
2.13.6


             reply	other threads:[~2018-10-15 15:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 15:30 Oscar Salvador [this message]
2018-10-15 15:30 ` [PATCH 1/5] mm/memory_hotplug: Add nid parameter to arch_remove_memory Oscar Salvador
2018-11-12 18:52   ` Pavel Tatashin
2018-10-15 15:30 ` [PATCH 2/5] mm/memory_hotplug: Create add/del_device_memory functions Oscar Salvador
2018-10-16  8:55   ` David Hildenbrand
2018-10-17  9:33     ` Oscar Salvador
2018-10-17  9:45       ` David Hildenbrand
2018-10-18  6:57         ` Oscar Salvador
2018-11-12 19:14   ` Pavel Tatashin
2018-11-12 19:21   ` Dan Williams
2018-11-12 21:28     ` Pavel Tatashin
2018-11-16 13:06       ` osalvador
2018-11-16 13:03     ` osalvador
2018-10-15 15:30 ` [PATCH 3/5] mm/memory_hotplug: Check for IORESOURCE_SYSRAM in release_mem_region_adjustable Oscar Salvador
2018-10-16  9:54   ` David Hildenbrand
2018-11-12 19:27   ` Pavel Tatashin
2018-10-15 15:30 ` [PATCH 4/5] mm/memory_hotplug: Move zone/pages handling to offline stage Oscar Salvador
2018-10-15 15:30 ` [PATCH 5/5] mm/memory-hotplug: Rework unregister_mem_sect_under_nodes Oscar Salvador
2018-10-18 14:24   ` Jonathan Cameron
2018-10-18 15:02     ` Oscar Salvador
2018-10-18 15:38       ` Jonathan Cameron

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=20181015153034.32203-1-osalvador@techadventures.net \
    --to=osalvador@techadventures.net \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=david@redhat.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=malat@debian.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=pavel.tatashin@microsoft.com \
    --cc=rafael@kernel.org \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=yasu.isimatu@gmail.com \
    --subject='Re: [PATCH 0/5] Do not touch pages/zones during hot-remove path' \
    /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

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