Messages in this thread | | | From | Linus Walleij <> | Date | Tue, 15 Aug 2023 10:51:24 +0200 | Subject | Re: [PATCH v2] Documentation/page_tables: Add info about MMU/TLB and Page Faults |
| |
Hi Fabio,
overall this v2 looks good!
The below are my grammar and spelling nitpicks.
On Sun, Aug 13, 2023 at 8:25 PM Fabio M. De Francesco <fmdefrancesco@gmail.com> wrote:
> Extend page_tables.rst by adding a section about the role of MMU and TLB > in translating between virtual addresses and physical page frames. > Furthermore explain the concept behind Page Faults and how the Linux > kernel handles TLB misses. Finally briefly explain how and why to disable > the page faults handler. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: Ira Weiny <ira.weiny@intel.com> > Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Matthew Wilcox <willy@infradead.org> > Cc: Mike Rapoport <rppt@kernel.org> > Cc: Randy Dunlap <rdunlap@infradead.org> > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> (...) > +If the above-mentioned conditions happen in user-space, the kernel sends a > +`Segmentation Fault` (SIGSEGV) signal to the current thread. That signal usually > +causes the termination of the thread and of the process it belongs to. > + > +Instead, there are also common and expected other causes of page faults. These
The word you are looking for is "Additionally" right?
"Additionally, there are..."
> +These techniques improve memory efficiency, reduce latency, and minimize space > +occupation. This document won't go deeper into the details of "Lazy Allocation" > +and "Copy-on-Write" because these subjects are out of scope for they belong to
"for they belong" -> "as they belong" (I think)
> +Swapping differentiate itself from the other mentioned techniques because it's
differentiates
> +not so desirable since it's performed as a means to reduce memory under heavy > +pressure.
"not so desirable" -> "undesirable"
> +Swapping can't work for memory mapped by kernel logical addresses. These are a
"kernel logical addresses" -> "kernel-internal logical addresses"
> +If everything fails to make room for the data that must reside be present in
"If everything fails" -> "If the kernel fails"
> +This document is going to simplify and show an high altitude view of how the > +Linux kernel handles these page faults, creates tables and tables' entries, > +check if memory is present and, if not, requests to load data from persistent > +storage or from other devices, and updates the MMU and its caches...
Skip "..." for just period "."
> +The first steps are architectures dependent. Most architectures jump to
architectures -> architecture
> +Whatever the routes, all architectures end up to the invocation of > +`handle_mm_fault()` which, in turn, (likely) ends up calling > +`__handle_mm_fault()` to carry out the actual work of allocation of the page > +tables.
"of allocation of the" -> "of allocating the"
> +`__handle_mm_fault()` carries out its work by calling several functions to > +find the entry's offsets of the upper layers of the page tables and allocate > +the tables that it may need to.
Skip the last "to".
> +Linux supports larger page sizes than the usual 4KB (i.e., the so called > +`huge pages`). When using these kinds of larger pages, higher level pages can > +directly map them, with no need to use lower level page entries (PTE). Huge > +pages contain large contiguos physical regions that usually span from 2MB to
contiguous
> +The huge pages bring with them several benefits like reduced TLB pressure, > +reduced page table overhead, memory allocation efficiency, and performance > +improvement for certain workloads. However, these benefits come with > +trade-offs, like wasted memory and allocation challenges. Huge pages are out > +of scope of the present document, therefore, it won't go into further details.
Since you explain what they are, it feels they are in scope? I would just skip the last sentence.
> +To conclude this brief overview from very high altitude of how Linux handles
To conclude this high altitude view of...
> +Several code path make use of the latter two functions because they need to
code paths
With or without the above suggestions: Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours, Linus Walleij
| |