Re: userfaultfd: two-step UFFDIO_API always gives -EINVAL

From: stsp
Date: Tue Nov 26 2024 - 02:39:37 EST


26.11.2024 01:42, Axel Rasmussen пишет:
For what it's worth, I still don't like the two-step handshake design,
my preference is still an API like this:

1. userspace asks for the features it wants
2. kernel responds with the (possibly subset of) features it actually supports
3. userspace is free to carry on with perhaps limited features, or
exit with error, or ...

4. pass the needed features to
UFFDIO_REGISTER, correct?

But, I think at that point the ship has already sailed. I think to
maintain compatibility with existing programs there isn't much we can
do at this point.
Please, just why do you have that UFFD_API
const? Only to call every screw-up like this
one, a sailed ship? :)
Why not to add UFFD_API_v2?
Then UFFD_API_v3?
Full binary and source compatibility is
therefore preserved, you only need to
update the man page to document the
latest one.