Sounds to me that all you want is some notifier to be called from
adjust_managed_page_count(). What am I missing?
Notifier will act as an accumulator to report size of change and it will make things easier for the drivers and users wrt locking.
Notifier is similar to the memory hotplug notifier.
Overall, I am not convinced that there is any value of separating the value
and the notifier. You can batch both or not batch both. In addition, as I
mentioned, having two values seems racy.
I have identified two users so far above - may be more to come.
One type needs the value to adjust. Also having the value is necessary
to report it to users and oom. There are options with callbacks and so
on but it will complicate things with no real gain. You are right about
the atomicity but i guess if that's a problem for some user it could
find a way to ensure it. i am yet to find such place.