All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: John Hubbard <jhubbard@nvidia.com>,
	Souptick Joarder <jrdr.linux@gmail.com>
Cc: linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>
Subject: Re: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*()
Date: Sun, 8 Nov 2020 10:13:55 +0900	[thread overview]
Message-ID: <5efeb909-3e02-ba14-7a86-f18562a2fe69@i-love.sakura.ne.jp> (raw)
In-Reply-To: <e6859981-bc3c-9513-99e5-a99849786156@nvidia.com>

On 2020/11/08 4:17, John Hubbard wrote:
> On 11/7/20 1:04 AM, John Hubbard wrote:
>> On 11/7/20 12:24 AM, Souptick Joarder wrote:
>>> In 2019, we introduced pin_user_pages*() and now we are converting
>>> get_user_pages*() to the new API as appropriate. [1] & [2] could
>>> be referred for more information. This is case 5 as per document [1].
>>
>> It turns out that Case 5 can be implemented via a better pattern, as long
>> as we're just dealing with a page at a time, briefly:
>>
>> lock_page()
>> write to page's data
>> unlock_page()
>>
>> ...which neatly synchronizes with writeback and other fs activities.
> 
> Ahem, I left out a key step: set_page_dirty()!
> 
> lock_page()
> write to page's data
> set_page_dirty()
> unlock_page()
> 

Excuse me, but Documentation/core-api/pin_user_pages.rst says 
"CASE 5: Pinning in order to _write_ to the data within the page"
while tomoyo_dump_page() is for "_read_ the data within the page".
Do we want to convert to pin_user_pages_remote() or lock_page() ?

  reply	other threads:[~2020-11-08  1:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07  8:24 [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() Souptick Joarder
2020-11-07  8:24 ` [PATCH 2/2] tomoyo: Fixed typo in documentation Souptick Joarder
2020-11-07  8:57   ` John Hubbard
2020-11-09  3:41     ` Souptick Joarder
2020-11-09  4:17       ` John Hubbard
2020-11-09  4:45         ` Tetsuo Handa
2020-11-10  3:08           ` James Morris
2020-11-07  9:04 ` [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() John Hubbard
2020-11-07 19:17   ` John Hubbard
2020-11-08  1:13     ` Tetsuo Handa [this message]
2020-11-08  2:17       ` John Hubbard
2020-11-08  4:12         ` Tetsuo Handa
2020-11-08  5:00           ` John Hubbard
2020-11-09  3:38             ` Souptick Joarder
2020-11-09  3:36         ` Souptick Joarder

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=5efeb909-3e02-ba14-7a86-f18562a2fe69@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=jack@suse.cz \
    --cc=jhubbard@nvidia.com \
    --cc=jmorris@namei.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=serge@hallyn.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.