Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E990C433F5 for ; Thu, 23 Dec 2021 08:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347307AbhLWIwo (ORCPT ); Thu, 23 Dec 2021 03:52:44 -0500 Received: from verein.lst.de ([213.95.11.211]:53185 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhLWIwn (ORCPT ); Thu, 23 Dec 2021 03:52:43 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id AB43A68AA6; Thu, 23 Dec 2021 09:52:38 +0100 (CET) Date: Thu, 23 Dec 2021 09:52:38 +0100 From: Christoph Hellwig To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Christoph Hellwig , Baoquan He , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, cl@linux.com, John.p.donnelly@oracle.com, kexec@lists.infradead.org, stable@vger.kernel.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka Subject: Re: [PATCH v3 5/5] mm/slub: do not create dma-kmalloc if no managed pages in DMA zone Message-ID: <20211223085238.GA7555@lst.de> References: <20211213122712.23805-1-bhe@redhat.com> <20211213122712.23805-6-bhe@redhat.com> <20211213134319.GA997240@odroid> <20211214053253.GB2216@MiWiFi-R3L-srv> <20211221085623.GA7733@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 22, 2021 at 12:37:03PM +0000, Hyeonggon Yoo wrote: > Oh I misunderstood this. Underlying physical address of vmalloc()-allocated memory > can be mapped using DMA API, and it needs to be setup as scatterlist because > the allocated memory is not physically continuous. Right? Yes. > BTW, looking at the API I think the scsi case can be converted to use > dma_alloc_pages(). but driver requires 512 bytes of buffer and the API > supports allocating by at least page size. Overallocating is not generally a problem, but if the allocations are for a slow path it might make more sense to stick to dma_map_* and bounce buffer if needed. > It's not a big problem as it allocates a single buffer but in other > cases maybe not. Can't we use dma pool for non-coherent pages? No.