From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4F8FC433FE for ; Thu, 23 Dec 2021 08:52:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA5E96B0072; Thu, 23 Dec 2021 03:52:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D55B96B0073; Thu, 23 Dec 2021 03:52:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C44D66B0074; Thu, 23 Dec 2021 03:52:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id B21AB6B0072 for ; Thu, 23 Dec 2021 03:52:43 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 65827180EB715 for ; Thu, 23 Dec 2021 08:52:43 +0000 (UTC) X-FDA: 78948443406.01.90F33CB Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf19.hostedemail.com (Postfix) with ESMTP id BD51D1A000A for ; Thu, 23 Dec 2021 08:52:42 +0000 (UTC) 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) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: BD51D1A000A X-Stat-Signature: fftb7j3k6cneqcbf6ikp3ziiwcy514ff Authentication-Results: imf19.hostedemail.com; dkim=none; spf=none (imf19.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-HE-Tag: 1640249562-810275 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.