On Tue, Apr 14, 2020 at 09:00:13AM +0200, Christoph Hellwig wrote: > On Mon, Apr 13, 2020 at 08:04:10PM -0400, Yan Zhao wrote: > > > I can't think of another way for a kernel thread to have a mm indeed. > > for example, before calling to vfio_dma_rw(), a kernel thread has already > > called use_mm(), then its current->mm is not null, and it has flag > > PF_KTHREAD. > > in this case, we just want to allow the copy_to_user() directly if > > current->mm == mm, rather than call another use_mm() again. > > > > do you think it makes sense? > > I mean no other way than using use_mm. That being said nesting > potentional use_mm callers sounds like a rather bad idea, and we > should avoid that. yes, agree. I was explaining why we just use "current->mm == NULL" (not "current->flag & PF_KTHREAD") as a criteria to call use_mm() in vfio_dma_rw(), which you might ask us when you take that part into your series. :) _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
- Re: [PATCH 4/6] kernel: move use_mm/unuse_mm to kt... Felix Kuehling
- [PATCH 5/6] kernel: better document the use_mm/unuse_mm... Christoph Hellwig
- Re: [Intel-gfx] [PATCH 5/6] kernel: better documen... Pavel Begunkov
- Re: [PATCH 5/6] kernel: better document the use_mm... Felix Kuehling
- [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean ... Christoph Hellwig
- Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does ... Sergei Shtylyov
- Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does ... Yan Zhao
- Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm d... Christoph Hellwig
- Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->... Yan Zhao
- Re: [PATCH 2/6] i915/gvt/kvm: a NULL -... Christoph Hellwig
- Re: [PATCH 2/6] i915/gvt/kvm: a N... Yan Zhao
- [PATCH 1/6] amdgpu: a NULL ->mm does not mean a thre... Christoph Hellwig
- Re: [PATCH 1/6] amdgpu: a NULL ->mm does not me... Felix Kuehling
- [PATCH 3/6] i915/gvt: remove unused xen bits Christoph Hellwig
- Re: [PATCH 3/6] i915/gvt: remove unused xen bits Zhenyu Wang
- Re: [PATCH 3/6] i915/gvt: remove unused xen bi... Christoph Hellwig
- Re: [PATCH 3/6] i915/gvt: remove unused xe... Zhenyu Wang
- [PATCH 6/6] kernel: set USER_DS in kthread_use_mm Christoph Hellwig
- Re: [PATCH 6/6] kernel: set USER_DS in kthread_use... Michael S. Tsirkin