From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E55DA0C4D; Wed, 13 Oct 2021 08:57:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B139410DA; Wed, 13 Oct 2021 08:57:20 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 086C840142 for ; Wed, 13 Oct 2021 08:57:18 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="290855869" X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="290855869" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 23:57:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,369,1624345200"; d="scan'208";a="486809667" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga007.fm.intel.com with ESMTP; 12 Oct 2021 23:57:17 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 23:57:17 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 23:57:17 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 23:57:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7xrlbpkOIYbOPxWrdRZEP6WLhlWX+tqd9HzzYhq9sklEYa1TogiQSvRiQ1gXTWGLQO5NswAMagNpK+ElDUmLYDa3O2uCqIcvMD7wIjKWs0iMoo8NBlK48VIhlZJVoBysVRndanHTe4tV8tDIUHvjtJ+6GKqgS4o0R0KlpYlSjOAf6uuohpeqo3gghYxaowgwsx3J/TOW1E6djU50aMm3AXN4w5KAch0Ahlv9hPa6hXna9VNreCbCTFRvAWtp87NxDTBXDo6pjPAI8zzGG6uXYzwmCyrUMMRn+8G4wdpvy3+cKvUXFtYQ/yBi4lRleJB+/x5BNvB36cbNCDkapPYTg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/SCq5kP6D1CAjSPPN2QmsRHZojhrcb30NodtZw7yTN4=; b=P1y6LJIRn5k/GYxcp07BlsJbVADmLEA8P+rK+NahsTV0FqVpBevF57rZXMMYuj9IsZsWyH48jYGdEOTUQHQ2GntP+UBPugJmx9vca5VG+a0a9ugM+GGxDWmgXbE7qrDad/KkT0kpgMxLJ9HJlyDdC07B84T6o+HYDzZDMv/pzpak94Z4pX3ryPQnlPtjvEBI0xGFFjRMjXg3OoSLWBaWSnNbx+npyK41n1rsM9TNZtH7dJgyqBP9nXEKErvl3fdBI13Mr5Lzn32vOo/Kii6Lai09MZuzwmBIvcBNJg0eFxjLHE7d3IDSB0PE+SZzhjMKaY8SqIIeV+VfW0FRDucAKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/SCq5kP6D1CAjSPPN2QmsRHZojhrcb30NodtZw7yTN4=; b=ej2N2VA7breu0iRmfPPK584xX9UTqW1Ui+OEyhqi0kEOJx3e46/7oXrLgx34OE+dqVE54zi5sMHwZP/mpfRczL6nALOeoQVb+oGXP7WtU+bcIF7jYIwMgWK1ejZCMD0iZNXlHX+JBenHLrMDTS7L28jhGV+MOw8iSjy9J4SEQQg= Received: from DM6PR11MB3771.namprd11.prod.outlook.com (2603:10b6:5:13f::15) by DM6PR11MB4011.namprd11.prod.outlook.com (2603:10b6:5:19d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Wed, 13 Oct 2021 06:57:14 +0000 Received: from DM6PR11MB3771.namprd11.prod.outlook.com ([fe80::ac5b:17ce:f5a5:4ee]) by DM6PR11MB3771.namprd11.prod.outlook.com ([fe80::ac5b:17ce:f5a5:4ee%5]) with mapi id 15.20.4587.026; Wed, 13 Oct 2021 06:57:14 +0000 From: "Yang, YvonneX" To: "Ding, Xuan" , "dev@dpdk.org" , "Burakov, Anatoly" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" CC: "Hu, Jiayu" , "Jiang, Cheng1" , "Richardson, Bruce" , "Pai G, Sunil" , "Wang, Yinan" Thread-Topic: [PATCH v7 1/2] vfio: allow partially unmapping adjacent memory Thread-Index: AQHXvndVRADQfN5Hf0Wbae+O93kKR6vQgfcg Date: Wed, 13 Oct 2021 06:57:14 +0000 Message-ID: References: <20210901053044.109901-1-xuan.ding@intel.com> <20211011075942.38180-1-xuan.ding@intel.com> <20211011075942.38180-2-xuan.ding@intel.com> In-Reply-To: <20211011075942.38180-2-xuan.ding@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d32bdaf4-b0fe-4e99-4e8a-08d98e16b022 x-ms-traffictypediagnostic: DM6PR11MB4011: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aLHqzGs+ciNZVkrC0USceXxKpWzfxZPLb5pGvQkUyzDEDnhMKAvfDL/tpNNEoWCAZq00TnIuJQX7g9f17wG6oceXeJbj9geaA9z9hT7zZOZbuM6LN5tw3sxNj8Y6ooBYGpvpxOCV9+lwyv1P98X4fx/DqyjbfYX+akMxJklIGQqDaio5Y/qvhs9AJiYygC/q6aHVIUdrLQWGDhP0WhMQ1RMPGq8z5XGTOtkiZI88CeJgxkE/DIW6iFyxcagnqeg36ou6JJHgjM8SnEmrogwtjhTOLwCrJeUZg+5cbfbiyquhgTdzgjgAWWPYl305saZEaR7JHrJAunBdz+UkgTne1J9s2WtoiUuso1hEgN12Mju3RLB2j2HKQHYYqBMYRrDNkcFJv4fM21UwQVxYr41L9gZ6HMYqw5x6mVb9uixh5bF1o0JvW3CovC8NFvEXfC+tGoVEA1uSKFVrTMfj+fCmLN6rfSWPcATVJjWJP7ZPn4UcjhfWvWQAYmblPFWYgG8hU+dbmXta5NAAarb42KgHD0QoEvKAB7OUClqCHeOXu09C2j639JzVfTf/qNDETMQtcHrKZyc8ZT9Kbg0/hLUY+4cT+l8SFxTsEATFpB5glT9EHRNTP/C3vi3afWdLXvAiW+8BX6Zb+0iDfsYyo3JJURgeYSY0eqpT9v+YxaZODFcspIMnBTbVGGmYjPgRoHEP x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3771.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(38070700005)(66446008)(64756008)(5660300002)(2906002)(6636002)(38100700002)(52536014)(122000001)(54906003)(110136005)(83380400001)(33656002)(7696005)(26005)(508600001)(107886003)(86362001)(66556008)(8676002)(8936002)(186003)(4326008)(53546011)(55016002)(9686003)(82960400001)(76116006)(71200400001)(6506007)(66476007)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Gagzf3MxTu9hojJs8dk1GT0hzkbFe2PoBP11aamouPs/ZpJVKHs5TAEtYuIE?= =?us-ascii?Q?czeu4nVjvbSJ9VFlRpEd/MQweoo3sQ4stnXZVCKTvwSIjb9vcqJHr9UXOE04?= =?us-ascii?Q?IEDl+6hbF5yJUfGQqRJH3ROEuk7ct/yz/+agxY6ekN+NM5BEfkeMHvlyEqDB?= =?us-ascii?Q?zLFD4izJDy5j59tEKdgLlqU83DdJiB/E3L/E3k7kTQrIMx+dP+52bwzTPbn0?= =?us-ascii?Q?t9zH63/dqY55GRad6iXMXVpdzEn6E2PyrTyiHBLxb9eB8h7IZLNGqpGzdEt/?= =?us-ascii?Q?VKlGVjXeyD31Vjg/j7RhrjM0gezBnyDav+xIo6bae6RjJC6ttzClGwrmg4VW?= =?us-ascii?Q?aoSeSeUY9B853436ITqqss0Wb3n7qESLmPTq9r1vbrZWUNiBZ7A01kre2Y6q?= =?us-ascii?Q?Bbj6pUINOQlCOIL9x+PVHKM5aKEq6suc7kJc7UeAX+XoU/exwv2IY34lwrba?= =?us-ascii?Q?b7Wx9v39z0DN5v/GLU9rnw+MUOTOApRrC02t57NU8ZWykvEfiGJuiknHtRQC?= =?us-ascii?Q?zPYTcyQNfIeQtfqws5q+kwbRcU6pDK3CAAEYiaHv8s6zWrLo8Pmt0fyNprCa?= =?us-ascii?Q?/uVyLBadFMvuk9zhQRUuRQKy53hm84vIn0n94Wzxmix5v6xPii9LJjeg9dpW?= =?us-ascii?Q?sTnCLhYshY9n5153I2fj62oKatn42LIyTHTQRpr5q4FwHf5HwlebI5ZEfly+?= =?us-ascii?Q?yOUC2LXOb8qP4L+iku+6UeLkE6UwfAguR7pH9NDSWE5Fu20NKVTQd6x+T4R0?= =?us-ascii?Q?Pn9RhtzLBtMEkUZgbj1lqphJ5/mPEmGYnmZEM+Qj3eR33f8aYKrLhQFqbY/Z?= =?us-ascii?Q?8fwMG9XXgLRGoZXFcxkYDvFjl5DwNcAgDSZLtsA/oXMYXtrFVyXxIfppi29i?= =?us-ascii?Q?Nnw/UVjBirDQJ07mLLCg2/FRY/an+y8tebEc8lsbhU5i00s83ljE4Xh4eowL?= =?us-ascii?Q?ktQ5m27UHT0P66T3f6Vbu4CPScQEb5uFNK7wDuM7KCjmeKlZl9+HXFKgd6O5?= =?us-ascii?Q?XV48aPr1g17XwRz/fMe5vHlxlxEO0k/FEYMKmt7IafgoR+61hM8hHHA6OsiI?= =?us-ascii?Q?9lB5DvVrYgUcfUNaNa9GrOleiXd4Q82MHeaFP+nhu29mRiWVOHH4AEM3igCv?= =?us-ascii?Q?kNgBouU1QNDjYgTRz1zXSt1ckIxOL3wUMe6AP3w6+8zVf+pIsObNsLLp/4OQ?= =?us-ascii?Q?9E2uJFxfPFpQCoxfLCiWZJ/k5VG1xy/HOA5x3d8IOIJX6SywW9n5uKWy48T+?= =?us-ascii?Q?/1ZWI3lSOTowSfyJFFtF/3SdELawnOpRsYNsr5ehscAGMYL5TZGMSmnKAYgK?= =?us-ascii?Q?lCI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3771.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d32bdaf4-b0fe-4e99-4e8a-08d98e16b022 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Oct 2021 06:57:14.2870 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NMAQCUngUbdDyJyP4ylquuexdSIi8VWTNpcGDjcOtBKdrfzQZlku//HtN++zQcS8JWAzRGVBfcbdAm2Kt94bnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4011 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 1/2] vfio: allow partially unmapping adjacent memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Ding, Xuan > Sent: Monday, October 11, 2021 4:00 PM > To: dev@dpdk.org; Burakov, Anatoly ; > maxime.coquelin@redhat.com; Xia, Chenbo > Cc: Hu, Jiayu ; Jiang, Cheng1 ; > Richardson, Bruce ; Pai G, Sunil > ; Wang, Yinan ; Yang, > YvonneX ; Ding, Xuan > Subject: [PATCH v7 1/2] vfio: allow partially unmapping adjacent memory >=20 > Currently, if we map a memory area A, then map a separate memory area B > that by coincidence happens to be adjacent to A, current implementation w= ill > merge these two segments into one, and if partial unmapping is not > supported, these segments will then be only allowed to be unmapped in one > go. In other words, given segments A and B that are adjacent, it is curre= ntly > not possible to map A, then map B, then unmap A. >=20 > Fix this by adding a notion of "chunk size", which will allow subdividing > segments into equally sized segments whenever we are dealing with an > IOMMU that does not support partial unmapping. With this change, we will > still be able to merge adjacent segments, but only if they are of the sam= e size. > If we keep with our above example, adjacent segments A and B will be > stored as separate segments if they are of different sizes. >=20 > Signed-off-by: Anatoly Burakov > Signed-off-by: Xuan Ding > --- Tested-by: Yvonne Yang