mbox series

[0/9] Use vm_insert_range

Message ID 20181115154314.GA27850@jordon-HP-15-Notebook-PC (mailing list archive)
Headers show
Series Use vm_insert_range | expand

Message

Souptick Joarder Nov. 15, 2018, 3:43 p.m. UTC
Previouly drivers have their own way of mapping range of
kernel pages/memory into user vma and this was done by
invoking vm_insert_page() within a loop.

As this pattern is common across different drivers, it can
be generalized by creating a new function and use it across
the drivers.

vm_insert_range is the new API which will be used to map a
range of kernel memory/pages to user vma.

All the applicable places are converted to use new vm_insert_range
in this patch series.

Souptick Joarder (9):
  mm: Introduce new vm_insert_range API
  arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range
  drivers/firewire/core-iso.c: Convert to use vm_insert_range
  drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range
  drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range
  iommu/dma-iommu.c: Convert to use vm_insert_range
  videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range
  xen/gntdev.c: Convert to use vm_insert_range
  xen/privcmd-buf.c: Convert to use vm_insert_range

 arch/arm/mm/dma-mapping.c                         | 21 ++++++-----------
 drivers/firewire/core-iso.c                       | 15 ++----------
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c       | 20 ++--------------
 drivers/gpu/drm/xen/xen_drm_front_gem.c           | 20 +++++-----------
 drivers/iommu/dma-iommu.c                         | 12 ++--------
 drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++-------------
 drivers/xen/gntdev.c                              | 11 ++++-----
 drivers/xen/privcmd-buf.c                         |  8 ++-----
 include/linux/mm_types.h                          |  3 +++
 mm/memory.c                                       | 28 +++++++++++++++++++++++
 mm/nommu.c                                        |  7 ++++++
 11 files changed, 70 insertions(+), 98 deletions(-)

Comments

Souptick Joarder Nov. 21, 2018, 6:24 a.m. UTC | #1
On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> Previouly drivers have their own way of mapping range of
> kernel pages/memory into user vma and this was done by
> invoking vm_insert_page() within a loop.
>
> As this pattern is common across different drivers, it can
> be generalized by creating a new function and use it across
> the drivers.
>
> vm_insert_range is the new API which will be used to map a
> range of kernel memory/pages to user vma.
>
> All the applicable places are converted to use new vm_insert_range
> in this patch series.
>
> Souptick Joarder (9):
>   mm: Introduce new vm_insert_range API
>   arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range
>   drivers/firewire/core-iso.c: Convert to use vm_insert_range
>   drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range
>   drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range
>   iommu/dma-iommu.c: Convert to use vm_insert_range
>   videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range
>   xen/gntdev.c: Convert to use vm_insert_range
>   xen/privcmd-buf.c: Convert to use vm_insert_range

Any further comment on driver changes ?
>
>  arch/arm/mm/dma-mapping.c                         | 21 ++++++-----------
>  drivers/firewire/core-iso.c                       | 15 ++----------
>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c       | 20 ++--------------
>  drivers/gpu/drm/xen/xen_drm_front_gem.c           | 20 +++++-----------
>  drivers/iommu/dma-iommu.c                         | 12 ++--------
>  drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++-------------
>  drivers/xen/gntdev.c                              | 11 ++++-----
>  drivers/xen/privcmd-buf.c                         |  8 ++-----
>  include/linux/mm_types.h                          |  3 +++
>  mm/memory.c                                       | 28 +++++++++++++++++++++++
>  mm/nommu.c                                        |  7 ++++++
>  11 files changed, 70 insertions(+), 98 deletions(-)
>
> --
> 1.9.1
>
Boris Ostrovsky Nov. 21, 2018, 7:37 p.m. UTC | #2
On 11/21/18 1:24 AM, Souptick Joarder wrote:
> On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> Previouly drivers have their own way of mapping range of
>> kernel pages/memory into user vma and this was done by
>> invoking vm_insert_page() within a loop.
>>
>> As this pattern is common across different drivers, it can
>> be generalized by creating a new function and use it across
>> the drivers.
>>
>> vm_insert_range is the new API which will be used to map a
>> range of kernel memory/pages to user vma.
>>
>> All the applicable places are converted to use new vm_insert_range
>> in this patch series.
>>
>> Souptick Joarder (9):
>>   mm: Introduce new vm_insert_range API
>>   arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range
>>   drivers/firewire/core-iso.c: Convert to use vm_insert_range
>>   drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range
>>   drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range
>>   iommu/dma-iommu.c: Convert to use vm_insert_range
>>   videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range
>>   xen/gntdev.c: Convert to use vm_insert_range
>>   xen/privcmd-buf.c: Convert to use vm_insert_range
> Any further comment on driver changes ?

Xen drivers (the last two patches) look fine to me.

-boris


>>  arch/arm/mm/dma-mapping.c                         | 21 ++++++-----------
>>  drivers/firewire/core-iso.c                       | 15 ++----------
>>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c       | 20 ++--------------
>>  drivers/gpu/drm/xen/xen_drm_front_gem.c           | 20 +++++-----------
>>  drivers/iommu/dma-iommu.c                         | 12 ++--------
>>  drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++-------------
>>  drivers/xen/gntdev.c                              | 11 ++++-----
>>  drivers/xen/privcmd-buf.c                         |  8 ++-----
>>  include/linux/mm_types.h                          |  3 +++
>>  mm/memory.c                                       | 28 +++++++++++++++++++++++
>>  mm/nommu.c                                        |  7 ++++++
>>  11 files changed, 70 insertions(+), 98 deletions(-)
>>
>> --
>> 1.9.1
>>
Souptick Joarder Nov. 21, 2018, 7:56 p.m. UTC | #3
On Thu, Nov 22, 2018 at 1:08 AM Boris Ostrovsky
<boris.ostrovsky@oracle.com> wrote:
>
> On 11/21/18 1:24 AM, Souptick Joarder wrote:
> > On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> Previouly drivers have their own way of mapping range of
> >> kernel pages/memory into user vma and this was done by
> >> invoking vm_insert_page() within a loop.
> >>
> >> As this pattern is common across different drivers, it can
> >> be generalized by creating a new function and use it across
> >> the drivers.
> >>
> >> vm_insert_range is the new API which will be used to map a
> >> range of kernel memory/pages to user vma.
> >>
> >> All the applicable places are converted to use new vm_insert_range
> >> in this patch series.
> >>
> >> Souptick Joarder (9):
> >>   mm: Introduce new vm_insert_range API
> >>   arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range
> >>   drivers/firewire/core-iso.c: Convert to use vm_insert_range
> >>   drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range
> >>   drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range
> >>   iommu/dma-iommu.c: Convert to use vm_insert_range
> >>   videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range
> >>   xen/gntdev.c: Convert to use vm_insert_range
> >>   xen/privcmd-buf.c: Convert to use vm_insert_range
> > Any further comment on driver changes ?
>
> Xen drivers (the last two patches) look fine to me.

Thanks, can I considered this as Reviewed-by ?

>
> -boris
>
>
> >>  arch/arm/mm/dma-mapping.c                         | 21 ++++++-----------
> >>  drivers/firewire/core-iso.c                       | 15 ++----------
> >>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c       | 20 ++--------------
> >>  drivers/gpu/drm/xen/xen_drm_front_gem.c           | 20 +++++-----------
> >>  drivers/iommu/dma-iommu.c                         | 12 ++--------
> >>  drivers/media/common/videobuf2/videobuf2-dma-sg.c | 23 ++++++-------------
> >>  drivers/xen/gntdev.c                              | 11 ++++-----
> >>  drivers/xen/privcmd-buf.c                         |  8 ++-----
> >>  include/linux/mm_types.h                          |  3 +++
> >>  mm/memory.c                                       | 28 +++++++++++++++++++++++
> >>  mm/nommu.c                                        |  7 ++++++
> >>  11 files changed, 70 insertions(+), 98 deletions(-)
> >>
> >> --
> >> 1.9.1
> >>
>
Boris Ostrovsky Nov. 21, 2018, 8:04 p.m. UTC | #4
On 11/21/18 2:56 PM, Souptick Joarder wrote:
> On Thu, Nov 22, 2018 at 1:08 AM Boris Ostrovsky
> <boris.ostrovsky@oracle.com> wrote:
>> On 11/21/18 1:24 AM, Souptick Joarder wrote:
>>> On Thu, Nov 15, 2018 at 9:09 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>>>> Previouly drivers have their own way of mapping range of
>>>> kernel pages/memory into user vma and this was done by
>>>> invoking vm_insert_page() within a loop.
>>>>
>>>> As this pattern is common across different drivers, it can
>>>> be generalized by creating a new function and use it across
>>>> the drivers.
>>>>
>>>> vm_insert_range is the new API which will be used to map a
>>>> range of kernel memory/pages to user vma.
>>>>
>>>> All the applicable places are converted to use new vm_insert_range
>>>> in this patch series.
>>>>
>>>> Souptick Joarder (9):
>>>>   mm: Introduce new vm_insert_range API
>>>>   arch/arm/mm/dma-mapping.c: Convert to use vm_insert_range
>>>>   drivers/firewire/core-iso.c: Convert to use vm_insert_range
>>>>   drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range
>>>>   drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range
>>>>   iommu/dma-iommu.c: Convert to use vm_insert_range
>>>>   videobuf2/videobuf2-dma-sg.c: Convert to use vm_insert_range
>>>>   xen/gntdev.c: Convert to use vm_insert_range
>>>>   xen/privcmd-buf.c: Convert to use vm_insert_range
>>> Any further comment on driver changes ?
>> Xen drivers (the last two patches) look fine to me.
> Thanks, can I considered this as Reviewed-by ?


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>