Re: [PATCH v24 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/12/23 12:42 AM, Andrei Vagin wrote:
> On Tue, Jul 11, 2023 at 5:53 AM Muhammad Usama Anjum
> <usama.anjum@xxxxxxxxxxxxx> wrote:
> 
> <snip>
> 
>> +static int pagemap_scan_pte_hole(unsigned long addr, unsigned long end,
>> +                                int depth, struct mm_walk *walk)
>> +{
>> +       unsigned long n_pages = (end - addr)/PAGE_SIZE;
>> +       struct pagemap_scan_private *p = walk->private;
>> +       struct vm_area_struct *vma = walk->vma;
>> +       int ret = 0;
>> +
>> +       if (!vma)
>> +               return 0;
>> +
>> +       if (IS_PM_SCAN_GET(p->flags)) {
>> +               if (n_pages > p->max_pages - p->found_pages)
>> +                       n_pages = p->max_pages - p->found_pages;
>> +
>> +               ret = pagemap_scan_output(PM_SCAN_FLAGS(false, false, false,
>> +                                         false, false), p, addr, n_pages);
> 
> Why do we report holes unconditionally?
It seems I've missed the filtering part for holes. It got missed and no
test/reviewer caught it earlier. I'll add it pretty quickly.

Are you satisfied with the remaining patch and can you sent reviewed/acked
by tag?

> 
>> +       }
>> +
>> +       if (IS_PM_SCAN_WP(p->flags) &&
>> +           uffd_wp_range(vma, addr, end - addr, true) < 0)
>> +               ret = -EINVAL;
>> +
>> +       return ret;
>> +}
> 
> Thanks,
> Andrei

-- 
BR,
Muhammad Usama Anjum



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux