Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp104146ybb; Tue, 24 Mar 2020 17:36:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vupjalNkxRXzJZU/rkBJvt45L1SIDK4iOewPL88lOZjCSsNgcvyAggZWb+myzzAf8bumSrF X-Received: by 2002:a9d:5e9:: with SMTP id 96mr571631otd.307.1585096565715; Tue, 24 Mar 2020 17:36:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1585096565; cv=pass; d=google.com; s=arc-20160816; b=x+BZr6JCi2s5B2erAXMKCMFNlHqZm+h+K7hcS8If+Xrjf2/uqrd5n/ZNVAFaVl5Wn7 yMsYmFq/Gk7GtkxCABpuJu9TZa6LLEAAdFH7zf/YDmwyT82L3LUUz9X5fjBrcFaDzLzz V99sVKXkTcAEEzOR2vF45g/IieN7AYIfDcYsy2ymlO00uryZCe9RA3di515O6r0N8iuo 4o9sW9tBqr1rsChlNd7Zbiro9MOLxnFTPvLHKPIj18YzyxlSlHFLoVq51NPO9CJL6mFS 9auofD9/aW5Hl+0q7mQQzS/Zdg16jHRwfBW2ApAymyLTMhvLHIdjRJto06TDfwY3eYqc 9PqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=XJ80jsi8n7OF1+QIDKfFGPXM5vE/RyJtvCyzBEXV5Hw=; b=NiuW3iZxikYGnaikNnmh6vAbHSJACKANbTk8/CAmKW+DV66cpw67XN2Q/keod0OjE/ fG0hq+1iXLM0rWDfsV/Y4Ned9ApQ1Y8QpxPy+0AP1VxAmE6njHqcWPqbnLbWiyMJgAhy Ca/Wr2SjwcB+9+Na662rJhYCI0itl5oDEWdx71fPoB6GpnJjFr44XMSTCr1Ecs6hjpIN xzb3nCP0EJMhgtsObzZitUfn+SN4eV+V6bnH5W6medPGGzbi5rKf/i70Fk+G28SN0pdr B59siaaBGkePpHb3J7z3hk3bRiEdOGA5WrXN4K5w38NT57nU0Jg/N/qpqt9yz0Gj1ETZ qhIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BNmHE66I; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si588295oim.179.2020.03.24.17.35.53; Tue, 24 Mar 2020 17:36:05 -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; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BNmHE66I; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbgCYAeX (ORCPT + 99 others); Tue, 24 Mar 2020 20:34:23 -0400 Received: from mail-db8eur05on2068.outbound.protection.outlook.com ([40.107.20.68]:6085 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727103AbgCYAeW (ORCPT ); Tue, 24 Mar 2020 20:34:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+2Zbw7sLYd6E1doZpiEYoXz4HUyKxYaUaZ6/pFD8cOPKEWum6+oyh69X8Dd7SC56mvHbTVCo7o/V8uDi09sYL4/LjCVH2TVXYaJJ19fXzfn4ImlfAcIWXpDTGvzrTOOIprImGYwWxtTTdLJ1BdIIcSqpdTiqNlKYWdgCwfixRbjZhzr7kyUgxMKIxhzRqWjgIp8sBo6i7uo1Eb3XDKZQNEyGLXfogXYa256J8z1XfdT0Mn1zSkpTdC+B1VSMjBGXYkonV298o1NXGdWFIqoEtrAM9GrAOifxsJu3gqNFh/gypr0yrK/5FAaK/6QFQWcRCIkB2f08rF2rI0xZ2UJMg== 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=XJ80jsi8n7OF1+QIDKfFGPXM5vE/RyJtvCyzBEXV5Hw=; b=cw/fo8+inNn9DXbB3xSBadKqcsGHxbtYfKAdr4eAMXEb5huIp6PpPiZNN1Rf+B/r8RrDrjs2blDqbu1hUXoGH2UtbjOZbgaDh611iE6sioSopyvZaHakVUilkjBY5jdasER+LJvI25WwTMp/DHSvF12XpW5813arXRUBp4AzakYDmA7tPwmljgSZWrK8cgHpu1hTGXsYq9ZjL3DQtoBFylMDlTiv8Xa1HHxHkcjS+kwgRZLRSTpyx1riGj2disG4qjOlCtOTlkVLd1LUOfe/axp0LET+UPZ6KF+Qi+vxIkgrTXl5IdVrt0u4LDM0K7LiRPkECYW88rmtJpVVnnWloA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XJ80jsi8n7OF1+QIDKfFGPXM5vE/RyJtvCyzBEXV5Hw=; b=BNmHE66IybWkku2zl80HX4PrffuVdnjsHsWlQ+GxK4J0eXSXzJ4N86j3GKL433m0kmTQWFWD/lbVh0KjW30I7Z3KFooQOXsXr8JNGfXLRNo5fSXP5DQU/yvKssy9YuMMK0iqDgXM3dmNEDKdX2hSnbQi/wjQEHQiS3KxAb97API= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB4946.eurprd04.prod.outlook.com (20.176.214.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Wed, 25 Mar 2020 00:34:15 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::ad44:6b0d:205d:f8fc]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::ad44:6b0d:205d:f8fc%7]) with mapi id 15.20.2835.021; Wed, 25 Mar 2020 00:34:15 +0000 From: Peng Fan To: Catalin Marinas CC: "will@kernel.org" , "nsaenzjulienne@suse.de" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Robin Murphy Subject: RE: [PATCH] arm64: mm: make CONFIG_ZONE_DMA configurable without EXPERT Thread-Topic: [PATCH] arm64: mm: make CONFIG_ZONE_DMA configurable without EXPERT Thread-Index: AQHV9tsrS4nkBuxsuEaY66LPIEgB5ahYGTaAgABvteA= Date: Wed, 25 Mar 2020 00:34:15 +0000 Message-ID: References: <1583844526-24229-1-git-send-email-peng.fan@nxp.com> <20200324174134.GH3901@mbp> In-Reply-To: <20200324174134.GH3901@mbp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-originating-ip: [121.239.103.67] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: cc6d26de-6cdc-44f4-f05b-08d7d0543f6d x-ms-traffictypediagnostic: AM0PR04MB4946:|AM0PR04MB4946: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0353563E2B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(136003)(396003)(366004)(346002)(39860400002)(376002)(54906003)(2906002)(5660300002)(9686003)(478600001)(4326008)(44832011)(316002)(6506007)(8936002)(8676002)(66476007)(81156014)(81166006)(52536014)(7696005)(55016002)(6916009)(66446008)(71200400001)(66556008)(33656002)(186003)(64756008)(76116006)(86362001)(66946007)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4946;H:AM0PR04MB4481.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: szWmHy5CjW4yBwxaax9z7CbUnqtio6TBc5YIOEcpmyFxlgBSxScwjbL+kLl8SMwqWFCVjAOpGiuV8GsrBDSVxm5NWlj9cx4FfdnoyBNNz9meQXirgCZ/3c8E4Ly5gXrAquwS904/PD3/+9Sa+91KVDp6Dfce0TVVu6xbliw4HSGErySUnLJcGNUVbe3BZ89Na0ReY41ywYaifqqro2mNCGCXXC84HufSCS5RyjoK0GeCPtLv66vJqf3ED+j2u6kw9z1HlvCee9jHjlmU+N70NwOSPVuHUdDW2A4hhBskovpM4l1dk+g5hcZQ4BCgFsOfncqlqK9skQp5TBdKt2RkBMvsHBfmP97ZijExhl7a+ftdOWLyjNKb7PM8sdkCH3nooHRWDeP6JKQ3ARc2MPxNM+jU4iarW1SzyLcyVuRFlpuLB6iizRWOUfIgmbdIKjOd x-ms-exchange-antispam-messagedata: gkjvvvWUjxdc0A+50rQKrWUUQiJo5rUHu6gFmzkuJfTAcdW8UUo9+TsKFuTwR8Gx7HltE/Dc9YILYEtAUvjGTmstaGe+S8J4f6yRQPVex+qprdQAOMXTPE3mjzIfNbRYLoU/C9RLRobj51FoB6YzMg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc6d26de-6cdc-44f4-f05b-08d7d0543f6d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 00:34:15.4965 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OS/PTADACCFgM2pbvffn76kSnc5Kmfj+3XdtQl18b2lV+Dv1EhvKWO+Go6ChyBHH2ePCN6Xo79xp+7wgGNpStA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4946 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Subject: Re: [PATCH] arm64: mm: make CONFIG_ZONE_DMA configurable > without EXPERT >=20 > On Tue, Mar 10, 2020 at 08:48:46PM +0800, peng.fan@nxp.com wrote: > > From: Peng Fan > > > > commit 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32") > > enables both ZONE_DMA and ZONE_DMA32. The lower 1GB memory will > be > > occupied by ZONE_DMA, this will cause CMA allocation fail on some > > platforms, because CMA area could not across different type of memory > > zones. > > > > Make CONFIG_ZONE_DMA configurable without EXPERT option could let > > people build non debug kernel image with CONFIG_ZONE_DMA disabled. >=20 > While I see why you need to toggle this feature, I'd rather try to figure= out > whether there is a better solution that does not break the single kernel = image > aim (i.e. the same config works for all supported SoCs). >=20 > When we decided to go ahead with a static 1GB ZONE_DMA for Raspberry Pi > 4, we thought that other platforms would be fine, ZONE_DMA32 allocations > fall back to ZONE_DMA. We missed the large CMA case. >=20 > I see a few potential options: >=20 > a) Ensure the CMA is contained within a single zone.=20 This will break legacy dts with new version kernel. How large is it in > your case?=20 It is 1GB Is it allocated by the kernel dynamically or a fixed start > set by the boot loader? We use alloc-ranges and size in kernel dts. But there is only 2GB DRAM in the board. >=20 > b) Change the CMA allocator to allow spanning multiple zones (last time > I looked it wasn't trivial since it relied on some per-zone lock). >=20 > c) Make ZONE_DMA dynamic on arm64 and only enable it if RPi4. Option c seems a bit easier to me :) I will try to explore both, but if you have time to help, that would be appreciated. Thanks, Peng. >=20 > -- > Catalin