Hi, Lorenzo, > On Tue, Jan 03, 2023 at 09:46:00AM -0800, Lorenzo Stoakes wrote: > On Tue, Jan 03, 2023 at 05:45:30PM +0000, Lorenzo Stoakes wrote: > > Can you explain what use case you have for exporting this? Currently > > this is only used by procfs. > > > > Ugh I hit send too soon ! I see you've explained the _why_ (i.e. idxd). The other > two points remain, however. > > > Additionally, it relies on a reference count being held on the mm > > which seems a little risky exposing to a driver. access_remote_vm(mm) directly call __access_remote_vm(mm). access_process_vm(tsk) calls mm=get_task_mm() then __access_remote_vm(mm). So instead of access_remote_vm(mm), it's access_process_vm(tsk) that holds a reference count on the mm, right? > > > > Is there a reason you can't use access_process_vm() which is exported > > and additionally handles the refrencing? IDXD interrupt handler starts a work which needs to access remote vm. The remote mm is found by PASID which is saved in device event log. In the work, it's hard to get the remote mm from a task because mm->owner could be NULL but the mm is still existing. Thanks. -Fenghua