Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-26 Thread Michal Hocko
On Tue 25-09-18 13:21:24, Alexander Duyck wrote: > The ZONE_DEVICE pages were being initialized in two locations. One was with > the memory_hotplug lock held and another was outside of that lock. The > problem with this is that it was nearly doubling the memory initialization > time. Instead of doi

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-26 Thread Alexander Duyck
On 9/26/2018 12:55 AM, Michal Hocko wrote: On Tue 25-09-18 13:21:24, Alexander Duyck wrote: The ZONE_DEVICE pages were being initialized in two locations. One was with the memory_hotplug lock held and another was outside of that lock. The problem with this is that it was nearly doubling the m

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-26 Thread Dan Williams
On Wed, Sep 26, 2018 at 11:25 AM Alexander Duyck wrote: > > > > On 9/26/2018 12:55 AM, Michal Hocko wrote: > > On Tue 25-09-18 13:21:24, Alexander Duyck wrote: > >> The ZONE_DEVICE pages were being initialized in two locations. One was with > >> the memory_hotplug lock held and another was outside

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Michal Hocko
On Wed 26-09-18 11:25:37, Alexander Duyck wrote: > > > On 9/26/2018 12:55 AM, Michal Hocko wrote: > > On Tue 25-09-18 13:21:24, Alexander Duyck wrote: > > > The ZONE_DEVICE pages were being initialized in two locations. One was > > > with > > > the memory_hotplug lock held and another was outsid

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Michal Hocko
On Wed 26-09-18 11:52:56, Dan Williams wrote: [...] > Could we push the hotplug lock deeper to the places that actually need > it? What I found with my initial investigation is that we don't even > need the hotplug lock for the vmemmap initialization with this patch > [1]. Yes, the scope of the ho

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Oscar Salvador
On Thu, Sep 27, 2018 at 01:09:26PM +0200, Michal Hocko wrote: > > So there were a few things I wasn't sure we could pull outside of the > > hotplug lock. One specific example is the bits related to resizing the pgdat > > and zone. I wanted to avoid pulling those bits outside of the hotplug lock. >

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Oscar Salvador
On Wed, Sep 26, 2018 at 11:25:37AM -0700, Alexander Duyck wrote: > With that said I am open to suggestions if you still feel like I need to > follow this up with some additional work. I just want to avoid introducing > any regressions in regards to functionality or performance. Hi Alexander, the

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Michal Hocko
On Thu 27-09-18 14:25:37, Oscar Salvador wrote: > On Thu, Sep 27, 2018 at 01:09:26PM +0200, Michal Hocko wrote: > > > So there were a few things I wasn't sure we could pull outside of the > > > hotplug lock. One specific example is the bits related to resizing the > > > pgdat > > > and zone. I wan

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread Oscar Salvador
On Thu, Sep 27, 2018 at 03:13:29PM +0200, Michal Hocko wrote: > On Thu 27-09-18 14:25:37, Oscar Salvador wrote: > > On Thu, Sep 27, 2018 at 01:09:26PM +0200, Michal Hocko wrote: > > > > So there were a few things I wasn't sure we could pull outside of the > > > > hotplug lock. One specific example

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-27 Thread David Hildenbrand
On 27/09/2018 16:50, Oscar Salvador wrote: > On Thu, Sep 27, 2018 at 03:13:29PM +0200, Michal Hocko wrote: >> On Thu 27-09-18 14:25:37, Oscar Salvador wrote: >>> On Thu, Sep 27, 2018 at 01:09:26PM +0200, Michal Hocko wrote: > So there were a few things I wasn't sure we could pull outside of the

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-28 Thread Oscar Salvador
On Thu, Sep 27, 2018 at 03:13:29PM +0200, Michal Hocko wrote: > I would have to double check but is the hotplug lock really serializing > access to the state initialized by init_currently_empty_zone? E.g. > zone_start_pfn is a nice example of a state that is used outside of the > lock. zone's free

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-28 Thread Oscar Salvador
On Fri, Sep 28, 2018 at 10:12:24AM +0200, Oscar Salvador wrote: > Although I am not sure about leaving memmap_init_zone unprotected. > For the normal memory, that is not a problem since the memblock's lock > protects us from touching the same pages at the same time in > online/offline_pages, > but

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-09-28 Thread Dan Williams
On Fri, Sep 28, 2018 at 1:45 AM Oscar Salvador wrote: > > On Fri, Sep 28, 2018 at 10:12:24AM +0200, Oscar Salvador wrote: > > Although I am not sure about leaving memmap_init_zone unprotected. > > For the normal memory, that is not a problem since the memblock's lock > > protects us from touching

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Dan Williams
On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck wrote: > > The ZONE_DEVICE pages were being initialized in two locations. One was with > the memory_hotplug lock held and another was outside of that lock. The > problem with this is that it was nearly doubling the memory initialization > time. Inste

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Alexander Duyck
On 10/8/2018 2:01 PM, Dan Williams wrote: On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck wrote: The ZONE_DEVICE pages were being initialized in two locations. One was with the memory_hotplug lock held and another was outside of that lock. The problem with this is that it was nearly doubling t

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Dan Williams
On Mon, Oct 8, 2018 at 2:48 PM Alexander Duyck wrote: > > On 10/8/2018 2:01 PM, Dan Williams wrote: > > On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck > > wrote: > >> > >> The ZONE_DEVICE pages were being initialized in two locations. One was with > >> the memory_hotplug lock held and another wa

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Alexander Duyck
On 10/8/2018 3:00 PM, Dan Williams wrote: On Mon, Oct 8, 2018 at 2:48 PM Alexander Duyck wrote: On 10/8/2018 2:01 PM, Dan Williams wrote: On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck wrote: The ZONE_DEVICE pages were being initialized in two locations. One was with the memory_hotplug

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Alexander Duyck
On 10/8/2018 3:00 PM, Dan Williams wrote: On Mon, Oct 8, 2018 at 2:48 PM Alexander Duyck wrote: On 10/8/2018 2:01 PM, Dan Williams wrote: On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck wrote: The ZONE_DEVICE pages were being initialized in two locations. One was with the memory_hotplug

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-08 Thread Dan Williams
On Mon, Oct 8, 2018 at 3:37 PM Alexander Duyck wrote: > > > > On 10/8/2018 3:00 PM, Dan Williams wrote: > > On Mon, Oct 8, 2018 at 2:48 PM Alexander Duyck > > wrote: > >> > >> On 10/8/2018 2:01 PM, Dan Williams wrote: > >>> On Tue, Sep 25, 2018 at 1:29 PM Alexander Duyck > >>> wrote: > > >>

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-09 Thread Yi Zhang
On 2018-09-25 at 13:21:24 -0700, Alexander Duyck wrote: > The ZONE_DEVICE pages were being initialized in two locations. One was with > the memory_hotplug lock held and another was outside of that lock. The > problem with this is that it was nearly doubling the memory initialization > time. Instead

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-09 Thread Dan Williams
On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang wrote: > > On 2018-09-25 at 13:21:24 -0700, Alexander Duyck wrote: > > The ZONE_DEVICE pages were being initialized in two locations. One was with > > the memory_hotplug lock held and another was outside of that lock. The > > problem with this is that it was

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-09 Thread Alexander Duyck
On 10/9/2018 11:04 AM, Dan Williams wrote: On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang wrote: On 2018-09-25 at 13:21:24 -0700, Alexander Duyck wrote: The ZONE_DEVICE pages were being initialized in two locations. One was with the memory_hotplug lock held and another was outside of that lock. The

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-09 Thread Dan Williams
On Tue, Oct 9, 2018 at 1:34 PM Alexander Duyck wrote: > > On 10/9/2018 11:04 AM, Dan Williams wrote: > > On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang wrote: [..] > > That comment is incorrect, device-pages are never onlined. So I think > > we can just skip that call to __SetPageReserved() unless the m

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-09 Thread Yi Zhang
On 2018-10-09 at 14:19:32 -0700, Dan Williams wrote: > On Tue, Oct 9, 2018 at 1:34 PM Alexander Duyck > wrote: > > > > On 10/9/2018 11:04 AM, Dan Williams wrote: > > > On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang > > > wrote: > [..] > > > That comment is incorrect, device-pages are never onlined. So

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Michal Hocko
On Tue 09-10-18 13:26:41, Alexander Duyck wrote: [...] > I would think with that being the case we still probably need the call to > __SetPageReserved to set the bit with the expectation that it will not be > cleared for device-pages since the pages are not onlined. Removing the call > to __SetPage

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Alexander Duyck
On 10/10/2018 5:52 AM, Yi Zhang wrote: On 2018-10-09 at 14:19:32 -0700, Dan Williams wrote: On Tue, Oct 9, 2018 at 1:34 PM Alexander Duyck wrote: On 10/9/2018 11:04 AM, Dan Williams wrote: On Tue, Oct 9, 2018 at 3:21 AM Yi Zhang wrote: [..] That comment is incorrect, device-pages are n

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Alexander Duyck
On 10/10/2018 2:58 AM, Michal Hocko wrote: On Tue 09-10-18 13:26:41, Alexander Duyck wrote: [...] I would think with that being the case we still probably need the call to __SetPageReserved to set the bit with the expectation that it will not be cleared for device-pages since the pages are not o

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Michal Hocko
On Wed 10-10-18 09:39:08, Alexander Duyck wrote: > On 10/10/2018 2:58 AM, Michal Hocko wrote: > > On Tue 09-10-18 13:26:41, Alexander Duyck wrote: > > [...] > > > I would think with that being the case we still probably need the call to > > > __SetPageReserved to set the bit with the expectation th

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Alexander Duyck
On 10/10/2018 10:24 AM, Michal Hocko wrote: On Wed 10-10-18 09:39:08, Alexander Duyck wrote: On 10/10/2018 2:58 AM, Michal Hocko wrote: On Tue 09-10-18 13:26:41, Alexander Duyck wrote: [...] I would think with that being the case we still probably need the call to __SetPageReserved to set t

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Michal Hocko
On Wed 10-10-18 10:39:01, Alexander Duyck wrote: > > > On 10/10/2018 10:24 AM, Michal Hocko wrote: > > On Wed 10-10-18 09:39:08, Alexander Duyck wrote: > > > On 10/10/2018 2:58 AM, Michal Hocko wrote: > > > > On Tue 09-10-18 13:26:41, Alexander Duyck wrote: > > > > [...] > > > > > I would think w

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Alexander Duyck
On 10/10/2018 10:53 AM, Michal Hocko wrote: On Wed 10-10-18 10:39:01, Alexander Duyck wrote: On 10/10/2018 10:24 AM, Michal Hocko wrote: On Wed 10-10-18 09:39:08, Alexander Duyck wrote: On 10/10/2018 2:58 AM, Michal Hocko wrote: On Tue 09-10-18 13:26:41, Alexander Duyck wrote: [...] I woul

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Dan Williams
On Wed, Oct 10, 2018 at 10:30 AM Michal Hocko wrote: > > On Wed 10-10-18 09:39:08, Alexander Duyck wrote: > > On 10/10/2018 2:58 AM, Michal Hocko wrote: > > > On Tue 09-10-18 13:26:41, Alexander Duyck wrote: > > > [...] > > > > I would think with that being the case we still probably need the call

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Michal Hocko
On Wed 10-10-18 10:39:01, Alexander Duyck wrote: > On 10/10/2018 10:24 AM, Michal Hocko wrote: [...] > > I thought I have already made it clear that these zone device hacks are > > not acceptable to the generic hotplug code. If the current reserve bit > > handling is not correct then give us a spec

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Yi Zhang
On 2018-10-10 at 08:27:58 -0700, Alexander Duyck wrote: > > > On 10/10/2018 5:52 AM, Yi Zhang wrote: > >On 2018-10-09 at 14:19:32 -0700, Dan Williams wrote: > >>On Tue, Oct 9, 2018 at 1:34 PM Alexander Duyck > >> wrote: > >>> > >>>On 10/9/2018 11:04 AM, Dan Williams wrote: > On Tue, Oct 9, 20

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-10 Thread Yi Zhang
On 2018-10-10 at 11:18:49 -0700, Dan Williams wrote: > On Wed, Oct 10, 2018 at 10:30 AM Michal Hocko wrote: > > > > On Wed 10-10-18 09:39:08, Alexander Duyck wrote: > > > On 10/10/2018 2:58 AM, Michal Hocko wrote: > > > > On Tue 09-10-18 13:26:41, Alexander Duyck wrote: > > > > [...] > > > > > I w

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-11 Thread Michal Hocko
On Wed 10-10-18 20:52:42, Michal Hocko wrote: [...] > My recollection was that we do clear the reserved bit in > move_pfn_range_to_zone and we indeed do in __init_single_page. But then > we set the bit back right afterwards. This seems to be the case since > d0dc12e86b319 which reorganized the code

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-11 Thread Alexander Duyck
On 10/11/2018 1:39 AM, Yi Zhang wrote: On 2018-10-10 at 11:18:49 -0700, Dan Williams wrote: On Wed, Oct 10, 2018 at 10:30 AM Michal Hocko wrote: On Wed 10-10-18 09:39:08, Alexander Duyck wrote: On 10/10/2018 2:58 AM, Michal Hocko wrote: On Tue 09-10-18 13:26:41, Alexander Duyck wrote: [...]

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-11 Thread Alexander Duyck
On 10/11/2018 1:55 AM, Michal Hocko wrote: On Wed 10-10-18 20:52:42, Michal Hocko wrote: [...] My recollection was that we do clear the reserved bit in move_pfn_range_to_zone and we indeed do in __init_single_page. But then we set the bit back right afterwards. This seems to be the case since d0

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-11 Thread Dan Williams
On Thu, Oct 11, 2018 at 10:39 AM Alexander Duyck wrote: > > On 10/11/2018 1:55 AM, Michal Hocko wrote: > > On Wed 10-10-18 20:52:42, Michal Hocko wrote: > > [...] > >> My recollection was that we do clear the reserved bit in > >> move_pfn_range_to_zone and we indeed do in __init_single_page. But t

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-17 Thread Michal Hocko
On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > On 10/11/2018 1:55 AM, Michal Hocko wrote: > > On Wed 10-10-18 20:52:42, Michal Hocko wrote: > > [...] > > > My recollection was that we do clear the reserved bit in > > > move_pfn_range_to_zone and we indeed do in __init_single_page. But then > >

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-17 Thread Alexander Duyck
On 10/17/2018 12:52 AM, Michal Hocko wrote: On Thu 11-10-18 10:38:39, Alexander Duyck wrote: On 10/11/2018 1:55 AM, Michal Hocko wrote: On Wed 10-10-18 20:52:42, Michal Hocko wrote: [...] My recollection was that we do clear the reserved bit in move_pfn_range_to_zone and we indeed do in __init

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Wed 17-10-18 08:02:20, Alexander Duyck wrote: > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > > > On 10/11/2018 1:55 AM, Michal Hocko wrote: > > > > On Wed 10-10-18 20:52:42, Michal Hocko wrote: > > > > [...] > > > > > My recollection was that

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Dan Williams
On Wed, Oct 17, 2018 at 8:02 AM Alexander Duyck wrote: > > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > >> On 10/11/2018 1:55 AM, Michal Hocko wrote: > >>> On Wed 10-10-18 20:52:42, Michal Hocko wrote: > >>> [...] > My recollection was tha

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 08:49:46, Dan Williams wrote: > On Wed, Oct 17, 2018 at 8:02 AM Alexander Duyck > wrote: > > > > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > > On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > > >> On 10/11/2018 1:55 AM, Michal Hocko wrote: > > >>> On Wed 10-10-18 20:52:42, Mi

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Alexander Duyck
On Mon, 2018-10-29 at 15:12 +0100, Michal Hocko wrote: > On Wed 17-10-18 08:02:20, Alexander Duyck wrote: > > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > > On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > > > > On 10/11/2018 1:55 AM, Michal Hocko wrote: > > > > > On Wed 10-10-18 20:52:42, Mic

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 08:59:34, Alexander Duyck wrote: > On Mon, 2018-10-29 at 15:12 +0100, Michal Hocko wrote: > > On Wed 17-10-18 08:02:20, Alexander Duyck wrote: > > > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > > > On Thu 11-10-18 10:38:39, Alexander Duyck wrote: > > > > > On 10/11/2018 1:55 AM,

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Alexander Duyck
On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: > On Mon 29-10-18 08:59:34, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 15:12 +0100, Michal Hocko wrote: > > > On Wed 17-10-18 08:02:20, Alexander Duyck wrote: > > > > On 10/17/2018 12:52 AM, Michal Hocko wrote: > > > > > On Thu 11-10-18 1

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: > > On Mon 29-10-18 08:59:34, Alexander Duyck wrote: [...] > > > So for example the call "online_pages_range" doesn't invoke the > > > online_page_callback unless the first pfn in the range is

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Dan Williams
On Mon, Oct 29, 2018 at 10:24 AM Michal Hocko wrote: > > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: [..] > > > You are already doing per-page initialization so I fail to see a larger > > > unit to operate on. > > > > I have a patch t

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Alexander Duyck
On Mon, 2018-10-29 at 18:24 +0100, Michal Hocko wrote: > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: > > > On Mon 29-10-18 08:59:34, Alexander Duyck wrote: > > [...] > > > > So for example the call "online_pages_range" doesn't invoke

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 10:34:22, Dan Williams wrote: > On Mon, Oct 29, 2018 at 10:24 AM Michal Hocko wrote: > > > > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > > > On Mon, 2018-10-29 at 17:35 +0100, Michal Hocko wrote: > [..] > > > > You are already doing per-page initialization so I fail to see a

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 10:42:33, Alexander Duyck wrote: > On Mon, 2018-10-29 at 18:24 +0100, Michal Hocko wrote: > > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: [...] > > > So there end up being a few different issues with constructors. First > > > in my mind is that it means we have to initialize th

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Alexander Duyck
On Mon, 2018-10-29 at 19:18 +0100, Michal Hocko wrote: > On Mon 29-10-18 10:42:33, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 18:24 +0100, Michal Hocko wrote: > > > On Mon 29-10-18 10:01:28, Alexander Duyck wrote: > > [...] > > > > So there end up being a few different issues with constructo

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-29 Thread Michal Hocko
On Mon 29-10-18 12:59:11, Alexander Duyck wrote: > On Mon, 2018-10-29 at 19:18 +0100, Michal Hocko wrote: [...] I will try to get to your other points later. > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 89d2a2ab3fe6..048e4cc72fdf 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-30 Thread Dan Williams
On Mon, Oct 29, 2018 at 11:29 PM Michal Hocko wrote: > > On Mon 29-10-18 12:59:11, Alexander Duyck wrote: > > On Mon, 2018-10-29 at 19:18 +0100, Michal Hocko wrote: [..] > > The patches Andrew pushed addressed the immediate issue so that now > > systems with nvdimm/DAX memory can at least initiali

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-30 Thread Oscar Salvador
> Yes, the hotplug lock was part of the original issue. However that > starts to drift into the area I believe Oscar was working on as a part > of his patch set in encapsulating the move_pfn_range_to_zone and other > calls that were contained in the hotplug lock into their own functions. While re

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-30 Thread Michal Hocko
On Mon 29-10-18 23:55:12, Dan Williams wrote: > On Mon, Oct 29, 2018 at 11:29 PM Michal Hocko wrote: > > > > On Mon 29-10-18 12:59:11, Alexander Duyck wrote: > > > On Mon, 2018-10-29 at 19:18 +0100, Michal Hocko wrote: > [..] > > > The patches Andrew pushed addressed the immediate issue so that no

Re: [PATCH v5 4/4] mm: Defer ZONE_DEVICE page initialization to the point where we init pgmap

2018-10-30 Thread Dan Williams
On Tue, Oct 30, 2018 at 1:18 AM Michal Hocko wrote: > > On Mon 29-10-18 23:55:12, Dan Williams wrote: > > On Mon, Oct 29, 2018 at 11:29 PM Michal Hocko wrote: [..] > > That testing identified this initialization performance problem and > > thankfully got it addressed in time for the current merge