From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754507AbeDTJ7B (ORCPT ); Fri, 20 Apr 2018 05:59:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:33154 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754263AbeDTJ7A (ORCPT ); Fri, 20 Apr 2018 05:59:00 -0400 Date: Fri, 20 Apr 2018 11:58:58 +0200 Message-ID: From: Takashi Iwai To: Christoph Hellwig Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] dma-direct: Try reallocation with GFP_DMA32 if possible In-Reply-To: <20180420094702.GA6530@lst.de> References: <20180416151819.27520-1-tiwai@suse.de> <20180420094702.GA6530@lst.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Apr 2018 11:47:02 +0200, Christoph Hellwig wrote: > > On Mon, Apr 16, 2018 at 05:18:19PM +0200, Takashi Iwai wrote: > > As the recent swiotlb bug revealed, we seem to have given up the > > direct DMA allocation too early and felt back to swiotlb allocation. > > The reason is that swiotlb allocator expected that dma_direct_alloc() > > would try harder to get pages even below 64bit DMA mask with > > GFP_DMA32, but the function doesn't do that but only deals with > > GFP_DMA case. > > > > This patch adds a similar fallback reallocation with GFP_DMA32 as > > we've done with GFP_DMA. The condition is that the coherent mask is > > smaller than 64bit (i.e. some address limitation), and neither GFP_DMA > > nor GFP_DMA32 is set beforehand. > > > > Signed-off-by: Takashi Iwai > > > > --- > > > > This is a resend of a test patch included in the previous thread > > ("swiotlb: Fix unexpected swiotlb_alloc_coherent() failures"). > > I like the patch, but as-is it doesn't apply. Can you resend it against > latest Linus' tree? It's because it's written on the tree with another fix patch I sent beforehand ("[PATCH 1/2] dma-direct: Don't repeat allocation for no-op GFP_DMA"). Could you check that one at first? I'm fine to rebase and resubmit this one, if still preferred, though. thanks, Takashi