All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:PROC FILESYSTEM" <linux-fsdevel@vger.kernel.org>,
	"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>
Cc: kernel@collabora.com,
	Gabriel Krisman Bertazi <krisman@collabora.com>,
	David Hildenbrand <david@redhat.com>,
	Peter Enderborg <peter.enderborg@sony.com>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v3 4/4] mm: add documentation of the new ioctl on pagemap
Date: Fri, 26 Aug 2022 15:22:08 +0700	[thread overview]
Message-ID: <e819de52-9b35-a698-0b45-80a9b063cf0c@gmail.com> (raw)
In-Reply-To: <20220826064535.1941190-5-usama.anjum@collabora.com>

On 8/26/22 13:45, Muhammad Usama Anjum wrote:
>  The soft-dirty is a bit on a PTE which helps to track which pages a task
> -writes to. In order to do this tracking one should
> +writes to.
> +
> +Using Proc FS
> +-------------
> +
> +In order to do this tracking one should
>  
>    1. Clear soft-dirty bits from the task's PTEs.
>  
> @@ -20,6 +25,41 @@ writes to. In order to do this tracking one should
>       64-bit qword is the soft-dirty one. If set, the respective PTE was
>       written to since step 1.
>  
> +Using IOCTL
> +-----------
> +
> +The IOCTL on the ``/proc/PID/pagemap`` can be can be used to find the dirty pages
> +atomically. The following commands are supported::
> +
> +	MEMWATCH_SD_GET
> +		Get the page offsets which are soft dirty.
> +
> +	MEMWATCH_SD_CLEAR
> +		Clear the pages which are soft dirty.
> +
> +	MEMWATCH_SD_GET_AND_CLEAR
> +		Get and clear the pages which are soft dirty.
> +

Definition lists are enough, no need to use code block.

> +The struct :c:type:`pagemap_sd_args` is used as the argument. In this struct:
> +
> +  1. The range is specified through start and len. The len argument need not be
> +     the multiple of the page size, but since the information is returned for the
> +     whole pages, len is effectively rounded up to the next multiple of the page
> +     size.
> +
> +  2. The output buffer and size is specified in vec and vec_len. The offsets of
> +     the dirty pages from start are returned in vec. The ioctl returns when the
> +     whole range has been searched or vec is completely filled. The whole range
> +     isn't cleared if vec fills up completely.
> +
> +  3. The flags can be specified in flags field. Currently only one flag,
> +     PAGEMAP_SD_NO_REUSED_REGIONS is supported which can be specified to ignore
> +     the VMA dirty flags for better performance. This flag shows only those pages
> +     dirty which have been written to by the user. All new allocations aren't returned
> +     to be dirty.
> +
> +Explanation
> +-----------
>  
>  Internally, to do this tracking, the writable bit is cleared from PTEs
>  when the soft-dirty bit is cleared. So, after this, when the task tries to

I'd like to see identifier keywords (such as filename, function and variable name)
are consistently formatted either with inline code (``identifier``) or no
formatting (all or nothing).

-- 
An old man doll... just what I always wanted! - Clara

  reply	other threads:[~2022-08-26  8:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  6:45 [PATCH v3 0/4] Implement IOCTL to get and clear soft dirty PTE Muhammad Usama Anjum
2022-08-26  6:45 ` [PATCH v3 1/4] fs/proc/task_mmu: update functions to clear the soft-dirty PTE bit Muhammad Usama Anjum
2022-08-26  6:45 ` [PATCH v3 2/4] fs/proc/task_mmu: Implement IOCTL to get and clear soft dirty " Muhammad Usama Anjum
2022-08-26  6:45 ` [PATCH v3 3/4] selftests: vm: add pagemap ioctl tests Muhammad Usama Anjum
2022-08-26  6:45 ` [PATCH v3 4/4] mm: add documentation of the new ioctl on pagemap Muhammad Usama Anjum
2022-08-26  8:22   ` Bagas Sanjaya [this message]
2022-09-07  9:40 ` [PATCH v3 0/4] Implement IOCTL to get and clear soft dirty PTE Muhammad Usama Anjum
2022-09-19 14:58 ` Andrei Vagin
2022-09-21 18:26   ` Muhammad Usama Anjum
2022-09-28 17:24     ` Andrei Vagin
2022-10-03 11:21       ` Muhammad Usama Anjum
2022-10-11  4:52         ` Andrei Vagin
2022-10-14 13:48           ` Danylo Mocherniuk
2022-10-18 10:36             ` Muhammad Usama Anjum
2022-10-18 10:48               ` Greg KH
2022-10-18 12:30                 ` Muhammad Usama Anjum
2022-10-18 11:11               ` Michał Mirosław
2022-10-18 13:22                 ` Muhammad Usama Anjum
2022-10-18 17:17                   ` Michał Mirosław
2022-10-19  7:18                     ` Muhammad Usama Anjum
2022-10-18 13:32               ` Muhammad Usama Anjum
2022-10-18 18:20                 ` Greg KH
2022-09-21 18:30 ` Muhammad Usama Anjum
2022-09-28  6:03 ` Muhammad Usama Anjum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e819de52-9b35-a698-0b45-80a9b063cf0c@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peter.enderborg@sony.com \
    --cc=shuah@kernel.org \
    --cc=usama.anjum@collabora.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.