Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp69654pxa; Mon, 3 Aug 2020 23:09:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycSHZaROV2vds9Kr8fZmM5K8L+8gAgKRJ+ENeU13lIeMoQ3g06StdhaJEpHHHIRmCqlMra X-Received: by 2002:a17:906:7153:: with SMTP id z19mr19383785ejj.319.1596521388248; Mon, 03 Aug 2020 23:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596521388; cv=none; d=google.com; s=arc-20160816; b=XuSA28NxQlLa9CsfoVBFriy1/FxZ1coHFcGYdYd4Gqh4y6JkkQMJZ+AISY/ZC34zrV rNkNxmpXDqpEkFgN+Q8e6bZveEJe9opFsg/VHANWWWDjtH5SYMBEM1eiuVf3GhSmeRX5 kIRUFFn8Bm+Ur/n7+7/s+gy518BnM0ULiSIzpAIBncAocKGpzeRbsGbNOGJsWbCQwtLf WfA8WjdYw1k2EoAiUMEHAgzhLnwDHdVX+Wo0Qx0C1lVCWkxmJojv7w3e4+aJwwJztQfG mq+qK+OdqgaexjNms6hhFVTslMelzXTXjVzlfSICbg6nkYUgBtxseolBPigkOD/pdLiu MNZA== 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; bh=MgbCvRZ+px20tjLCQ4srDLMJqI6XZ3ct9pQiY9pNSkU=; b=BL3+OJrNueSPTfSqoxKl+KCoOBmVgMxxfoxX1ui/nDX3D1/6+DGmSyL3AuRzI8wn8U uiZ6kdtA2V8ZG+VsiGiNCeG9hP5XIbtyLr9EAS+BfJMD13uHmSVIGQodb+ztYSaGEnRn dETw7ZUQrRny0+VDltz59AuXUFqcc7Ud4+bgTmHQgAdOqEConFwLZr36mwVeN8hINIJ9 yaXlIzIBkvsJRg332YwWEupPyr75Q+XaWnb3B+TbZSuRidPJRZmJS3eoYq8JY8nrrqHs jQbKb9n//Iw+lzIGI4dPaJZgRWPxCR6PtY6z67IAyRQeuN5dfU2N4oNCE/X4MKqZ2Cep BdgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si11634859edh.20.2020.08.03.23.09.25; Mon, 03 Aug 2020 23:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728602AbgHDGGh (ORCPT + 99 others); Tue, 4 Aug 2020 02:06:37 -0400 Received: from verein.lst.de ([213.95.11.211]:41440 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727862AbgHDGGh (ORCPT ); Tue, 4 Aug 2020 02:06:37 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 852C86736F; Tue, 4 Aug 2020 08:06:33 +0200 (CEST) Date: Tue, 4 Aug 2020 08:06:33 +0200 From: Christoph Hellwig To: Nicolas Saenz Julienne Cc: amit.pundir@linaro.org, hch@lst.de, linux-kernel@vger.kernel.org, Marek Szyprowski , Robin Murphy , rientjes@google.com, jeremy.linton@arm.com, linux-rpi-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone Message-ID: <20200804060633.GA7368@lst.de> References: <20200803160956.19235-1-nsaenzjulienne@suse.de> <20200803160956.19235-3-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200803160956.19235-3-nsaenzjulienne@suse.de> 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 Mon, Aug 03, 2020 at 06:09:56PM +0200, Nicolas Saenz Julienne wrote: > + if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA)) > + return end <= DMA_BIT_MASK(zone_dma_bits); > + if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32)) > + return end <= DMA_BIT_MASK(32); > + if (gfp & GFP_KERNEL) > + return end > DMA_BIT_MASK(32); So the GFP_KERNEL one here looks weird. For one I don't think the if line is needed at all, and it just confuses things. Second I don't see the need (and actually some harm) in preventing GFP_KERNEL allocations from dipping into lower CMA areas - something that we did support before 5.8 with the single pool.