On Wed, Jun 04, 2025 at 11:48:54AM +0200, David Hildenbrand wrote: > > > > > > > > > > > So, what's the status of that? We should fix it upstream (*not* caring > > > > > about controversial out-of-tree pkvm issues). > > > > Leaving aside the pkvm issue, we should also care about the CMA pages > > > > mapping to VM by special driver which are intended to be long term > > > > pinned (actually they are fetched by cma_alloc and then mapped to VM > > > > instead of alloc_pages during normal page fault). > > > > > > Is there any such "special driver" in the tree? > > Not that I know of. However, pin_user_pages is exported symbol which > > could be used for ko, should we make it be capable of dealing with > > this scenario? > > We have the tendency to not go above and beyond of adding features that we > cannot even test without OOT drivers. > > Note that we export symbols so other in-tree drivers that are built as a > module can make use of them. > > > > > > > > Could we distinguish > > > > them by the patch below based on 1aaf8c122, that is, this kind of > > > > pages is not on page cache and have equaled refcnt to mapcount > > > > > > No, not like that. We'd need some proper indication that this page was > > > allocated by the CMA area owner, and that owner agrees that the folio > > > can be long-term pinned (maybe that agreement is by mapping it into user > > > space, tbd). > > I think the key point is to distinguish the cma pages which are > > allocated from fallback of GFP_MOVABLE during common page faults from > > the ones which got from cma_alloc within the special driver's > > vm_ops->fault. > > Yes. Using typed pages in the future might work. For now, this is not > possible yet because the page type overlays page->mapcount. > > Hm. > > > > > > > Will you send the fix or should I do it? Discussing about broken use > > > cases that do no apply upstream is not particularly helpful when we're > > > dealing with a real upstream bug. > > I would like to ask for your help on this since I have no further ideas. Thanks > > Okay, let me send a fix for the original commit. > I have prepared a patch and just sent it out. I'd appreciate it if you could take a look and share your feedback. Thanks, Regards. > -- > Cheers, > > David / dhildenb > >