Re: fs/proc/task_mmu: Implement IOCTL for efficient page table scanning

From: Michał Mirosław
Date: Thu Jul 20 2023 - 15:50:38 EST


On Thu, Jul 20, 2023 at 09:28:52PM +0200, Michał Mirosław wrote:
> This is a massaged version of patch by Muhammad Usama Anjum [1]
> to illustrate my review comments and hopefully push the implementation
> efforts closer to conclusion. The changes are:
[...]
> +static void pagemap_scan_backout_range(struct pagemap_scan_private *p,
> + unsigned long addr, unsigned long end)
> +{
> + struct page_region *cur_buf = &p->cur_buf;
> +
> + if (cur_buf->start != addr) {
> + cur_buf->end = addr;
> + } else {
> + cur_buf->start = cur_buf->end = 0;
> + }
> +
> + p->end_addr = 0;

Just noticed that this is missing:

p->found_pages -= (end - addr) / PAGE_SIZE;

> +}
[...]

Best Regards
Michał Mirosław