lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250513092709.1869-1-tao.wangtao@honor.com>
Date: Tue, 13 May 2025 17:27:09 +0800
From: wangtao <tao.wangtao@...or.com>
To: <sumit.semwal@...aro.org>, <christian.koenig@....com>,
	<benjamin.gaignard@...labora.com>, <Brian.Starkey@....com>,
	<jstultz@...gle.com>, <tjmercier@...gle.com>
CC: <linux-media@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
	<linaro-mm-sig@...ts.linaro.org>, <linux-kernel@...r.kernel.org>,
	<bintian.wang@...or.com>, <yipengxiang@...or.com>, <liulu.liu@...or.com>,
	<feng.han@...or.com>
Subject: [PATCH 0/2] dma-buf: Add direct I/O support via DMA_BUF_IOCTL_RW_FILE

Introduce DMA_BUF_IOCTL_RW_FILE ioctl for direct file I/O on dma-buf objects.

CURRENT WORKFLOW:
1. Allocate dma-buf:
   dmabuf_fd = dmabuf_alloc(len, heap_fd)
2. Map memory:
   vaddr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, dmabuf_fd, 0)
3. File operations:
   file_fd = open(file_path, O_RDONLY)
   lseek(file_fd, pos)
   // 70% time spent on page cache management and memory copies
   read(file_fd, vaddr, len)

KEY OPTIMIZATIONS:
- Convert sg_table to bio_vec
- Enable IOCB_DIRECT flag
- Execute I/O via vfs_iocb_iter_read()

OPTIMIZED WORKFLOW:
   dmabuf_fd = dmabuf_alloc(len, heap_fd)
   file_fd = open(file_path, O_RDONLY)
   if (direct_io) arg.flags |= DMA_BUF_RW_FLAGS_DIRECT
   ioctl(dmabuf_fd, DMA_BUF_IOCTL_RW_FILE, &arg)

PERFORMANCE RESULTS:
- Throughput: 3776 MB/s (UFS 4.0 4GB/s limit)
- Page cache overhead eliminated
- Direct data path reduces memory copies

APPLICABLE SCENARIOS:
- AI model loading
- Real-time data acquisition
- Task snapshot persistence

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ