Re: [PATCH v31 2/6] 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 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.

Best Regards
Michał Mirosław



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux