Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3219015imm; Fri, 25 May 2018 01:42:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZos76Pp5nAcBZ9FPqhdrLn4MlnkzMTuuEd53aocRM0ieLV2hBhXeMo3vkO/JmMwakpmhj19 X-Received: by 2002:a63:7209:: with SMTP id n9-v6mr1286501pgc.146.1527237723210; Fri, 25 May 2018 01:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237723; cv=none; d=google.com; s=arc-20160816; b=aSIAXlhgu3lmsuUkvtBBljz8TEsLccQPSLNEauI83pdzYKYIpfRdzw7JWM1a7Psu8I tswlLODQS2PXNU0vwddJSKArres8uEe6rU0+aLEG/mviqEScpjy3KA2MAS2iMCMgEJi+ GS9U9PWk5Lko5fZXVGJWKGaGRwlOgytsSiKYahLukagehGU4qGUX3DvPITft4kx3Uho+ tATsxSwrvGSo095iCwPzVF1BzyxvEpwReT07nuOmIs0X0sgEfHzqcaLiHxcfexosofIt n6TzroaGTwLoxtl2QN3kLwKrLy4gnaAY6yRwGrwVWo9C+pkrhC3kseJPEHDm+GXygJ82 /tuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=UIVomHxhHmipgo434tsSd3OMtEUWIFHy1A/sZdTBvGc=; b=QnxEVfd1+O2E8ORU1961zfpfwQZIzGcaChKY7Jwhhf9pB3rm8cUjo+ETL4vbYQHawW LLmULS9W7NCirPmMyePaZNS5H+ODN/j4+CCED3B6OL2BZp/hkF28quaPL3MECwVQEmr4 ShBoyDPRqJeJFoIaoYD5o5opDgAJOoNI7B+dMvJ9s96sIMTiF/0Fock+sbvQ6Y3fYAnT R0YaEdLVA8GF/xFyWyb95KwUaJsEw7MO7vuARHKis9NcPXlw16MN9GfzS1pXG4hkoYQ9 zQsMsUt5eYk/3PgMuk/oj89MgJT+kE6KYGl2thbD36pUEeTw0+MM4NEYQCLyQkLahA7K AVbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10-v6si17874499pgp.419.2018.05.25.01.41.48; Fri, 25 May 2018 01:42:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965078AbeEYIlg (ORCPT + 99 others); Fri, 25 May 2018 04:41:36 -0400 Received: from mail.netline.ch ([148.251.143.178]:41889 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964791AbeEYIle (ORCPT ); Fri, 25 May 2018 04:41:34 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 46E1D2A6045; Fri, 25 May 2018 10:41:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id webAF3FLKxd1; Fri, 25 May 2018 10:41:31 +0200 (CEST) Received: from thor (145.233.60.188.dynamic.wline.res.cust.swisscom.ch [188.60.233.145]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id C071F2A6042; Fri, 25 May 2018 10:41:30 +0200 (CEST) Received: from localhost ([::1]) by thor with esmtp (Exim 4.91) (envelope-from ) id 1fM8Hy-0006QA-9x; Fri, 25 May 2018 10:41:30 +0200 Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test To: Christoph Hellwig , christian.koenig@amd.com Cc: Konrad Rzeszutek Wilk , Linux Kernel Mailing List , dri-devel , iommu@lists.linux-foundation.org References: <20180501132411.2311-1-michel@daenzer.net> <786ca83f-45c4-264b-2aef-d84fb18d3d28@gmail.com> <20180502124151.GA22857@lst.de> <1066dfa2-2f78-815d-c65a-9d09eb35458c@daenzer.net> <20180502162145.GA26787@lst.de> <1cbc4e10-96e6-c222-fb1a-fd7847be5755@gmail.com> <20180525084120.GA19063@lst.de> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <0a17ab46-2d42-48ae-cf1f-492e17254767@daenzer.net> Date: Fri, 25 May 2018 10:41:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180525084120.GA19063@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-25 10:41 AM, Christoph Hellwig wrote: > On Tue, May 22, 2018 at 03:13:58PM +0200, Christian König wrote: >> Am 02.05.2018 um 18:59 schrieb Michel Dänzer: >>> On 2018-05-02 06:21 PM, Christoph Hellwig wrote: >>>> On Wed, May 02, 2018 at 04:31:09PM +0200, Michel Dänzer wrote: >>>>>> No. __GFP_NOWARN (and gfp_t flags in general) are the wrong interface >>>>>> for dma allocations and just cause problems. I actually plan to >>>>>> get rid of the gfp_t argument in dma_alloc_attrs sooner, and only >>>>>> allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent. >>>>> How about GFP_TRANSHUGE_LIGHT? TTM uses that to opportunistically >>>>> allocate huge pages (GFP_TRANSHUGE can result in unacceptably long >>>>> delays with memory pressure). >>>> Well, that is exactly what I don't want drivers to do - same for >>>> __GFP_COMP in some drm code. This very much assumes the page allocator >>>> is used to back dma allocations, which very often it actually isn't, and >>>> any use of magic gfp flags creates a tight coupling of consumers with a >>>> specific implementation. >>>> >>>> In general I can't think of a good reason not to actually use >>>> GFP_TRANSHUGE_LIGHT by default in the dma allocator unless >>>> DMA_ATTR_ALLOC_SINGLE_PAGES is set. Can you prepare a patch for that? >>> I'm afraid I'll have to leave that to somebody else. >> >> Coming back to this topic once more, sorry for the delay but busy as usual >> :) >> >> What exactly do you mean with "dma allocator" here? The TTM allocator using >> the dma_alloc_coherent calls? Or the swiotlb implementation of the calls? > > dma allocatr in this case: backends for dma_alloc_coherent/ > dma_alloc_attrs. Most importantly dma_direct_alloc. > > But while we're at it I can't actually see any GFP_TRANSHUGE_LIGHT > usage in TTM, just plain old GFP_TRANSHUGE. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da291320baec914f0bb4e65a9dccb86bd6c728f2 . -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer