* Re: [v2 1/1] xen, mm: Allow deferred page initialization for xen pv domains
[not found] ` <20180226160112.24724-2-pasha.tatashin@oracle.com>
@ 2018-02-27 6:59 ` Ingo Molnar
2018-02-27 7:44 ` Juergen Gross
1 sibling, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2018-02-27 6:59 UTC (permalink / raw)
To: Pavel Tatashin
Cc: mhocko, virtualization, linux-mm, steven.sistare, hpa,
dan.j.williams, bhe, x86, akataria, daniel.m.jordan, mingo,
xen-devel, bp, minipli, jinb.park7, luto, boris.ostrovsky, vbabka,
jgross, labbott, linux-kernel, tglx, zhang.jia, hannes, akpm,
mgorman, kirill.shutemov
* Pavel Tatashin <pasha.tatashin@oracle.com> wrote:
> Juergen Gross noticed that commit
> f7f99100d8d ("mm: stop zeroing memory during allocation in vmemmap")
> broke XEN PV domains when deferred struct page initialization is enabled.
>
> This is because the xen's PagePinned() flag is getting erased from struct
> pages when they are initialized later in boot.
>
> Juergen fixed this problem by disabling deferred pages on xen pv domains.
> It is desirable, however, to have this feature available as it reduces boot
> time. This fix re-enables the feature for pv-dmains, and fixes the problem
> the following way:
>
> The fix is to delay setting PagePinned flag until struct pages for all
> allocated memory are initialized, i.e. until after free_all_bootmem().
>
> A new x86_init.hyper op init_after_bootmem() is called to let xen know
> that boot allocator is done, and hence struct pages for all the allocated
> memory are now initialized. If deferred page initialization is enabled, the
> rest of struct pages are going to be initialized later in boot once
> page_alloc_init_late() is called.
>
> xen_after_bootmem() walks page table's pages and marks them pinned.
>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
> ---
> arch/x86/include/asm/x86_init.h | 2 ++
> arch/x86/kernel/x86_init.c | 1 +
> arch/x86/mm/init_32.c | 1 +
> arch/x86/mm/init_64.c | 1 +
> arch/x86/xen/mmu_pv.c | 38 ++++++++++++++++++++++++++------------
> mm/page_alloc.c | 4 ----
> 6 files changed, 31 insertions(+), 16 deletions(-)
Acked-by: Ingo Molnar <mingo@kernel.org>
Thanks,
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [v2 1/1] xen, mm: Allow deferred page initialization for xen pv domains
[not found] ` <20180226160112.24724-2-pasha.tatashin@oracle.com>
2018-02-27 6:59 ` [v2 1/1] xen, mm: Allow deferred page initialization for xen pv domains Ingo Molnar
@ 2018-02-27 7:44 ` Juergen Gross
1 sibling, 0 replies; 2+ messages in thread
From: Juergen Gross @ 2018-02-27 7:44 UTC (permalink / raw)
To: Pavel Tatashin, steven.sistare, daniel.m.jordan, akataria, tglx,
mingo, hpa, x86, boris.ostrovsky, akpm, mhocko, vbabka, luto,
labbott, kirill.shutemov, bp, minipli, jinb.park7, dan.j.williams,
bhe, zhang.jia, mgorman, hannes, virtualization, linux-kernel,
xen-devel, linux-mm
On 26/02/18 17:01, Pavel Tatashin wrote:
> Juergen Gross noticed that commit
> f7f99100d8d ("mm: stop zeroing memory during allocation in vmemmap")
> broke XEN PV domains when deferred struct page initialization is enabled.
>
> This is because the xen's PagePinned() flag is getting erased from struct
> pages when they are initialized later in boot.
>
> Juergen fixed this problem by disabling deferred pages on xen pv domains.
> It is desirable, however, to have this feature available as it reduces boot
> time. This fix re-enables the feature for pv-dmains, and fixes the problem
> the following way:
>
> The fix is to delay setting PagePinned flag until struct pages for all
> allocated memory are initialized, i.e. until after free_all_bootmem().
>
> A new x86_init.hyper op init_after_bootmem() is called to let xen know
> that boot allocator is done, and hence struct pages for all the allocated
> memory are now initialized. If deferred page initialization is enabled, the
> rest of struct pages are going to be initialized later in boot once
> page_alloc_init_late() is called.
>
> xen_after_bootmem() walks page table's pages and marks them pinned.
>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Verified to work on a system where the original issue caused a crash.
Reviewed-by: Juergen Gross <jgross@suse.com>
Tested-by: Juergen Gross <jgross@suse.com>
Juergen
^ permalink raw reply [flat|nested] 2+ messages in thread