All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] add struct page and Direct I/O support to reserved memory
@ 2022-07-11 12:24 ` Li Chen
  0 siblings, 0 replies; 68+ messages in thread
From: Li Chen @ 2022-07-11 12:24 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Rob Herring, Frank Rowand, Andrew Morton
  Cc: Li Chen, linux-arm-kernel, linux-kernel, devicetree, linux-mm

This patch series use ZONE_DEVICE and mhp to add Direct I/O support to reserved memory
when rmem is as dio's src buffer.

Our use case is when isp generates frame and writes to given memory region, arm(kernel) will
try to read frames from the reserved memory region. If throughput is low, frame loss
will be serious.

Before this patch series, we can only use bufferd I/O and the throughput is very low even
with the help of AIO/io_uring.

This patch is tested on v5.15.35 + no-map rmem region, and can be git am into
5.19-rc5 without conflicts.

Li Chen (4):
  of: add struct page support to rmem
  mm/sparse: skip no-map memblock check when fill_subsection_map
  arm64: mm: move memblock_clear_nomap after __add_pages
  sample/reserved_mem: Introduce a sample of struct page and dio support
    to no-map rmem

 arch/arm64/mm/mmu.c             |   2 +-
 drivers/of/Kconfig              |   9 ++
 drivers/of/of_reserved_mem.c    | 218 +++++++++++++++++++++++++++++++-
 include/linux/of_reserved_mem.h |  11 ++
 mm/sparse.c                     |   4 +-
 samples/Kconfig                 |   7 +
 samples/Makefile                |   1 +
 samples/reserved_mem/Makefile   |   2 +
 samples/reserved_mem/rmem_dio.c | 116 +++++++++++++++++
 9 files changed, 367 insertions(+), 3 deletions(-)
 create mode 100755 samples/reserved_mem/Makefile
 create mode 100755 samples/reserved_mem/rmem_dio.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 68+ messages in thread
* Re: [PATCH 1/4] of: add struct page support to rmem
  2022-07-11 12:24   ` Li Chen
  (?)
  (?)
@ 2022-07-18 13:21 ` Dan Carpenter
  -1 siblings, 0 replies; 68+ messages in thread
From: kernel test robot @ 2022-07-18  9:26 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3910 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220711122459.13773-2-me@linux.beauty>
References: <20220711122459.13773-2-me@linux.beauty>
TO: Li Chen <me@linux.beauty>
TO: Catalin Marinas <catalin.marinas@arm.com>
TO: Will Deacon <will@kernel.org>
TO: Rob Herring <robh+dt@kernel.org>
TO: Frank Rowand <frowand.list@gmail.com>
TO: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Li Chen <lchen@ambarella.com>
CC: linux-arm-kernel(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
CC: devicetree(a)vger.kernel.org

Hi Li,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on arm64/for-next/core arm-perf/for-next/perf linus/master v5.19-rc7 next-20220715]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Li-Chen/add-struct-page-and-Direct-I-O-support-to-reserved-memory/20220711-202957
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: nios2-randconfig-m031-20220717 (https://download.01.org/0day-ci/archive/20220718/202207181758.YyEzUSPl-lkp(a)intel.com/config)
compiler: nios2-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/of/of_reserved_mem.c:472 get_reserved_mem_from_dev() error: passing non negative 22 to ERR_PTR

vim +472 drivers/of/of_reserved_mem.c

8b66b4b9614f1c7 Li Chen 2022-07-11  448  
8b66b4b9614f1c7 Li Chen 2022-07-11  449  /**
8b66b4b9614f1c7 Li Chen 2022-07-11  450   * get_reserved_mem_from_dev() - get reserved_mem from a device node
8b66b4b9614f1c7 Li Chen 2022-07-11  451   * @dev: device pointer
8b66b4b9614f1c7 Li Chen 2022-07-11  452   *
8b66b4b9614f1c7 Li Chen 2022-07-11  453   * This function look for reserved_mem from given device.
8b66b4b9614f1c7 Li Chen 2022-07-11  454   *
8b66b4b9614f1c7 Li Chen 2022-07-11  455   * Returns a reserved_mem pointer, or NULL on error.
8b66b4b9614f1c7 Li Chen 2022-07-11  456   */
8b66b4b9614f1c7 Li Chen 2022-07-11  457  struct reserved_mem *get_reserved_mem_from_dev(struct device *dev)
8b66b4b9614f1c7 Li Chen 2022-07-11  458  {
8b66b4b9614f1c7 Li Chen 2022-07-11  459  	struct device_node *np = dev_of_node(dev);
8b66b4b9614f1c7 Li Chen 2022-07-11  460  	struct device_node *rmem_np;
8b66b4b9614f1c7 Li Chen 2022-07-11  461  	struct reserved_mem *rmem = NULL;
8b66b4b9614f1c7 Li Chen 2022-07-11  462  
8b66b4b9614f1c7 Li Chen 2022-07-11  463  	rmem_np = of_parse_phandle(np, "memory-region", 0);
8b66b4b9614f1c7 Li Chen 2022-07-11  464  	if (!rmem_np) {
8b66b4b9614f1c7 Li Chen 2022-07-11  465  		dev_err(dev, "failed to get memory region node\n");
8b66b4b9614f1c7 Li Chen 2022-07-11  466  		return ERR_PTR(-ENODEV);
8b66b4b9614f1c7 Li Chen 2022-07-11  467  	}
8b66b4b9614f1c7 Li Chen 2022-07-11  468  
8b66b4b9614f1c7 Li Chen 2022-07-11  469  	rmem = of_reserved_mem_lookup(rmem_np);
8b66b4b9614f1c7 Li Chen 2022-07-11  470  	if (!rmem) {
8b66b4b9614f1c7 Li Chen 2022-07-11  471  		dev_err(dev, "Failed to lookup reserved memory\n");
8b66b4b9614f1c7 Li Chen 2022-07-11 @472  		return ERR_PTR(EINVAL);
8b66b4b9614f1c7 Li Chen 2022-07-11  473  	}
8b66b4b9614f1c7 Li Chen 2022-07-11  474  	return rmem;
8b66b4b9614f1c7 Li Chen 2022-07-11  475  }
8b66b4b9614f1c7 Li Chen 2022-07-11  476  EXPORT_SYMBOL_GPL(get_reserved_mem_from_dev);
8b66b4b9614f1c7 Li Chen 2022-07-11  477  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-08-05 15:30 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 12:24 [PATCH 0/4] add struct page and Direct I/O support to reserved memory Li Chen
2022-07-11 12:24 ` Li Chen
2022-07-11 12:24 ` [PATCH 1/4] of: add struct page support to rmem Li Chen
2022-07-11 12:24   ` Li Chen
2022-07-11 13:36   ` Arnd Bergmann
2022-07-11 13:36     ` Arnd Bergmann
2022-07-11 14:51     ` Li Chen
2022-07-11 14:51       ` Li Chen
2022-07-11 15:06       ` Arnd Bergmann
2022-07-11 15:06         ` Arnd Bergmann
2022-07-12  3:13         ` Li Chen
2022-07-12  3:13           ` Li Chen
2022-07-16  0:38   ` kernel test robot
2022-07-16  0:38     ` kernel test robot
2022-07-11 12:24 ` [PATCH 2/4] mm/sparse: skip no-map memblock check when fill_subsection_map Li Chen
2022-07-11 12:24   ` Li Chen
2022-07-11 14:53   ` David Hildenbrand
2022-07-11 14:53     ` David Hildenbrand
2022-07-12  4:23     ` Li Chen
2022-07-12  4:23       ` Li Chen
2022-07-12  7:31       ` David Hildenbrand
2022-07-12  7:31         ` David Hildenbrand
2022-07-12  9:31         ` Li Chen
2022-07-12  9:31           ` Li Chen
2022-07-14 18:45   ` kernel test robot
2022-07-14 18:45     ` kernel test robot
2022-07-11 12:24 ` [PATCH 3/4] arm64: mm: move memblock_clear_nomap after __add_pages Li Chen
2022-07-11 12:24   ` Li Chen
2022-07-11 12:24 ` [PATCH 4/4] sample/reserved_mem: Introduce a sample of struct page and dio support to no-map rmem Li Chen
2022-07-11 12:24   ` Li Chen
2022-07-11 13:28   ` Arnd Bergmann
2022-07-11 13:28     ` Arnd Bergmann
2022-07-12  0:26     ` Li Chen
2022-07-12  0:26       ` Li Chen
2022-07-12  7:50       ` Arnd Bergmann
2022-07-12  7:50         ` Arnd Bergmann
2022-07-12  9:58         ` Li Chen
2022-07-12  9:58           ` Li Chen
2022-07-12 10:08           ` Arnd Bergmann
2022-07-12 10:08             ` Arnd Bergmann
2022-07-12 10:20             ` Arnd Bergmann
2022-07-12 10:20               ` Arnd Bergmann
2022-07-12 10:55             ` Li Chen
2022-07-12 10:55               ` Li Chen
2022-07-12 12:10               ` Arnd Bergmann
2022-07-12 12:10                 ` Arnd Bergmann
2022-08-04  7:17         ` Li Chen
2022-08-04  7:17           ` Li Chen
2022-08-04  8:24           ` Arnd Bergmann
2022-08-04  8:24             ` Arnd Bergmann
2022-08-04 10:07             ` Li Chen
2022-08-04 10:07               ` Li Chen
2022-08-05 14:09               ` Arnd Bergmann
2022-08-05 14:09                 ` Arnd Bergmann
2022-08-05 15:28                 ` David Hildenbrand
2022-08-05 15:28                   ` David Hildenbrand
2022-07-11 15:01 ` [PATCH 0/4] add struct page and Direct I/O support to reserved memory Christoph Hellwig
2022-07-11 15:01   ` Christoph Hellwig
2022-07-11 16:05   ` Li Chen
2022-07-11 16:05     ` Li Chen
2022-07-11 16:09     ` Christoph Hellwig
2022-07-11 16:09       ` Christoph Hellwig
2022-07-12  0:14       ` Li Chen
2022-07-12  0:14         ` Li Chen
2022-07-18  9:26 [PATCH 1/4] of: add struct page support to rmem kernel test robot
2022-07-18 13:21 ` Dan Carpenter
2022-07-18 13:21 ` Dan Carpenter
2022-07-18 13:21 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.