[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20a1d49a-1f5d-4d3d-b59d-29b9791b72bd@collabora.com>
Date: Mon, 25 Nov 2024 23:44:46 +0500
From: Muhammad Usama Anjum <Usama.Anjum@...labora.com>
To: stsp <stsp2@...dex.ru>, Peter Xu <peterx@...hat.com>
Cc: Usama.Anjum@...labora.com, Linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: userfaultfd: two-step UFFDIO_API always gives -EINVAL
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
Powered by blists - more mailing lists