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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Aug 2018 09:38:35 +0200
From:   Oscar Salvador <osalvador@...hadventures.net>
To:     Jerome Glisse <jglisse@...hat.com>
Cc:     David Hildenbrand <david@...hat.com>, akpm@...ux-foundation.org,
        mhocko@...e.com, dan.j.williams@...el.com,
        pasha.tatashin@...cle.com, yasu.isimatu@...il.com,
        logang@...tatee.com, dave.jiang@...el.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Oscar Salvador <osalvador@...e.de>
Subject: Re: [RFC PATCH 2/3] mm/memory_hotplug: Create __shrink_pages and
 move it to offline_pages

On Tue, Aug 07, 2018 at 06:13:45PM -0400, Jerome Glisse wrote:
> > And since we know for sure that memhotplug-code cannot call it with ZONE_DEVICE,
> > I think this can be done easily.
> 
> This might change down road but for now this is correct. They are
> talks to enumerate device memory through standard platform mechanisms
> and thus the kernel might see new types of resources down the road and
> maybe we will want to hotplug them directly from regular hotplug path
> as ZONE_DEVICE (lot of hypothetical at this point ;)).

Well, I think that if that happens this whole thing will become
much easier, since we will not have several paths for doing the same thing.

Another thing that I realized is that while we want to move all operation-pages
from remove_memory() path to offline_pages(), this can get tricky.

Unless I am missing something, the devices from HMM and devm are not being registered
against "memory_subsys" struct, and so, they never get to call memory_subsys_offline()
and so offline_pages().

Which means that we would have to call __remove_zone() from those paths.
But this alone will not work.

find_smallest/biggest_section_pfn are two functions that are being called from

shrink_pgdat_span
and
shrink_zone_span

to adjust zone_first_pfn/node_first_pfn and the spanned pages.

Currently, find_smallest/biggest_section_pfn checks for the secion to be valid,
and this is fine since we are removing those sections from the remove_memory path.

But if we want to move __remove_zone() to offline_pages(), we have to use
online_section() instead of valid_section().

This is all fine from offline_pages because the sections get offlined in:

__offline_pages
 offline_isolated_pages
  offline_isolated_pages_cb
   __offline_isolated_pages
    offline_mem_sections


But this does not happen in HMM/devm path.

I am pretty sure this is a dumb question, but why HMM/devm path
do not call online_pages/offline_pages?

Thanks
-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists