Well the problem is if one does not have the begin/end hooks then
reliable clearing of the mapping may not be possible. begin/end allow
holding off new references and that avoids the issue that would come
with an single callback that could race with something else.
What would that be? I think the API need to stay as simple as possible.
And this set is pretty minimal and easy to understand. Not having the
invalidate_page() removes a troublespot from the API.
All of that is needed in order to allow sleeping in the future. Your
version locks us into atomic callbacks. It also makes the API needlessly
complex.
RCU means that the callbacks occur in an atomic context.
It is the atomic dead end that we want to avoid. And your patch is exactly
that. Both the invalidate_page and the RCU locks us into this.
Well I really want us to have one API that is suitable for multiple
purposes and that allows a generic use by device drivers for multiple
purposes. The discussion in the last month have made that possible. I am
glad that you do not see any major issues with the patch. I sure wish I
would not have to post a competing patchset because I want things to be
merged ASAP and get this over with. But we need to have at minimum clear
way to support sleeping with the existing API in the future.
--