mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Huan Yang <link@vivo.com>
To: vivek.kasireddy@intel.com,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com, Huan Yang <link@vivo.com>
Subject: [PATCH v5 0/7] udmbuf bug fix and some improvements
Date: Tue,  3 Sep 2024 16:38:05 +0800	[thread overview]
Message-ID: <20240903083818.3071759-1-link@vivo.com> (raw)

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

By this patchset, udmabuf remove page struct relay, only use
pfn and folios.

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

Any patch 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

Changelog
===
  v4 -> v5:
    Patch1 doc why pre-fault failed not report error.
    Patch2 no change
    Patch3 update ack tag marked in v4
    Patch4 split some change into patch5 and patch7, this only contains
           udmabuf pin folio's function
    Patch5 add helper init/deini to clean udmabuf struct initialized
    Patch6 remove unnecessary code
    Patch7 remove reuse folio remove v4 patch4

  v3 -> v4:
    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

v4
  https://lore.kernel.org/all/20240822084342.1574914-1-link@vivo.com/
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 (7):
  udmabuf: pre-fault when first page fault
  udmabuf: change folios array from kmalloc to kvmalloc
  udmabuf: fix vmap_udmabuf error page set
  udmabuf: udmabuf_create pin folio codestyle cleanup
  udmabuf: introduce udmabuf init and deinit helper
  udmabuf: remove udmabuf_folio
  udmabuf: reuse folio array when pin folios

 drivers/dma-buf/Kconfig   |   1 +
 drivers/dma-buf/udmabuf.c | 272 +++++++++++++++++++++++---------------
 2 files changed, 166 insertions(+), 107 deletions(-)


base-commit: c79c85875f1af04040fe4492ed94ce37ad729c4d
-- 
2.45.2


             reply	other threads:[~2024-09-03  8:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03  8:38 Huan Yang [this message]
2024-09-03  8:38 ` [PATCH v5 1/7] udmabuf: pre-fault when first page fault Huan Yang
2024-09-06  8:12   ` Kasireddy, Vivek
2024-09-06  8:37     ` Huan Yang
2024-09-03  8:38 ` [PATCH v5 2/7] udmabuf: change folios array from kmalloc to kvmalloc Huan Yang
2024-09-03  8:38 ` [PATCH v5 3/7] udmabuf: fix vmap_udmabuf error page set Huan Yang
2024-09-03  8:38 ` [PATCH v5 4/7] udmabuf: udmabuf_create pin folio codestyle cleanup Huan Yang
2024-09-06  8:17   ` Kasireddy, Vivek
2024-09-06  8:30     ` Huan Yang
2024-09-09  5:03       ` Kasireddy, Vivek
2024-09-09  6:31         ` Huan Yang
2024-09-03  8:38 ` [PATCH v5 5/7] udmabuf: introduce udmabuf init and deinit helper Huan Yang
2024-09-06  8:20   ` Kasireddy, Vivek
2024-09-06  8:38     ` Huan Yang
2024-09-03  8:38 ` [PATCH v5 6/7] udmabuf: remove udmabuf_folio Huan Yang
2024-09-06  8:22   ` Kasireddy, Vivek
2024-09-06  8:39     ` Huan Yang
2024-09-03  8:38 ` [PATCH v5 7/7] udmabuf: reuse folio array when pin folios Huan Yang
2024-09-06  8:23   ` Kasireddy, Vivek
2024-09-06  8:40     ` Huan Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240903083818.3071759-1-link@vivo.com \
    --to=link@vivo.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=sumit.semwal@linaro.org \
    --cc=vivek.kasireddy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®