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 B31DDC433EF for ; Sat, 19 Feb 2022 07:19:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 489226B0071; Sat, 19 Feb 2022 02:19:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 438676B0074; Sat, 19 Feb 2022 02:19:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 328406B0075; Sat, 19 Feb 2022 02:19:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 25ED96B0071 for ; Sat, 19 Feb 2022 02:19:04 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D2CF8998CF for ; Sat, 19 Feb 2022 07:19:03 +0000 (UTC) X-FDA: 79158677766.25.D7C9CFF Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf19.hostedemail.com (Postfix) with ESMTP id 571341A0005 for ; Sat, 19 Feb 2022 07:19:03 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 77C1268BEB; Sat, 19 Feb 2022 08:19:00 +0100 (CET) Date: Sat, 19 Feb 2022 08:19:00 +0100 From: Christoph Hellwig To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, 42.hyeyoo@gmail.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, David.Laight@ACULAB.COM, david@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, steffen.klassert@secunet.com, netdev@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, michael@walle.cc, linux-i2c@vger.kernel.org, wsa@kernel.org Subject: Re: [PATCH 22/22] mtd: rawnand: Use dma_alloc_noncoherent() for dma buffer Message-ID: <20220219071900.GH26711@lst.de> References: <20220219005221.634-1-bhe@redhat.com> <20220219005221.634-23-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220219005221.634-23-bhe@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 571341A0005 X-Stat-Signature: ucpcjnmkqb5g8rrktauhsbkfa87b76rk X-HE-Tag: 1645255143-841497 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 Sat, Feb 19, 2022 at 08:52:21AM +0800, Baoquan He wrote: > Use dma_alloc_noncoherent() instead of directly allocating buffer > from kmalloc with GFP_DMA. DMA API will try to allocate buffer > depending on devices addressing limitation. I think it would be better to still allocate the buffer at allocation time and then just transfer ownership using dma_sync_single* in the I/O path to avoid the GFP_ATOMIC allocation.