All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Improve handling of GFP flags in the CMA allocator
@ 2019-02-18 21:07 Gabriel Krisman Bertazi
  2019-02-18 21:07 ` [PATCH 1/6] Revert "kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous()" Gabriel Krisman Bertazi
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2019-02-18 21:07 UTC (permalink / raw)
  To: linux-mm
  Cc: labbott, kernel, gael.portay, mike.kravetz, m.szyprowski,
	Gabriel Krisman Bertazi

Hi,

The main goal of this patchset is to solve a deadlock in the CMA
allocator, which happens because cma_alloc tries to sleep waiting for an
IO in the GFP_NOIO path.  This issue, which was reported by Gael Portay
was discussed here:

https://groups.google.com/a/lists.one-eyed-alien.net/forum/#!topic/usb-storage/BXpAsg-G1us

My proposed requires reverting the patches that removed the gfp flags
information from cma_alloc() (patches 1 to 3).  According to the author,
that parameter was removed because it misleads developers about what
cma_alloc actually supports. In his specific case he had problems with
GFP_ZERO.  With that in mind I gave a try at implementing GFP_ZERO in a
quite trivial way in patch 4.  Finally, patches 5 and 6 attempt to fix
the issue by avoiding the unecessary serialization done around
alloc_contig_range.

This is my first adventure in the mm subsystem, so I hope I didn't screw
up something very obvious. I tested this on the workload that was
deadlocking (arm board, with CMA intensive operations from the GPU and
USB), as well as some scripting on top of debugfs.  Is there any
regression test I should be running, which specially applies to the CMA
code?


Gabriel Krisman Bertazi (6):
  Revert "kernel/dma: remove unsupported gfp_mask parameter from
    dma_alloc_from_contiguous()"
  Revert "mm/cma: remove unsupported gfp_mask parameter from
    cma_alloc()"
  cma: Warn about callers requesting unsupported flags
  cma: Add support for GFP_ZERO
  page_isolation: Propagate temporary pageblock isolation error
  cma: Isolate pageblocks speculatively during allocation

 arch/arm/mm/dma-mapping.c                  |  5 +--
 arch/arm64/mm/dma-mapping.c                |  2 +-
 arch/powerpc/kvm/book3s_hv_builtin.c       |  2 +-
 arch/xtensa/kernel/pci-dma.c               |  2 +-
 drivers/iommu/amd_iommu.c                  |  2 +-
 drivers/iommu/intel-iommu.c                |  3 +-
 drivers/s390/char/vmcp.c                   |  2 +-
 drivers/staging/android/ion/ion_cma_heap.c |  2 +-
 include/linux/cma.h                        |  2 +-
 include/linux/dma-contiguous.h             |  4 +-
 kernel/dma/contiguous.c                    |  6 +--
 kernel/dma/direct.c                        |  3 +-
 kernel/dma/remap.c                         |  2 +-
 mm/cma.c                                   | 51 ++++++++++++++++++----
 mm/cma_debug.c                             |  2 +-
 mm/page_isolation.c                        | 20 ++++++---
 16 files changed, 74 insertions(+), 36 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2019-02-28  8:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 21:07 [PATCH 0/6] Improve handling of GFP flags in the CMA allocator Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 1/6] Revert "kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous()" Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 2/6] Revert "mm/cma: remove unsupported gfp_mask parameter from cma_alloc()" Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 3/6] cma: Warn about callers requesting unsupported flags Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 4/6] cma: Add support for GFP_ZERO Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 5/6] page_isolation: Propagate temporary pageblock isolation error Gabriel Krisman Bertazi
2019-02-18 21:07 ` [PATCH 6/6] cma: Isolate pageblocks speculatively during allocation Gabriel Krisman Bertazi
2019-02-21 12:39 ` [PATCH 0/6] Improve handling of GFP flags in the CMA allocator Vlastimil Babka
2019-02-26 14:29 ` Christoph Hellwig
2019-02-28  0:12   ` Laura Abbott
2019-02-28  8:46     ` Michal Hocko

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.