lkml.org 
[lkml]   [2023]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3/4] fs/proc/task_mmu: Implement IOCTL to get and/or the clear info about PTEs
On Mon, Jan 23, 2023 at 05:18:13PM +0500, Muhammad Usama Anjum wrote:
> >> + if (IS_GET_OP(p) && p->max_pages && (p->found_pages == p->max_pages))
> >> + return -ENOSPC;
> >
> > This is the function to test "whether the walker should walk the vma
> > specified". This check should IIUC be meaningless because found_pages
> > doesn't boost during vma switching, while OTOH your pmd walker fn should do
> > proper check when increasing found_pages and return -ENOSPC properly when
> > the same condition met. That should be enough, IMHO.
> This check is needed in case we want to abort the walk at once. We return
> negative value from here which aborts the walk. Returning negative value
> from pmd_entry doesn't abort the walk. So this check is needed in the
> test_walk.

Why? What I see locally is (walk_pmd_range):

if (ops->pmd_entry)
err = ops->pmd_entry(pmd, addr, next, walk);
if (err)
break;

Thanks,

--
Peter Xu

\
 
 \ /
  Last update: 2023-03-26 23:54    [W:2.394 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site