From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: "Michał Mirosław" <emmir@google.com>, "Andrei Vagin" <avagin@gmail.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Peter Xu <peterx@redhat.com>,
David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Danylo Mocherniuk <mdanylo@google.com>,
Paul Gofman <pgofman@codeweavers.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Mike Rapoport <rppt@kernel.org>, Nadav Amit <namit@vmware.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Shuah Khan <shuah@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Yang Shi <shy828301@gmail.com>, Vlastimil Babka <vbabka@suse.cz>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Yun Zhou <yun.zhou@windriver.com>,
Suren Baghdasaryan <surenb@google.com>,
Alex Sierra <alex.sierra@amd.com>,
Matthew Wilcox <willy@infradead.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Axel Rasmussen <axelrasmussen@google.com>,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
Dan Williams <dan.j.williams@intel.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
Greg KH <gregkh@linuxfoundation.org>,
kernel@collabora.com
Subject: Re: [PATCH v21 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs
Date: Wed, 28 Jun 2023 11:03:46 +0500 [thread overview]
Message-ID: <bbba2568-2b40-d2ef-0622-47cd21c95fec@collabora.com> (raw)
In-Reply-To: <CABb0KFH60U5RE9dLfCOEGp5=wLwwxpKaMdzQL8drYEmL3T_itw@mail.gmail.com>
On 6/28/23 12:54 AM, Michał Mirosław wrote:
> On Tue, 27 Jun 2023 at 21:20, Muhammad Usama Anjum
> <usama.anjum@collabora.com> wrote:
>> Thanks Michał for replying.
>>
>> On 6/27/23 11:52 PM, Michał Mirosław wrote:
>>> On Tue, 27 Jun 2023 at 11:00, Muhammad Usama Anjum
>>> <usama.anjum@collabora.com> wrote:
>>>>
>>>> Hi Andrei and Michal,
>>>>
>>>> Lets resolve last two points. Please reply below.
>>>>
>>>> On 6/27/23 6:46 AM, Andrei Vagin wrote:
>>> [...]
>>>>> And we need to report an address where it stopped scanning.
>>>>> We can do that by adding zero length vector.
>>>> I don't want to do multiplexing the ending address in vec. Can we add
>>>> end_addr variable in struct pm_scan_arg to always return the ending address?
>>>>
>>>> struct pm_scan_arg {
>>>> ...
>>>> _u64 end_addr;
>>>> };
>>>
>>> The idea to emit a zero-length entry for the end looks nice. This has
>>> the disadvantage that we'd need to either reserve one entry for the
>>> ending marker or stop the walk after the last entry is no longer
>>> matching.
>> This is ambiguous.
>
> Can you explain? Both solutions would allow to return the restart
> point back to the caller (the second one would need to stop the walk
> as soon as the matching page range finishes -- that creates
> discontinuity).
>
>>> Another solution would be to rewrite 'start' and 'len'. The caller
>>> would be forced to use non-const `pm_scan_arg`, but I expect the `vec`
>>> pointer would normally be written anyway (unless using only a
>>> statically-allocated buffer).
>>> Also, if the 'len' is replaced with 'end' that would make the ioctl
>>> easily restartable (just call again if start != end).
>> Nice idea. But returning ending address in len seems a bit strange.
>
> I mean that it would update `start` = start value for next call' and
> `len` = `len` - (new `start` - original `start`).
>
> By replacing `len` I meant to remove the field and add `end` instead
> to make the requested range use begin .. end (iterator range) style
> instead of start + len (buffer and length). In this version you only
> need to update `start` (or `begin` if you prefer).
The `start` and `end` with updating the `start` with ending address seems
most appropriate. I'll make updates.
>
> Best Regards
> Michał Mirosław
--
BR,
Muhammad Usama Anjum
next prev parent reply other threads:[~2023-06-28 6:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 11:31 [PATCH v21 0/5] Implement IOCTL to get and optionally clear info about PTEs Muhammad Usama Anjum
2023-06-26 11:31 ` [PATCH v21 1/5] userfaultfd: UFFD_FEATURE_WP_ASYNC Muhammad Usama Anjum
2023-06-26 11:31 ` [PATCH v21 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs Muhammad Usama Anjum
2023-06-27 1:46 ` Andrei Vagin
2023-06-27 9:00 ` Muhammad Usama Anjum
2023-06-27 14:36 ` Andrei Vagin
2023-06-27 18:00 ` Muhammad Usama Anjum
2023-06-27 18:52 ` Michał Mirosław
2023-06-27 19:20 ` Muhammad Usama Anjum
2023-06-27 19:54 ` Michał Mirosław
2023-06-28 6:03 ` Muhammad Usama Anjum [this message]
2023-06-26 11:31 ` [PATCH v21 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Muhammad Usama Anjum
2023-06-26 11:31 ` [PATCH v21 4/5] mm/pagemap: add documentation of PAGEMAP_SCAN IOCTL Muhammad Usama Anjum
2023-06-26 11:31 ` [PATCH v21 5/5] selftests: mm: add pagemap ioctl tests Muhammad Usama Anjum
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=bbba2568-2b40-d2ef-0622-47cd21c95fec@collabora.com \
--to=usama.anjum@collabora.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alex.sierra@amd.com \
--cc=avagin@gmail.com \
--cc=axelrasmussen@google.com \
--cc=brauner@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=emmir@google.com \
--cc=gorcunov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mdanylo@google.com \
--cc=namit@vmware.com \
--cc=pasha.tatashin@soleen.com \
--cc=peterx@redhat.com \
--cc=pgofman@codeweavers.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=shy828301@gmail.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=yun.zhou@windriver.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).