mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <Usama.Anjum@collabora.com>
To: stsp <stsp2@yandex.ru>, Peter Xu <peterx@redhat.com>
Cc: Usama.Anjum@collabora.com, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: userfaultfd: two-step UFFDIO_API always gives -EINVAL
Date: Mon, 25 Nov 2024 23:44:46 +0500	[thread overview]
Message-ID: <20a1d49a-1f5d-4d3d-b59d-29b9791b72bd@collabora.com> (raw)
In-Reply-To: <4689f014-2885-42b9-91a4-ff8b8133599f@yandex.ru>

On 11/25/24 11:01 PM, stsp wrote:
> 25.11.2024 20:44, Peter Xu пишет:
>> Apps who tracks snapshots needs the unmodified pages before being written.
>> Those cannot rely on kernel resolution because it needs more than "if the
>> page is written" - it also needs the page data before being written.
> Say I am writing a frame grabber
> (not exactly, but very close to).
> I monitor the video buffer of another
> process, and "snapshot" it with some
> frequency. I only need to know what
> pages were modified, to reduce the
> bandwidth to an absolute minimum,
> and if the process is not playing - then
> to not grab anything until it resumes.
> UFFD_FEATURE_PAGEFAULT_FLAG_WP
> works quite well for me already, but
> I envision a huge boost with
> UFFD_FEATURE_WP_ASYNC.
> What would you suggest for that usage
> scenario?
The UFFD_FEATURE_WP_ASYNC was designed for exactly this case.
The IOCTL will return you the modified pages. An example of usage
can be found in selftest/mm/pagemap_ioctl.c.

-- 
BR,
Muhammad Usama Anjum


  reply	other threads:[~2024-11-25 18:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-23 15:13 stsp
2024-11-25  9:05 ` stsp
2024-11-25 15:59 ` Peter Xu
2024-11-25 16:15   ` stsp
2024-11-25 16:58     ` Peter Xu
2024-11-25 17:07       ` stsp
2024-11-25 17:13         ` Peter Xu
2024-11-25 17:32           ` stsp
2024-11-25 17:44             ` Peter Xu
2024-11-25 18:01               ` stsp
2024-11-25 18:44                 ` Muhammad Usama Anjum [this message]
2024-11-26  7:32                   ` stsp
2024-11-26 15:56                     ` Peter Xu
2024-11-26 16:16                       ` stsp
2024-11-26 17:41                         ` Peter Xu
2024-11-26  9:41                   ` stsp
2024-11-25 22:42           ` Axel Rasmussen
2024-11-26  7:39             ` stsp
2024-11-26 15:50               ` Peter Xu

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=20a1d49a-1f5d-4d3d-b59d-29b9791b72bd@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=stsp2@yandex.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®