Received: by 10.192.165.148 with SMTP id m20csp824919imm; Wed, 2 May 2018 09:21:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpi7CsALk6cc//0mtP3ffch0lcC4jr+xDKV4m+BxjcWZBBV64zYGvPD4dAW0D04kGZ8Yx0h X-Received: by 2002:a17:902:bd46:: with SMTP id b6-v6mr20794020plx.170.1525278068391; Wed, 02 May 2018 09:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525278068; cv=none; d=google.com; s=arc-20160816; b=Be+bEHmFfFB8jKzAE/ho3HBWs0jrcjVHKm/52P5B+B11q+ncSldx3pTeKxW8BBe7bz zuNiw0toTYX32u/gZd7aupeLbNx9OnS3ejEWWfUpC8rCWsoTQb4SUvetjFv+T/mNKDZC BkmU5b58yJrMpOQhjbGPlbwIvHm16lXJBctyCCAhjC64m8s5bezysjn67kTNYIQs8Pin dm7cAwSTW7F+E2q5vtWbyQftmpTRVBom8viM1+NvSfR0J6ZFNuYUOEHi51XAOm3ZjSF1 Xyay2UWA2ThG8vTmNKyPmAYA+4Tz4Yt0tVAGzGxp1CTj/wUj+O8Lof01XJwMnpC9cf+3 DNdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=hDkv93uTeFwTUG8Ci9/06fTZAJytCBZY3FMVegkw4Wg=; b=hUaw38x5c6mU7w3Y07ThQVVrvc8Q/8oiE3eAuYgf3b/XHeFlzjFrdA5iaf4sgWXdgi mPJnzOXugb6zjgDUOxC1Aefz4JEPuetAE+GaZHannx6Z5UxStrwUtMHf+ihfVKvo0hNx 3uyBtQ99HFQqVF9bAaxHkGE1qQ5KLUj658Y8f6JneKOmKL0T1+nAXLAbio+lWO6WLazK PslwwU5765ByvFKetmb/XbvXrVP1HMWw31hDTPTninYoocTLoZ0uUPZtWKMvj5QYYHKR TjAqbQldZmUueitWSHdSyY0hpJIzro3CdBv8aNBTHA19ChoQsoHUKXCsJCH/CXmD2KZk 9GGg== 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 g7si12053537pfm.106.2018.05.02.09.20.53; Wed, 02 May 2018 09:21:08 -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 S1751894AbeEBQTM (ORCPT + 99 others); Wed, 2 May 2018 12:19:12 -0400 Received: from verein.lst.de ([213.95.11.211]:39917 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbeEBQTL (ORCPT ); Wed, 2 May 2018 12:19:11 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 3754268D3F; Wed, 2 May 2018 18:21:46 +0200 (CEST) Date: Wed, 2 May 2018 18:21:46 +0200 From: Christoph Hellwig To: Michel =?iso-8859-1?Q?D=E4nzer?= Cc: Christoph Hellwig , Daniel Vetter , Konrad Rzeszutek Wilk , Linux Kernel Mailing List , dri-devel , Christian =?iso-8859-1?Q?K=F6nig?= , iommu@lists.linux-foundation.org Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test Message-ID: <20180502162145.GA26787@lst.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1066dfa2-2f78-815d-c65a-9d09eb35458c@daenzer.net> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?