lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v31 2/6] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs
From
On 8/16/23 4:17 PM, Michał Mirosław wrote:
> On Wed, Aug 16, 2023 at 03:38:10PM +0500, Muhammad Usama Anjum wrote:
>> The PAGEMAP_SCAN IOCTL on the pagemap file can be used to get or optionally
>> clear the info about page table entries.
> [...]
>> --- a/fs/proc/task_mmu.c
>> +++ b/fs/proc/task_mmu.c
> [...]
>> +static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
>> +{
> [...]
>> + for (walk_start = p.arg.start; walk_start < p.arg.end;
>> + walk_start = p.arg.walk_end) {
> [...]
>> + /* The walk_end isn't set when ret is zero */
>> + if (!p.arg.walk_end)
>> + p.arg.walk_end = p.arg.end;
>
> This is now redundant with the `if` after the loop. [1]
>
>> + if (ret != -ENOSPC)
>> + break;
>> +
>> + if (p.arg.vec_len == 0 || p.found_pages == p.arg.max_pages)
>> + break;
>> + }
>> +
>> + /* ENOSPC signifies early stop (buffer full) from the walk. */
>> + if (!ret || ret == -ENOSPC)
>> + ret = n_ranges_out;
>> +
>> + if (!p.arg.walk_end)
>> + p.arg.walk_end = p.arg.end;
>
> [1] The one above.
Thank you for noting it down. Let me remove it.

>
> Best Regards
> Michał Mirosław

--
BR,
Muhammad Usama Anjum

\
 
 \ /
  Last update: 2023-08-16 13:31    [W:0.055 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site