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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 02A8AC2D0F8 for ; Wed, 13 May 2020 06:48:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 889A120718 for ; Wed, 13 May 2020 06:48:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PuQBkAr5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 889A120718 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 16769900106; Wed, 13 May 2020 02:48:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F2BB9000F3; Wed, 13 May 2020 02:48:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFAD5900106; Wed, 13 May 2020 02:48:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id D47CF9000F3 for ; Wed, 13 May 2020 02:48:00 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 99A5745BC for ; Wed, 13 May 2020 06:48:00 +0000 (UTC) X-FDA: 76810765920.28.water34_45e390d74030a X-HE-Tag: water34_45e390d74030a X-Filterd-Recvd-Size: 2920 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 06:48:00 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD45120708; Wed, 13 May 2020 06:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589352479; bh=kZUHIl/hslAIUun/scKZGchu54jJoiD5bFZ7D+UaEso=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PuQBkAr5QzzkidCv+HHPPcfF5KJPuORNomc6bYgImz/D7lVfJAhdo6oPqs4sNv/WQ usqM4uvdRCJ4UAFK/wATmvjc6E1QcTtnzD9goysPqVRGzP6fPViTp+icxrXVSavUY+ A2XVYzt2HZ+U1oyHlm8IFeKhhiiJtkb9vZRFPPj4= Date: Wed, 13 May 2020 08:47:55 +0200 From: "gregkh@linuxfoundation.org" To: "Idgar, Or" Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Ravich, Leonid" Subject: Re: CMA enhancement - non-default areas in x86 Message-ID: <20200513064755.GA763968@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 13, 2020 at 06:13:55AM +0000, Idgar, Or wrote: > Hi, > I'm working with Linux kernel on x86 and needed a way to allocate a very large contiguous memory (around 20GB) for DMA operations. For what type of device? > I've found out that CMA is one of the major ways to do so, but our problem is that CMA's default behavior is to create one default area from which all devices can allocate memory. > when booting, there were some drivers that allocated memory for DMA and used CMA memory if exist. The problem is that it takes memory that we need for our device and we want to make sure this area is dedicated for our device. > > As I saw, the only way to reserve a dedicated area is by enabling OF_RESERVED_MEM which is available for several architectures but excluding x86 (and as far as I understand relies on device tree which is not in use with x86 or at least cannot be configured with OF_RESERVED_MEM). > > I really want to leverage this mechanism/API and thought about modifying the code (and hopefully merge it upstream) so multiple non-default areas will be available for x86 and with a way to consume it by mapping specific area to specific device. > > Is it something that will be open for merging if written properly? We always will be glad to review patches, no need to ask us about that. Just post them! good luck, greg k-h