From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF887C43381 for ; Tue, 19 Mar 2019 14:53:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EE49217F4 for ; Tue, 19 Mar 2019 14:53:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qclEJgUu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EE49217F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e6fH0SfPATO4oh5X5w5JmEGOHVsxhABwlD59FboN9Z4=; b=qclEJgUuWD1eOU PqzjWnAadr8f9yNLqK8Y0gbnkWDHx8N6omq+4pp7aHIxBLsF0NgMNldIklzZ1KDhGvTcIaD1ahLnz AEvkptjozp5clC4WL8YD5YWUIP2xOCvJgsp9r5/vNOh3pxX/VF/H5T5z90L8NtcVbrpBefdUswYcr FVfQMgiVMnI/4F9Haj7FL5xhE1vM6Kkn/eTUSJLYSOEUXT9XbgmtDSgqj0ue3gMFRfR8mp9pSHd2f huDlAWO92I6dHjjt1cE1FgzS+jmqjg7RVqwcn6xgEhUfofv+dXfeEx3/A+VLyhJ3OvFrtEhynWr1C QkNuSqCquXC7k1svMWpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6G7G-0007BZ-HH; Tue, 19 Mar 2019 14:53:22 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6FxK-0000n7-UO for linux-arm-kernel@lists.infradead.org; Tue, 19 Mar 2019 14:43:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6E1ED1650; Tue, 19 Mar 2019 07:43:06 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E41C03F71A; Tue, 19 Mar 2019 07:43:03 -0700 (PDT) Date: Tue, 19 Mar 2019 14:43:01 +0000 From: Catalin Marinas To: Nicolin Chen Subject: Re: [PATCH v2 RFC/RFT] dma-contiguous: Get normal pages for single-page allocations Message-ID: <20190319144301.GG59586@arrakis.emea.arm.com> References: <20190305183202.16216-1-nicoleotsuka@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190305183202.16216-1-nicoleotsuka@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_074307_375895_F7FFA1CA X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chris@zankel.net, linux-xtensa@linux-xtensa.org, dwmw2@infradead.org, joro@8bytes.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jonathanh@nvidia.com, jcmvbkbc@gmail.com, robin.murphy@arm.com, hch@lst.de, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 05, 2019 at 10:32:02AM -0800, Nicolin Chen wrote: > The addresses within a single page are always contiguous, so it's > not so necessary to always allocate one single page from CMA area. > Since the CMA area has a limited predefined size of space, it may > run out of space in heavy use cases, where there might be quite a > lot CMA pages being allocated for single pages. > > However, there is also a concern that a device might care where a > page comes from -- it might expect the page from CMA area and act > differently if the page doesn't. > > This patch tries to get normal pages for single-page allocations > unless the device has its own CMA area. This would save resources > from the CMA area for more CMA allocations. And it'd also reduce > CMA fragmentations resulted from trivial allocations. This is not sufficient. Some architectures/platforms declare limits on the CMA range so that DMA is possible with all expected devices. For example, on arm64 we keep the CMA in the lower 4GB of the address range, though with this patch you only covered the iommu ops allocation. Do you have any numbers to back this up? You don't seem to address dma_direct_alloc() either but, as I said above, it's not trivial since some platforms expect certain physical range for DMA allocations. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel