Verification:

ubuntu@d06-1:~$ dmesg | grep cma
[    0.000000] cma: Reserved 32 MiB at 0x000000007e000000
[    0.000000] Memory: 526954648K/536866624K available (12092K kernel code, 
1694K rwdata, 5112K rodata, 5504K init, 1161K bss, 9879208K reserved, 32768K 
cma-reserved)
ubuntu@d06-1:~$ cat /proc/version
Linux version 5.0.0-21-generic (buildd@bos02-arm64-046) (gcc version 7.4.0 
(Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #22~18.04.1-Ubuntu SMP Thu Jul 4 
17:25:45 UTC 2019


** Tags removed: verification-needed-disco
** Tags added: verification-done-disco

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1823753

Title:
  arm64: cma_alloc errors at boot

Status in linux package in Ubuntu:
  Fix Committed
Status in linux source package in Disco:
  Fix Committed
Status in linux source package in Eoan:
  Fix Committed

Bug description:
  [Impact]
  We enabled CONFIG_DMA_CMA to fix bug 1803206, but that led to a regression
  on other arm64 systems that began spewing these messages on boot - sometimes 
> 10K of them:

  [   19.534097] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12
  [   19.534109] cma: cma_alloc: alloc failed, req-size: 16 pages, ret: -12
  [   19.534113] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12
  [   19.534126] cma: cma_alloc: alloc failed, req-size: 16 pages, ret: -12
  [   19.534130] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12
  [   19.534142] cma: cma_alloc: alloc failed, req-size: 16 pages, ret: -12
  [   19.534146] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12
  [   19.534157] cma: cma_alloc: alloc failed, req-size: 16 pages, ret: -12
  [   19.534161] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12
  [   19.534173] cma: cma_alloc: alloc failed, req-size: 16 pages, ret: -12
  [   19.534177] cma: cma_alloc: alloc failed, req-size: 64 pages, ret: -12

  In a previous SRU (bug 1828092), we worked around this by just rate-
  limiting these messages. These are "err" priority messages though, so
  even a lower number of them is still disconcerting.

  [Fix]
  1) Bump up the amount of available CMA on arm64 to 32M (same as upstream 
defconfig)
  2) A patch-set from linux-next that redirects dma-direct contiguous 
allocations to alloc_pages() for single page allocations (single pages are by 
definition contiguous), avoiding CMA usage/fragmentation.

  [Test Case]
  dmesg | grep "cma_alloc: alloc failed"
  Some system configs will still have some of these errors even after this fix 
- but this should reduce them significantly. Per-driver optimizations can be 
used to make further improvements, but we should track those in other bugs.

  [Regression Risk]
  Tested on a HiSilicon D06 and HP m400 (Hi1620 & X-Gene arm64).
  Regression tested on:
   - Raspberry Pi 3B (see Comment #22)
   - Power9 system (ppc64el)
   - z/VM instance (s390x)
   - Intel Centerton system (amd64)

  Test builds are staged at http://ppa.launchpad.net/~dannf/ubuntu/cma

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1823753/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to