>>> + if (local_drain) { >>> + lru_add_drain_all(); >> >> I do wonder if that is valid to be called with all the locks at this point. > > This function uses per cpu workers and needs no other locks. Also verified > with lockdep. Okay, perfect. >>> +/** >>> + * To be called with the page locked or with an extra reference! >> >> Can we have races here? (IOW, two callers concurrently for the same page) > > That would be fine and is part of the design. The ultravisor calls will > either make the page accessible or will be a (mostly) no-op. > In fact, we allow for slight over-indication of "needs to be exported" > > What about: > > /* > * To be called with the page locked or with an extra reference! This will > * prevent gmap_make_secure from touching the page concurrently. Having 2 > * parallel make_page_accessible is fine, as the UV calls will become a > * no-op if the page is already exported. > */ Yes, much clearer, thanks! -- Thanks, David / dhildenb