[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210716060958.GA2197@PWN>
Date: Fri, 16 Jul 2021 02:09:58 -0400
From: Peilin Ye <yepeilin.cs@...il.com>
To: x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Jonathan Corbet <corbet@....net>
Cc: "H. Peter Anvin" <hpa@...or.com>, Joerg Roedel <jroedel@...e.de>,
Cong Wang <xiyou.wangcong@...il.com>,
Zefang Han <hanzefang@...il.com>,
Wei Lin Chang <r09922117@...e.ntu.edu.tw>,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH] docs: x86: Remove obsolete information about x86_64
vmalloc() faulting
Hi all,
> diff --git a/Documentation/x86/x86_64/mm.rst b/Documentation/x86/x86_64/mm.rst
> index ede1875719fb..9798676bb0bf 100644
> --- a/Documentation/x86/x86_64/mm.rst
> +++ b/Documentation/x86/x86_64/mm.rst
> @@ -140,10 +140,6 @@ The direct mapping covers all memory in the system up to the highest
> memory address (this means in some cases it can also include PCI memory
> holes).
>
> -vmalloc space is lazily synchronized into the different PML4/PML5 pages of
> -the processes using the page fault handler, with init_top_pgt as
> -reference.
This information is out-of-date, and it took me quite some time of
ftrace'ing before I figured it out... I think it would be beneficial to
update, or at least remove it.
As a proof that I understand what I am talking about, on my x86_64 box:
1. I allocated a vmalloc() area containing linear address `addr`;
2. I manually pagewalked `addr` in different page tables, including
`init_mm.pgd`;
3. The corresponding PGD entries for `addr` in different page tables,
they all immediately pointed at the same PUD table (my box uses
4-level paging), at the same physical address;
4. No "lazy synchronization" via page fault handling happened at all,
since it is the same PUD table pre-allocated by
preallocate_vmalloc_pages() during boot time.
Commit 6eb82f994026 ("x86/mm: Pre-allocate P4D/PUD pages for vmalloc
area") documented this clearly:
"""
Doing this at boot makes sure no synchronization of that area is
necessary at runtime.
"""
Should we remove this sentence, or update it? Any ideas?
Sincerely,
Peilin Ye
Powered by blists - more mailing lists