Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp807218imm; Tue, 15 May 2018 09:26:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrFcmTxc6rTWXGBgC29eIUWP0BKdeCVxh0HnabthXGJdPTns49mZ/uOjQwoF49nI+usjfeL X-Received: by 2002:a63:90c4:: with SMTP id a187-v6mr12683621pge.189.1526401580038; Tue, 15 May 2018 09:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526401579; cv=none; d=google.com; s=arc-20160816; b=uASuB7je96Rp1w2auP9c0l7rCQ0O35yGrbOaagjS35cTWbGioo5goyiMkY4TJT4Q5F DAe7GcHsu/eAUs78A7h24OgKsnTOsunOt5qxCDWlzomHY024Mm6cOVrhQu7mxQ6oWmG9 I2AdY7NPUsivusVrx5V+mwkD+S0/x1elC/NtE3zgDySC/+Ah2e+Ws8cZw9vNCJTdv/N7 +ZJUTWcH9qI9Euo6LN4m3tmWNDCU/IqplcIY4L9uCF8ZmDMky2lWl/ybHwjkh7FWJn6y aAqEu8Z4WURfOJ1aF+Cgfit09YzCBfyu7IcY6UwvkDsSDziAaJSbTgYusnI6UZ6uHtl0 nb4A== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3gGAJNb81hXeqtNi7dMYE5lFVPUYrOp553GUp0/686Y=; b=qQOK+zck26MTmLsQKEZbdPyfX16zOU6CPxU1cSU01zHOeXMS3d+1SfehEbUKWHlbgT k+h3oaEYVaqNY692jWPp+coxdIJ+z8fzAy1tcChuTijSgAOkA5VjfmkO/iuJ4xxUklds 7MDd9Azxmb3y34WZohntBRQ2iEsLYZD0L5p7PGQ+1PR5/NTXBZr6MYvu7ovf4qEhDSPN sPGz7AuL7bk4XsUF/106wvSYG8yj6IP47JRi13iKWiMCvs9pQ/aD3LLM4uio10sOzqVl 4k1tpv9HQk1F+XVuuGhpMq0sIriCPoxj/K49Q71AegFGIHmpsYq24bka4KUMKDDh9aIy aG/w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76-v6si261642pgh.576.2018.05.15.09.26.05; Tue, 15 May 2018 09:26:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293AbeEOQY1 (ORCPT + 99 others); Tue, 15 May 2018 12:24:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:36488 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbeEOQYY (ORCPT ); Tue, 15 May 2018 12:24:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3CE14ACDC; Tue, 15 May 2018 16:24:23 +0000 (UTC) Date: Tue, 15 May 2018 16:24:23 +0000 From: "Luis R. Rodriguez" To: Mauro Carvalho Chehab Cc: Fabien DESSENNE , Laurent Pinchart , Jean Christophe TROTIN , Yasunari Takiguchi , Sakari Ailus , "Luis R. Rodriguez" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" Subject: Re: Are media drivers abusing of GFP_DMA? - was: Re: [LSF/MM TOPIC NOTES] x86 ZONE_DMA love Message-ID: <20180515162422.GG27853@wotan.suse.de> References: <20180426215406.GB27853@wotan.suse.de> <20180505130815.53a26955@vento.lan> <3561479.qPIcrWnXEC@avalon> <20180507121916.4eb7f5b2@vento.lan> <547252fc-dc74-93c6-fc77-be1bfb558787@st.com> <20180514073503.3da05fc6@vento.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180514073503.3da05fc6@vento.lan> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 07:35:03AM -0300, Mauro Carvalho Chehab wrote: > Hi Fabien, > > Em Mon, 14 May 2018 08:00:37 +0000 > Fabien DESSENNE escreveu: > > > On 07/05/18 17:19, Mauro Carvalho Chehab wrote: > > > Em Mon, 07 May 2018 16:26:08 +0300 > > > Laurent Pinchart escreveu: > > > > > >> Hi Mauro, > > >> > > >> On Saturday, 5 May 2018 19:08:15 EEST Mauro Carvalho Chehab wrote: > > >>> There was a recent discussion about the use/abuse of GFP_DMA flag when > > >>> allocating memories at LSF/MM 2018 (see Luis notes enclosed). > > >>> > > >>> The idea seems to be to remove it, using CMA instead. Before doing that, > > >>> better to check if what we have on media is are valid use cases for it, or > > >>> if it is there just due to some misunderstanding (or because it was > > >>> copied from some other code). > > >>> > > >>> Hans de Goede sent us today a patch stopping abuse at gspca, and I'm > > >>> also posting today two other patches meant to stop abuse of it on USB > > >>> drivers. Still, there are 4 platform drivers using it: > > >>> > > >>> $ git grep -l -E "GFP_DMA\\b" drivers/media/ > > >>> drivers/media/platform/omap3isp/ispstat.c > > >>> drivers/media/platform/sti/bdisp/bdisp-hw.c > > >>> drivers/media/platform/sti/hva/hva-mem.c > > > > Hi Mauro, > > > > The two STI drivers (bdisp-hw.c and hva-mem.c) are only expected to run > > on ARM platforms, not on x86. > > Since this thread deals with x86 & DMA trouble, I am not sure that we > > actually have a problem for the sti drivers. > > > > There are some other sti drivers that make use of this GFP_DMA flag > > (drivers/gpu/drm/sti/sti_*.c) and it does not seem to be a problem. > > > > Nevertheless I can see that the media sti drivers depend on COMPILE_TEST > > (which is not the case for the DRM ones). > > Would it be an acceptable solution to remove the COMPILE_TEST dependency? > > This has nothing to do with either x86 Actually it does. > or COMPILE_TEST. The thing is > that there's a plan for removing GFP_DMA from the Kernel[1], That would not be possible given architectures use GFP_DMA for other things and there are plenty of legacy x86 drivers which still need to be around. So the focus from mm folks shifted to letting x86 folks map GFP_DMA onto the CMA pool. Long term, this is nothing that driver developers need to care for, but just knowing internally behind the scenes there is some cleaning up being done in terms of architecture. > as it was > originally meant to be used only by old PCs, where the DMA controllers > used only on the bottom 16 MB memory address (24 bits). This is actually the part that is x86 specific. Each other architecture may use it for some other definition and it seems some architectures use GFP_DMA all over the place. So the topic really should be about x86. > IMHO, it is > very unlikely that any ARM SoC have such limitation. Right, how the flag is used on other architectures varies, so in fact the focus for cleaning up for now should be an x86 effort. Whether or not other architectures do something silly with GFP_DMA is beyond the scope of what was discussed. Luis