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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191031142933.10779-1-david@redhat.com>
Date:   Thu, 31 Oct 2019 15:29:21 +0100
From:   David Hildenbrand <david@...hat.com>
To:     linux-kernel@...r.kernel.org
Cc:     linux-mm@...ck.org, linuxppc-dev@...ts.ozlabs.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
        Alexander Potapenko <glider@...gle.com>,
        Alexey Kardashevskiy <aik@...abs.ru>,
        Allison Randal <allison@...utok.net>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
        Arun KS <arunks@...eaurora.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Christian Brauner <christian@...uner.io>,
        Dan Williams <dan.j.williams@...el.com>,
        David Howells <dhowells@...hat.com>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        Gao Xiang <xiang@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Greg Hackmann <ghackmann@...gle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Michael Ellerman <mpe@...erman.id.au>,
        Michal Hocko <mhocko@...e.com>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        "Oliver O'Halloran" <oohall@...il.com>,
        Oscar Salvador <osalvador@...e.de>,
        Paul Mackerras <paulus@...ba.org>,
        Pavel Tatashin <pasha.tatashin@...een.com>,
        Pingfan Liu <kernelfans@...il.com>, Qian Cai <cai@....pw>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Richard Fontana <rfontana@...hat.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Thiago Jung Bauermann <bauerman@...ux.ibm.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Todd Kjos <tkjos@...gle.com>, Vlastimil Babka <vbabka@...e.cz>,
        Wei Yang <richardw.yang@...ux.intel.com>
Subject: [PATCH v1 00/12] powerpc/pseries: CMM: Implement balloon compaction and remove isolate notifier

This is the follow-up of:
	https://lkml.org/lkml/2019/9/10/711

We can get rid of the memory isolate notifier by switching to balloon
compaction in powerpc's CMM (Collaborative Memory Management). The memory
isolate notifier was only necessary to allow to offline memory blocks that
contain inflated/"loaned" pages - which also possible when the inflated
pages are movable (via balloon compaction). Having movable pages implies
that memory will also no longer get fragmented when CMM is active.

While I do have access to a LPAR, it does not have CMM active and I have np
clue how to enable it. Instead, I implemented a simple simulation mode. I
did some tests and the whole infrastructure, including page migration,
seems to work fine (e.g., I can still offline memory blocks that contain
inflated pages). Of course, I cannot tell if HW will like the changes,
especially:

1. I now use page_to_phys() to come up with the addresses to report to
   the hypervisor. Hope that's correct.
2. When migrating a page, I first inflate/"loan" the new page and then
   deflate the old page. I have no idea if HW accepts to set pages loaned
   if it didn't request a loan. I assume it does.
3. We might now inflate/deflate pages in parallel (of course, not the
   same page). I have no idea if HW likes that.

It would be good if somebody could either point me at the spec of the
hypervisor interface or verify directly. Also, it would be good if somebody
could test with actual HW that has this feature.

Cc: Alexander Duyck <alexander.h.duyck@...ux.intel.com>
Cc: Alexander Potapenko <glider@...gle.com>
Cc: Alexey Kardashevskiy <aik@...abs.ru>
Cc: Allison Randal <allison@...utok.net>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Anshuman Khandual <anshuman.khandual@....com>
Cc: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: Arun KS <arunks@...eaurora.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Christian Brauner <christian@...uner.io>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: David Howells <dhowells@...hat.com>
Cc: "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc: Gao Xiang <xiang@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Greg Hackmann <ghackmann@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>
Cc: Mel Gorman <mgorman@...hsingularity.net>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Cc: "Oliver O'Halloran" <oohall@...il.com>
Cc: Oscar Salvador <osalvador@...e.de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Pavel Tatashin <pasha.tatashin@...een.com>
Cc: Pingfan Liu <kernelfans@...il.com>
Cc: Qian Cai <cai@....pw>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Richard Fontana <rfontana@...hat.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>
Cc: Thiago Jung Bauermann <bauerman@...ux.ibm.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Todd Kjos <tkjos@...gle.com>
Cc: Vlastimil Babka <vbabka@...e.cz>
Cc: Wei Yang <richardw.yang@...ux.intel.com>

David Hildenbrand (12):
  powerpc/pseries: CMM: Implement release() function for sysfs device
  powerpc/pseries: CMM: Report errors when registering notifiers fails
  powerpc/pseries: CMM: Cleanup rc handling in cmm_init()
  powerpc/pseries: CMM: Drop page array
  powerpc/pseries: CMM: Use adjust_managed_page_count() insted of
    totalram_pages_*
  powerpc/pseries: CMM: Rip out memory isolate notifier
  powerpc/pseries: CMM: Convert loaned_pages to an atomic_long_t
  powerpc/pseries: CMM: Implement balloon compaction
  powerpc/pseries: CMM: Switch to balloon_page_alloc()
  powerpc/pseries: CMM: Simulation mode
  mm: remove the memory isolate notifier
  mm: remove "count" parameter from has_unmovable_pages()

 arch/powerpc/platforms/pseries/Kconfig |   1 +
 arch/powerpc/platforms/pseries/cmm.c   | 430 +++++++++++--------------
 drivers/base/memory.c                  |  19 --
 include/linux/memory.h                 |  27 --
 include/linux/page-isolation.h         |   4 +-
 include/uapi/linux/magic.h             |   1 +
 mm/memory_hotplug.c                    |   2 +-
 mm/page_alloc.c                        |  21 +-
 mm/page_isolation.c                    |  27 +-
 9 files changed, 204 insertions(+), 328 deletions(-)

-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ