Received: by 10.192.165.148 with SMTP id m20csp864439imm; Wed, 2 May 2018 10:00:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZotqI7gLMF4qdKuDqg7EWKcIc8tLd+di0RxEdvfp/52Jk/IO73FO0e2gneSEXG7Dn8j3g+/ X-Received: by 2002:a65:4502:: with SMTP id n2-v6mr16249755pgq.95.1525280420666; Wed, 02 May 2018 10:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525280420; cv=none; d=google.com; s=arc-20160816; b=SluO3WYXJkbwGB5l8ns3b4JLLGL/ZmBK6iGIm6VfBDGGLX+1EsY44VL6YvGn2j+L+x gTySzWiTx1PUhm7LBqcDO1wgYPKcvypaXgr0wSb3eGHfpkC+jttd5kRDBwOYP3uhKgmH RQGmg3IacZZH15oRS9TTZGciuhi4bIhHI34jPiQgSSYKKXBPBM6FZtkfk7h+adX2DOW5 8pgvhpbGjWDRq97owFEWEMiiMjqyMnQlVqvsxtaPOWCYnYeKowZYuztNDtTRwxcRRvYS n5SCjnYqwSKMWL+7KEpw5RbZ928N2FwbrLI9QnbWdcdfLSdW7qTFy+vjnGTX5WKI1LQN e5KQ== 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=cp2a84A9nPcdP0ekNL1JkkFNzYfbLx1NivkDcWoFqGk=; b=k0PqA89fTju8YbJ+zyk7slvvtVQqVtC3S25v/Dk1FN/xL1PTdiWZuEw4CFhcfpNdqB 2Tqqj8w78XIAqFmrHTcz57ivj3gT1FrnjtkFe/VKD5yAP7KaW5CWJn18SoHIioO03s8J Be9BzgDhOO8pe37luytT+095du/wQW1uNVw+CHh6LsuK6e+gUMlJpDicdbembsSjL33r HAnJPf7gCNaf1q28Gzz6P5AvkTK5gbVUsnnKCKALqm06ZiKqbVND0FTHzShtvG37Rn25 GckiaTqLLjuFjr+QugRfZrlo/Jr3I4w2XuUNzeFpR3BmTiQqHkKmpBbwAWqu6UoXBCyO cTcw== 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 a64-v6si10024185pge.386.2018.05.02.10.00.06; Wed, 02 May 2018 10:00:20 -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 S1751747AbeEBQ7s (ORCPT + 99 others); Wed, 2 May 2018 12:59:48 -0400 Received: from mail.netline.ch ([148.251.143.178]:38133 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeEBQ7r (ORCPT ); Wed, 2 May 2018 12:59:47 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 7B5042A6048; Wed, 2 May 2018 18:59:45 +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 OPdx4HnuUo64; Wed, 2 May 2018 18:59:44 +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 D08892A6045; Wed, 2 May 2018 18:59:44 +0200 (CEST) Received: from localhost ([::1]) by thor with esmtp (Exim 4.91) (envelope-from ) id 1fDv6W-0005k0-4v; Wed, 02 May 2018 18:59:44 +0200 Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test To: Christoph Hellwig Cc: Konrad Rzeszutek Wilk , Linux Kernel Mailing List , dri-devel , iommu@lists.linux-foundation.org, =?UTF-8?Q?Christian_K=c3=b6nig?= 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> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: Date: Wed, 2 May 2018 18:59:42 +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: <20180502162145.GA26787@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-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. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer