Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Dan Williams
On Wed, Jan 22, 2020 at 11:09 AM Michal Hocko wrote: > > On Wed 22-01-20 19:46:15, David Hildenbrand wrote: > > On 22.01.20 19:38, Michal Hocko wrote: > [...] > > > How exactly is check + offline more optimal then offline which makes > > > check as its first step? I will get to your later points

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Michal Hocko
On Wed 22-01-20 19:46:15, David Hildenbrand wrote: > On 22.01.20 19:38, Michal Hocko wrote: [...] > > How exactly is check + offline more optimal then offline which makes > > check as its first step? I will get to your later points after this is > > clarified. > > Scanning (almost) lockless is

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Michal Hocko
On Wed 22-01-20 19:15:47, David Hildenbrand wrote: [...] > c) CC relevant people I identify (lsmem/chmem/powerpc-utils/etc.) on the > patch to see if we are missing other use cases/users/implications. > > Sounds like a plan? I would start with this step. Thanks! -- Michal Hocko SUSE Labs

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 19:38, Michal Hocko wrote: > On Wed 22-01-20 19:15:47, David Hildenbrand wrote: >> On 22.01.20 17:46, Michal Hocko wrote: >>> On Wed 22-01-20 12:58:16, David Hildenbrand wrote: > [...] Especially interesting for IBM z Systems, whereby memory onlining/offlining will trigger

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Michal Hocko
On Wed 22-01-20 19:15:47, David Hildenbrand wrote: > On 22.01.20 17:46, Michal Hocko wrote: > > On Wed 22-01-20 12:58:16, David Hildenbrand wrote: [...] > >> Especially interesting for IBM z Systems, whereby memory > >> onlining/offlining will trigger the actual population of memory in the > >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 17:46, Michal Hocko wrote: > On Wed 22-01-20 12:58:16, David Hildenbrand wrote: >> On 22.01.20 11:54, David Hildenbrand wrote: >>> On 22.01.20 11:42, Michal Hocko wrote: On Wed 22-01-20 11:39:08, David Hildenbrand wrote: Really, the interface is flawed and should have

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Michal Hocko
On Wed 22-01-20 12:58:16, David Hildenbrand wrote: > On 22.01.20 11:54, David Hildenbrand wrote: > > On 22.01.20 11:42, Michal Hocko wrote: > >> On Wed 22-01-20 11:39:08, David Hildenbrand wrote: > >> Really, the interface is flawed and should have never been merged in > >> the > >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 11:54, David Hildenbrand wrote: > On 22.01.20 11:42, Michal Hocko wrote: >> On Wed 22-01-20 11:39:08, David Hildenbrand wrote: >> Really, the interface is flawed and should have never been merged in the >> first place. We cannot simply remove it altogether I am afraid so let's

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 11:42, Michal Hocko wrote: > On Wed 22-01-20 11:39:08, David Hildenbrand wrote: > Really, the interface is flawed and should have never been merged in the > first place. We cannot simply remove it altogether I am afraid so let's > at least remove the bogus code and pretend

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread Michal Hocko
On Wed 22-01-20 11:39:08, David Hildenbrand wrote: > >>> Really, the interface is flawed and should have never been merged in the > >>> first place. We cannot simply remove it altogether I am afraid so let's > >>> at least remove the bogus code and pretend that the world is a better > >>> place

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
>>> Really, the interface is flawed and should have never been merged in the >>> first place. We cannot simply remove it altogether I am afraid so let's >>> at least remove the bogus code and pretend that the world is a better >>> place where everything is removable except the reality sucks... >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-21 Thread Michal Hocko
On Mon 20-01-20 10:14:44, David Hildenbrand wrote: > On 20.01.20 08:48, Michal Hocko wrote: > > On Fri 17-01-20 08:57:51, Dan Williams wrote: > > [...] > >> Unless the user is willing to hold the device_hotplug_lock over the > >> evaluation then the result is unreliable. > > > > Do we want to

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 10:14, David Hildenbrand wrote: > On 20.01.20 08:48, Michal Hocko wrote: >> On Fri 17-01-20 08:57:51, Dan Williams wrote: >> [...] >>> Unless the user is willing to hold the device_hotplug_lock over the >>> evaluation then the result is unreliable. >> >> Do we want to hold the

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 08:48, Michal Hocko wrote: > On Fri 17-01-20 08:57:51, Dan Williams wrote: > [...] >> Unless the user is willing to hold the device_hotplug_lock over the >> evaluation then the result is unreliable. > > Do we want to hold the device_hotplug_lock from this user readable file > in the

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-19 Thread Michal Hocko
On Fri 17-01-20 08:57:51, Dan Williams wrote: [...] > Unless the user is willing to hold the device_hotplug_lock over the > evaluation then the result is unreliable. Do we want to hold the device_hotplug_lock from this user readable file in the first place? My book says that this just waits to

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread Dan Williams
On Fri, Jan 17, 2020 at 8:11 AM David Hildenbrand wrote: > > On 17.01.20 16:54, Dan Williams wrote: > > On Fri, Jan 17, 2020 at 7:30 AM Michal Hocko wrote: > >> > >> On Fri 17-01-20 15:58:26, David Hildenbrand wrote: > >>> On 17.01.20 15:52, Michal Hocko wrote: > On Fri 17-01-20 14:08:06,

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 16:54, Dan Williams wrote: > On Fri, Jan 17, 2020 at 7:30 AM Michal Hocko wrote: >> >> On Fri 17-01-20 15:58:26, David Hildenbrand wrote: >>> On 17.01.20 15:52, Michal Hocko wrote: On Fri 17-01-20 14:08:06, David Hildenbrand wrote: > On 17.01.20 12:33, Michal Hocko wrote:

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread Dan Williams
On Fri, Jan 17, 2020 at 7:30 AM Michal Hocko wrote: > > On Fri 17-01-20 15:58:26, David Hildenbrand wrote: > > On 17.01.20 15:52, Michal Hocko wrote: > > > On Fri 17-01-20 14:08:06, David Hildenbrand wrote: > > >> On 17.01.20 12:33, Michal Hocko wrote: > > >>> On Fri 17-01-20 11:57:59, David

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread Michal Hocko
On Fri 17-01-20 15:58:26, David Hildenbrand wrote: > On 17.01.20 15:52, Michal Hocko wrote: > > On Fri 17-01-20 14:08:06, David Hildenbrand wrote: > >> On 17.01.20 12:33, Michal Hocko wrote: > >>> On Fri 17-01-20 11:57:59, David Hildenbrand wrote: > Let's refactor that code. We want to check

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 15:52, Michal Hocko wrote: > On Fri 17-01-20 14:08:06, David Hildenbrand wrote: >> On 17.01.20 12:33, Michal Hocko wrote: >>> On Fri 17-01-20 11:57:59, David Hildenbrand wrote: Let's refactor that code. We want to check if we can offline memory blocks. Add a new function

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread Michal Hocko
On Fri 17-01-20 14:08:06, David Hildenbrand wrote: > On 17.01.20 12:33, Michal Hocko wrote: > > On Fri 17-01-20 11:57:59, David Hildenbrand wrote: > >> Let's refactor that code. We want to check if we can offline memory > >> blocks. Add a new function is_mem_section_offlineable() for that and > >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 12:33, Michal Hocko wrote: > On Fri 17-01-20 11:57:59, David Hildenbrand wrote: >> Let's refactor that code. We want to check if we can offline memory >> blocks. Add a new function is_mem_section_offlineable() for that and >> make it call is_mem_section_offlineable() for each contained

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread Michal Hocko
On Fri 17-01-20 11:57:59, David Hildenbrand wrote: > Let's refactor that code. We want to check if we can offline memory > blocks. Add a new function is_mem_section_offlineable() for that and > make it call is_mem_section_offlineable() for each contained section. > Within