linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mm <linux-mm@kvack.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	upstream+pagemap@sigma-star.at, adobriyan@gmail.com,
	wangkefeng wang <wangkefeng.wang@huawei.com>,
	ryan roberts <ryan.roberts@arm.com>,
	hughd@google.com, peterx@redhat.com, avagin@google.com,
	lstoakes@gmail.com, vbabka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	usama anjum <usama.anjum@collabora.com>,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH 2/2] [RFC] pagemap.rst: Document write bit
Date: Thu, 7 Mar 2024 12:15:38 +0100	[thread overview]
Message-ID: <9ebc9faf-0bb0-4409-b93a-5beddfc4929b@redhat.com> (raw)
In-Reply-To: <861682210.23281.1709809857201.JavaMail.zimbra@nod.at>

On 07.03.24 12:10, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "David Hildenbrand" <david@redhat.com>
>> An: "richard" <richard@nod.at>, "linux-mm" <linux-mm@kvack.org>
>>> +   Bit 58 is useful to detect CoW mappings; however, it does not indicate
>>> +   whether the page mapping is writable or not. If an anonymous mapping is
>>> +   writable but the write bit is not set, it means that the next write access
>>> +   will cause a page fault, and copy-on-write will happen.
>>
>> That is not true.
> 
> Can you please help me correct my obvious misunderstanding?

We'll perform a page copy of an anonymous page only if the page is not 
detected as exclusive to the process.

So a better description could be:

"In an private mapping, having the writable bit clear can indicate that 
next write access will result in copy-on-write during a page fault. Note 
that exclusive anonymous pages can be mapped read-only, and they might 
simply get remapped writable during the next write fault, avoiding a 
page copy."

-- 
Cheers,

David / dhildenb


  reply	other threads:[~2024-03-07 11:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 23:23 [PATCH 1/2] [RFC] proc: pagemap: Expose whether a PTE is writable Richard Weinberger
2024-03-06 23:23 ` [PATCH 2/2] [RFC] pagemap.rst: Document write bit Richard Weinberger
2024-03-07 10:52   ` David Hildenbrand
2024-03-07 11:10     ` Richard Weinberger
2024-03-07 11:15       ` David Hildenbrand [this message]
2024-03-10 22:14   ` Lorenzo Stoakes
2024-03-07 10:44 ` [PATCH 1/2] [RFC] proc: pagemap: Expose whether a PTE is writable Muhammad Usama Anjum
2024-03-07 10:52 ` David Hildenbrand
2024-03-07 11:10   ` Richard Weinberger
2024-03-07 11:20     ` David Hildenbrand
2024-03-07 11:51       ` Richard Weinberger
2024-03-07 11:59         ` David Hildenbrand
2024-03-07 12:09           ` David Hildenbrand
2024-03-07 14:42             ` Richard Weinberger
2024-03-10 21:55 ` Lorenzo Stoakes

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=9ebc9faf-0bb0-4409-b93a-5beddfc4929b@redhat.com \
    --to=david@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@google.com \
    --cc=corbet@lwn.net \
    --cc=hughd@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=peterx@redhat.com \
    --cc=richard@nod.at \
    --cc=ryan.roberts@arm.com \
    --cc=upstream+pagemap@sigma-star.at \
    --cc=usama.anjum@collabora.com \
    --cc=vbabka@suse.cz \
    --cc=wangkefeng.wang@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).