From: Linus Walleij <linus.walleij@linaro.org>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Mike Rapoport <rppt@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Ira Weiny <ira.weiny@intel.com>,
Matthew Wilcox <willy@infradead.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v2] Documentation/page_tables: Add info about MMU/TLB and Page Faults
Date: Tue, 15 Aug 2023 10:51:24 +0200 [thread overview]
Message-ID: <CACRpkdbq8UCtvtRH7FZUEqvTxPQcoGbrKvf_mT5QHMAfVoYNNQ@mail.gmail.com> (raw)
In-Reply-To: <20230813182552.31792-1-fmdefrancesco@gmail.com>
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
next prev parent reply other threads:[~2023-08-15 8:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-13 18:25 Fabio M. De Francesco
2023-08-15 8:51 ` Linus Walleij [this message]
2023-08-15 12:27 ` Fabio M. De Francesco
2023-08-15 12:58 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACRpkdbq8UCtvtRH7FZUEqvTxPQcoGbrKvf_mT5QHMAfVoYNNQ@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=fmdefrancesco@gmail.com \
--cc=ira.weiny@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox