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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,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 9BF0EC2D0F8 for ; Wed, 13 May 2020 06:14:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16904206D3 for ; Wed, 13 May 2020 06:14:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=dell.com header.i=@dell.com header.b="ZttbHU61"; dkim=pass (1024-bit key) header.d=Dell.onmicrosoft.com header.i=@Dell.onmicrosoft.com header.b="YGOvvJMH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16904206D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=Dell.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 85E57900104; Wed, 13 May 2020 02:14:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80F1D9000F3; Wed, 13 May 2020 02:14:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B09B900104; Wed, 13 May 2020 02:14:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id 4F7A69000F3 for ; Wed, 13 May 2020 02:14:00 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0AF1E181AEF00 for ; Wed, 13 May 2020 06:14:00 +0000 (UTC) X-FDA: 76810680240.29.nest39_3fe661269cc31 X-HE-Tag: nest39_3fe661269cc31 X-Filterd-Recvd-Size: 15018 Received: from mx0a-00154904.pphosted.com (mx0a-00154904.pphosted.com [148.163.133.20]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 06:13:58 +0000 (UTC) Received: from pps.filterd (m0170389.ppops.net [127.0.0.1]) by mx0a-00154904.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04D67AaJ029958; Wed, 13 May 2020 02:13:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=smtpout1; bh=BcE6poO6ypK2NJZmAghTzcsZz3VPYC3bpWo4rtR2SYk=; b=ZttbHU61rzFXDeI4l+ECtjHKcgq3ucbZkp7A6HrY3aR+gPuWy60m1lccRiiTuWrF1ZVg jnnd94AbUPjVv6t4n5/C4J4QSUWo3312TRXrir6FGQXMo9mWbhq9I/MejMAOuI5U1/Jm 909fRGbKExSJkFPiVdisnU7+xsytjqecy3e/BkeRKNT9VenIAke8HTVgBr8e1pt3c5kz czNiD/r2iAJ591A9fvJLOpdk+2IZ2LP51/lwVyD2ti18Mi4tzbq3UtKSWhMZzVKqo/WV nE0rFC23H5b+FusiF4h62+lSMfUsSxmTFVMC6oGqd0a3cD0y7xgu5nXAtKwoxvZxLYre Hg== Received: from mx0b-00154901.pphosted.com (mx0b-00154901.pphosted.com [67.231.157.37]) by mx0a-00154904.pphosted.com with ESMTP id 3100y0hd1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 May 2020 02:13:57 -0400 Received: from pps.filterd (m0134318.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04D6CYDJ157739; Wed, 13 May 2020 02:13:56 -0400 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by mx0a-00154901.pphosted.com with ESMTP id 310be1r099-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 May 2020 02:13:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgpaUApA88ojwydi2PQYIl3n2oNZupz9J8HTCx0zFkS4zwJLF+VIBZQ5OWV7X/2s1Vowud+265vi39XGC8IpZr771aU6hyvWYOWo+7mT76CsXB5O87g+LyVZlslqUiJs3auvtDjLCNywHxc3uIrJor9t5pCqOhD/YI+o9wzYqPvZ5GZACKzAMymSQzOehbvZBj0lZoucDGwCtshNISAf86MFJA7BvS42nF9vtbyPmSwFGQKWIphN43LaXaFeiS7KvVCBQHxg01ws+e5EZzBQhG8Ksiuwj9T8pUN7Hsv3uaSCwlkYGLApH83BPOZKVZwEbo/O0N9oeWfvWdMlzs2kJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BcE6poO6ypK2NJZmAghTzcsZz3VPYC3bpWo4rtR2SYk=; b=FMnU4Fctjp9+IJEP/ZdVD62F431J+wVVU0wzoBIxV0EMMx2wJ9Ijfvi+IoPIOXoCJGJHuO6+/apRfe4XtmlTsuK7kSj5IJ6nSPwulestQtVwGBlghpAb9epBXn0lU3ryK/Y+Jxt9t+0zECVfX48SFHAkK5el1QNfaLZCDI2x7FA81srGPCmU0Ly5ddsmQ+KLuMNknch1so0YevNVc1py0WvVs3X5YNO+rUkuinAX6e0UNYT6ugg+QDFdkarTVw51hbojZfRnchzQoizoiUxSG7KcYUY1CRbmU9tADZWU7Q9qkKiiacZTZ0LKeT7CJyKEgSKFFu6aCus51HtgjmiRew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=dell.com; dmarc=pass action=none header.from=dell.com; dkim=pass header.d=dell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Dell.onmicrosoft.com; s=selector1-Dell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BcE6poO6ypK2NJZmAghTzcsZz3VPYC3bpWo4rtR2SYk=; b=YGOvvJMH+S9hXCMGrLLB/QVDua3RUHR5UGWE8eyNNKZX5/mGIt/WlvszjTutfgZQsWeGXBs6PLlW97s+LkSj32Nx7dPKqyd0G96NrbQ13tEgueMbXdVOKg3sMK87OT0U2aIhctw4e2ZoyXOfWaqT8m7AJ0NkCoyTzfjl4yZm6tk= Received: from CH2PR19MB3767.namprd19.prod.outlook.com (2603:10b6:610:91::13) by CH2PR19MB3783.namprd19.prod.outlook.com (2603:10b6:610:9e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Wed, 13 May 2020 06:13:55 +0000 Received: from CH2PR19MB3767.namprd19.prod.outlook.com ([fe80::6463:3b9e:20fa:3c37]) by CH2PR19MB3767.namprd19.prod.outlook.com ([fe80::6463:3b9e:20fa:3c37%8]) with mapi id 15.20.2979.033; Wed, 13 May 2020 06:13:55 +0000 From: "Idgar, Or" To: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "gregkh@linuxfoundation.org" CC: "Ravich, Leonid" Subject: CMA enhancement - non-default areas in x86 Thread-Topic: CMA enhancement - non-default areas in x86 Thread-Index: AdYoj3CyDXSuH7upSp+PFUP6/DQ3Lw== Date: Wed, 13 May 2020 06:13:55 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Or.Idgar@emc.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2020-05-13T06:13:52.4443025Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_ActionId=5d09f88c-25b3-43ab-b3fa-e9e460f16691; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=Dell.com; x-originating-ip: [152.62.109.201] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4305bd81-9648-40f6-04d5-08d7f704d0e9 x-ms-traffictypediagnostic: CH2PR19MB3783: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-exotenant: 2khUwGVqB6N9v58KS13ncyUmMJd8q4 x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0402872DA1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yMoo2Af7aTJM0y+7kgVqfWYlIOy6DsjMmB/RieIkh0PkFIIBq8Hk84qaeDYZqSKObmCYpIskz3m6gvhi1pffwOlLJlCrgn1TqoLLT1XPDYM7qyhMN7GQS/takJDItSeiL0lbf5Mbtq731LP4iILvz5vEiV0pcA1ZStjsuloOcXi0FhpVd67kGVT07ItFFutxDKHfe5mI+kXL3nJk5XtQTkKrGASVKQ84fCJDoS92IAEHoxcb0FnAjDKsWDUv4wXaqge/HdN4OPgOeSQToIKTwndj6dxsEdI/URoftQYoYqF8ZkTfZJzzE/C5DZ7brans+DXTTYDF4Don5QxkzUVnCp9KSYxzzLY/y3909Bh3HB6foh4d777JjjLfuD40LAON+aeDRUTzBu49jMHmoasxlVWAWOCmFEqPaJGdot8c1Uy1iCgfeteCQ8h64/+TiESgz/TMqBEN/vYZim7hfBU9ZfjFzo4tnQnnZ7zvM3qmKR6JK9QN3ND0g8bJpI5fBn1EdUR8XkUCbSX7DIeEU3eQJw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR19MB3767.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(33430700001)(66446008)(33440700001)(33656002)(76116006)(8676002)(8936002)(4326008)(66476007)(110136005)(26005)(5660300002)(66946007)(107886003)(9686003)(64756008)(71200400001)(186003)(55016002)(66556008)(6506007)(9326002)(2906002)(52536014)(86362001)(498600001)(7696005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: NWN+SbRQp5Lr47gmSH8GjU9I2e5EIuu9JEyEfGPHMkbRia/09IRh6EcSP+CLyMhRiy3f/w3ulMhk+oyfGfuIe6wWbYHQiXYyZ+qufUwbUa7fADaUDK8EATSSBy1t0V+XHPGz7wcZUXG4xp7kzRegKYTQVh2a5BfbVKeeI5PZK9YZAinwIgjXcuWaq9VoVvqPzXelJs+f3y9fRWV8Qnj3qiJbPlx70pSur0gxXS283aXH4iIkvBh2vt/nTV3CRBXd9iqxTr1EsmE+6GAFbx4lMumK/Wdloh2Le0AmqfFp3fRb8gJ9Td1tvCBkijv0cMhjOiDB6tVXnLNA92I1I9n6Gpc/8ZqmcAFx+blqq+iPpgaxc7oA3QsHPLr9uZik7DUdqyNO/P+6xQ4iWzG1/s2T2b89ZLvs13wXYeg1CQsQ8C4GsG8uS8+mfnKlMWK1ypS0njRKGSLdTbZCiZf1F+C06O48JQTq/beHmP1NP5P9l1ci1sYmrRVAP3B30wZsEblz Content-Type: multipart/alternative; boundary="_000_CH2PR19MB3767236EDC9BE964FC3AB91BFEBF0CH2PR19MB3767namp_" MIME-Version: 1.0 X-OriginatorOrg: Dell.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4305bd81-9648-40f6-04d5-08d7f704d0e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2020 06:13:55.2608 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 945c199a-83a2-4e80-9f8c-5a91be5752dd X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rUoW6thboXa3AO1m2HlOWfoD2ZmWeSt2x9vmCZrMMFm6hbYLXpVyXKCeqLQwrZWIeoe8VnUQd6Da/LMvsyyOSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR19MB3783 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-13_01:2020-05-11,2020-05-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=870 lowpriorityscore=0 phishscore=0 suspectscore=0 bulkscore=0 cotscore=-2147483648 impostorscore=0 clxscore=1011 priorityscore=1501 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005130056 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 cotscore=-2147483648 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=955 lowpriorityscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005130056 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: --_000_CH2PR19MB3767236EDC9BE964FC3AB91BFEBF0CH2PR19MB3767namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I'm working with Linux kernel on x86 and needed a way to allocate a very la= rge contiguous memory (around 20GB) for DMA operations. 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 use= d 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_RESERV= ED_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 o= r at least cannot be configured with OF_RESERVED_MEM). I really want to leverage this mechanism/API and thought about modifying th= e 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? I'll be glad to get some inputs and suggestions from you. Thanks in advance, Or Idgar --_000_CH2PR19MB3767236EDC9BE964FC3AB91BFEBF0CH2PR19MB3767namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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.

I've found out that CMA is one of the major ways to do so, but our p= roblem is that CMA's default behavior is to create one default area from wh= ich all devices can allocate memory.
when booting, there were some drivers that allocated memory for DMA and use= d 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 x8= 6 (and as far as I understand relies on device tree which is not in use with x86 or at least cannot be configur= ed with OF_RESERVED_MEM).

 

I really want to leverage this mechanism/API and thought about modif= ying the code (and hopefully merge it upstream) so multiple non-default are= as 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?

I'll be glad to get some inputs and suggestions from you.=

Thanks in advance,

Or Idgar

--_000_CH2PR19MB3767236EDC9BE964FC3AB91BFEBF0CH2PR19MB3767namp_--