Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513837

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices

From Kirti Wankhede <kwankhede@nvidia.com>
Newsgroups linux.kernel
Subject Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated devices
Date 2016-11-02 14:30 +0100
Message-ID <sz3M5-6Ra-1@gated-at.bofh.it> (permalink)
References (7 earlier) <syUz7-P0-1@gated-at.bofh.it> <syVbP-1ne-3@gated-at.bofh.it> <sz2Q6-6i5-5@gated-at.bofh.it> <sz39o-6oi-7@gated-at.bofh.it> <sz3sJ-6K4-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 11/2/2016 6:30 PM, Jike Song wrote:
> On 11/02/2016 08:41 PM, Kirti Wankhede wrote:
>> On 11/2/2016 5:51 PM, Jike Song wrote:
>>> On 11/02/2016 12:09 PM, Alexey Kardashevskiy wrote:
>>>> Or you could just reference and use @mm as KVM and others do. Or there is
>>>> anything else you need from @current than just @mm?
>>>>
>>>
>>> I agree. If @mm is the only thing needed, there is really no reason to
>>> refer to the @task :-)
>>>
>>
>> In vfio_lock_acct(), that is for page accounting, if mm->mmap_sem is
>> already held then page accounting is deferred, where task structure is
>> used to get mm and work is deferred only if mm exist:
>> 	mm = get_task_mm(task);
>>
>> That is where this module need task structure.
> 
> Kirti,
> 
> By calling get_task_mm you hold a ref on @mm and save it in iommu,
> whenever you want to do something like vfio_lock_acct(), use that mm
> (as you said, if mmap_sem not accessible then defer it to a work, but
> still @mm is the whole information), and put it after the usage.
> 
> I still can't see any reason that the @task have to be saved. It's
> always the @mm all the time. Did I miss anything?
> 

If the process is terminated by SIGKILL, as Alexey mentioned in this
mail thread earlier exit_mm() is called first and then all files are
closed. From exit_mm(), task->mm is set to NULL. So from teardown path,
we should call get_task_mm(task) to get current status intsead of using
stale pointer.

Thanks,
Kirti.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-10-27 09:30 +0200
  Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-10-27 16:00 +0200
    Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alex Williamson <alex.williamson@redhat.com> - 2016-10-27 16:40 +0200
      Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-10-27 18:00 +0200
    Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-10-28 04:40 +0200
      Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-01 15:10 +0100
        Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-11-02 02:30 +0100
          Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-02 04:40 +0100
            Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-11-02 05:20 +0100
              Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated  devices Jike Song <jike.song@intel.com> - 2016-11-02 13:30 +0100
                Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-02 13:50 +0100
                Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated  devices Jike Song <jike.song@intel.com> - 2016-11-02 14:10 +0100
                Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Kirti Wankhede <kwankhede@nvidia.com> - 2016-11-02 14:30 +0100
                Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for mediated  devices Jike Song <jike.song@intel.com> - 2016-11-02 14:40 +0100
                Re: [Qemu-devel] [PATCH v9 04/12] vfio iommu: Add support for  mediated devices Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-11-03 05:40 +0100

csiph-web