mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/5] udmbuf bug fix and some improvements
@ 2024-08-22  8:43 Huan Yang
  2024-08-22  8:43 ` [PATCH v4 1/5] udmabuf: direct map pfn when first page fault Huan Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Huan Yang @ 2024-08-22  8:43 UTC (permalink / raw)
  To: Sumit Semwal, Christian König, Gerd Hoffmann, linux-media,
	dri-devel, linaro-mm-sig, linux-kernel
  Cc: opensource.kernel, Huan Yang

This patchset attempts to fix some errors in udmabuf and remove the
upin_list structure.

Some of this fix just gather the patches which I upload before.

Patch 1,2,4,5 has passed the udmabuf self-test suite's tests.
Suggested by Kasireddy, Vivek <vivek.kasireddy@intel.com>
Patch5 modified the unpin function, therefore running the udmabuf
self-test program in a loop did not reveal any memory leaks.

Notice: Test item 6 maybe requires running the command:
  echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

Patch1
===
mmap just pre-fault when the first access

test this by look run create udmabuf
size 3GB, then only record the "mmap -> memset"'s time.
This average show 1.2s cost

compare to direct map when mmap, this also show 1.2s cost.

environment: archlinux, linux-next, 16G, 4 core.

Patch2
===
This is the same to patch:
https://lore.kernel.org/all/20240725021349.580574-1-link@vivo.com/

Patch3
===
fix current implementation of udmabuf's vmap issues, use pfn.

Patch4
===
Change codestyle and fix a potential bug.


Patch5
===
Attempt to remove unpin_list and other related data structures.


Changelog
===
  v4 -> v3:
    Patch1 fill vma area with pfn only when true access.
    Patch2 no change
    Patch3 select VMAP_PFN
    Patch4 use function pin each item.
    Patch5 use pinned folio array instead udmabuf_folio struct.
  v2 -> v3:
    Patch1, avoid use page, instead, use pfn, and use vmf_insert_pfn map
    suggested-by Kasireddy, Vivek <vivek.kasireddy@intel.com>

    Patch2, update acked-by Kasireddy, Vivek <vivek.kasireddy@intel.com>
    And keep the kvcalloc on the same line.

    Patch3, avoid use page, instead, use pfn, then use vmap_pfn map

    Patch4, split v2 patch4, single update codestyle to keep review
    easy.

    Patch5, another way to remove udmabuf_folio
    
---
  v1 -> v2:
    Patch1, 3 Rectify the improper use of the sg table.
    suggested-by Christian König <christian.koenig@amd.com>
    
    Patch2 add acked-by Christian K�nig <christian.koenig@amd.com> which
    marked in v1

    Patch4
    Modify the data structure to restore the use of pages and
    correct the misunderstanding of loop conditions such as "pgcnt".
    make sure pass self test.

    remove v1's patch4
v3
  https://lore.kernel.org/all/20240813090518.3252469-1-link@vivo.com/
v2
  https://lore.kernel.org/all/20240805032550.3912454-1-link@vivo.com/
v1
  https://lore.kernel.org/all/20240801104512.4056860-1-link@vivo.com/

Huan Yang (5):
  udmabuf: direct map pfn when first page fault
  udmabuf: change folios array from kmalloc to kvmalloc
  udmabuf: fix vmap_udmabuf error page set
  udmabuf: udmabuf_create codestyle cleanup
  udmabuf: remove udmabuf_folio

 drivers/dma-buf/Kconfig   |   1 +
 drivers/dma-buf/udmabuf.c | 281 +++++++++++++++++++++++---------------
 2 files changed, 172 insertions(+), 110 deletions(-)


base-commit: 6a7917c89f219f09b1d88d09f376000914a52763
-- 
2.45.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-08-29 10:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22  8:43 [PATCH v4 0/5] udmbuf bug fix and some improvements Huan Yang
2024-08-22  8:43 ` [PATCH v4 1/5] udmabuf: direct map pfn when first page fault Huan Yang
2024-08-29  6:08   ` Kasireddy, Vivek
2024-08-29  6:35     ` Huan Yang
2024-08-22  8:43 ` [PATCH v4 2/5] udmabuf: change folios array from kmalloc to kvmalloc Huan Yang
2024-08-22  8:43 ` [PATCH v4 3/5] udmabuf: fix vmap_udmabuf error page set Huan Yang
2024-08-29  6:10   ` Kasireddy, Vivek
2024-08-22  8:43 ` [PATCH v4 4/5] udmabuf: udmabuf_create codestyle cleanup Huan Yang
2024-08-29  6:39   ` Kasireddy, Vivek
2024-08-29  6:51     ` Huan Yang
2024-08-29 10:17   ` Dan Carpenter
2024-08-22  8:43 ` [PATCH v4 5/5] udmabuf: remove udmabuf_folio Huan Yang
2024-08-29  6:47   ` Kasireddy, Vivek
2024-08-29  6:52     ` Huan Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®