lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e819de52-9b35-a698-0b45-80a9b063cf0c@gmail.com>
Date:   Fri, 26 Aug 2022 15:22:08 +0700
From:   Bagas Sanjaya <bagasdotme@...il.com>
To:     Muhammad Usama Anjum <usama.anjum@...labora.com>,
        Jonathan Corbet <corbet@....net>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Shuah Khan <shuah@...nel.org>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:PROC FILESYSTEM" <linux-fsdevel@...r.kernel.org>,
        "open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>
Cc:     kernel@...labora.com,
        Gabriel Krisman Bertazi <krisman@...labora.com>,
        David Hildenbrand <david@...hat.com>,
        Peter Enderborg <peter.enderborg@...y.com>,
        Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v3 4/4] mm: add documentation of the new ioctl on pagemap

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ