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 4FF72428CE; Tue, 4 Apr 2023 17:18:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20E01410FB; Tue, 4 Apr 2023 17:18:54 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 23D4340A7E for ; Tue, 4 Apr 2023 17:18:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680621533; x=1712157533; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=cA8/cEQDrwUEiU0MZ8wVhu1UhhNzNl2W/mEa0ZQDV9g=; b=S25PEshDtniy7RXSTT2J0V79lBO/ovniWYjC1XGT4J86KXeSg3I4dkmO 1UeoVH+AFm8xHiXs71u9T07c02ffqUJQu/1tt5YPTcQIxY4thY4GTutAl hO/f2b91zZjJq3dIFSFO9wHUCxpbjlGPweCBNVbrWdQVwDC1AhlKycx/b zA2vOxgC9FTQ4CuzXAogfbEFD2inJl52KThP7Yc5VkbrJuc5Lrx0GW+qa xJ7+x3zBlhj7RtPzgvaGCdQIrXce+OSBFBPkJu7T2CLT0TFeMLPi8SrCO SIh+uoXlsw0n0od4yQ88vpf1GNEfqZBLMrqTmn/WPjD/53FDaKBhhPCDy w==; X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="326238235" X-IronPort-AV: E=Sophos;i="5.98,318,1673942400"; d="scan'208";a="326238235" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 08:14:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="932495543" X-IronPort-AV: E=Sophos;i="5.98,318,1673942400"; d="scan'208";a="932495543" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 04 Apr 2023 08:14:07 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 4 Apr 2023 08:14:06 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) 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.2507.21; Tue, 4 Apr 2023 08:14:06 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 4 Apr 2023 08:14:06 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.49) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Tue, 4 Apr 2023 08:14:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TI20jXbwHXwP5sKaqvCzMDM2WC2Y9PKT301Nl3hPd9tCLVJYkmYw7sbNCbSJx+Oa6BL+GqzxwkNZntbsgs5WgQuT0fnmGUPD/9CBpdhZWrd3iIyWTi2sWvY7i/vwEYH+AMeThRerFNKrJNzE/33MAWP0siOAiA5hTT876xX88kr1djMhvrLFKBQpdh8UYtzDIyLAIg+v6eKtdxyJbNRp1zAkqjr10Ya5A+tGYtO7Cg0gyP7lStW7NsUqJgloCoq9pskMXNcML6J2ghJZGnzzWdQX5bBCDYiiQTwlh+FkB0wRN13KPODkNz2iBTasCFMoYYceA9K2Piq8wJFoplk1cQ== 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=FLIaU+aniLK/jaM6vvgQEEJty2n479yRQ+0qU22yCVE=; b=hJS8q27B+aObTF8zoNs34x4VdTLEsVfLCHQKYvxCnhDB3Yyjxr74glzyp8rRmSIR0U8hzVjCw26EcaucwCCYgyY05pfOR9tv6sVVZHgi+UuwaPnY1OqExwOGQl5ZHizS9I2bXUc/ZhUCdZoKon5BgPELalktu0mB9HCmZK6CAnvvfj4kVYLbWW5lri1aT1UrluAFV3Gom+4RpE9yd8WqK4k84KUwh+SauvpXeRRJsLPBqp2ZJa6bV9+MmrOMYsQW5I39ajrbIPX5UCp2skj91/O+KWUqML8c9vduii7d8zEZ8jWlX2fNc3Rs6R2HIevZU081SicTuuz2Avqw1ve1JA== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BN6PR11MB1251.namprd11.prod.outlook.com (2603:10b6:404:48::10) by SA1PR11MB5827.namprd11.prod.outlook.com (2603:10b6:806:236::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Tue, 4 Apr 2023 15:14:02 +0000 Received: from BN6PR11MB1251.namprd11.prod.outlook.com ([fe80::b966:2d41:ca2e:6871]) by BN6PR11MB1251.namprd11.prod.outlook.com ([fe80::b966:2d41:ca2e:6871%6]) with mapi id 15.20.6254.035; Tue, 4 Apr 2023 15:14:01 +0000 Message-ID: <0d356823-b198-ebd1-7a28-b678ae9edaf9@intel.com> Date: Tue, 4 Apr 2023 16:13:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.9.0 Subject: Re: [PATCH v2] vfio: do not coalesce DMA mappings To: "Gupta, Nipun" , David Marchand CC: "dev@dpdk.org" , "thomas@monjalon.net" , "Yigit, Ferruh" , "Agarwal, Nikhil" References: <20221230095853.1323616-1-nipun.gupta@amd.com> <20230104051936.2456411-1-nipun.gupta@amd.com> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0499.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13b::6) To BN6PR11MB1251.namprd11.prod.outlook.com (2603:10b6:404:48::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR11MB1251:EE_|SA1PR11MB5827:EE_ X-MS-Office365-Filtering-Correlation-Id: ba132946-4a5b-4af9-3eca-08db351f3858 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RVbia+TbH9HFowySi9iprWZztfP3JWmblK+6tnxP+TsWS8xeIccoZtgv9VBMirz3nmjUfFK7d0Xv4WBZphL/mxGL+D8ZE1tgMmOsmnJq0XCcmcfkjLmD90/VhLO843PMSlSlv2CB2YtpgRzY54+igUV7ZXeEIMp175mow2KFuIynyVFIMjl/g6UkL+2epdwIk/xhl7cIJv5HoYecOokqqRcEtMTEsK8P2NIn/WcxgUjZRZ9udrVmTsQ44Jbpvnox61mrUtvNQ7BxWILLK7FqPGa2rkRhLoedApcgTW8masfWGb8YglMcaVbL6KzMAhug01GoJUY2Xct6RdqjE5ptXOo3ngAi/RhYwJB6UTDozhza8RU5K4rC6DPwNrD0ZfMvdJUjoU2nu5p5pTsy/HX+YS9IlC+to86bbx2vWhymFpTfO0JYL7Yk/M3TTuG+NG2zmreY5dzmE/c8OvIRQtw8yyOUufV/go5xUa1sjXz68/+UCDFYzjB3oudGThE8TdzTtir4/Up80IaHiRthnutxhB82b6V3hN5IUBt9+KqG7zU3d8H+uUFShNEEN0sOuw3sX65oxP3la1gfNoNjU1dgfkYeaTXSZJVnXaSKIDC5OykX6lc5620VFiL9RvwOddXYFmwFGtOKPbVoXnFb3j1Lfg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB1251.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(136003)(396003)(376002)(39860400002)(346002)(451199021)(2616005)(83380400001)(2906002)(41300700001)(5660300002)(31686004)(53546011)(6512007)(6506007)(26005)(31696002)(38100700002)(66476007)(66556008)(54906003)(316002)(8676002)(66946007)(36756003)(4326008)(6486002)(110136005)(86362001)(6666004)(82960400001)(186003)(8936002)(478600001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d1VpWUQxMVk5QTlRMkgxbGNiQlAzNEZiQ3JzMUhPdlFNazl6MFZJZmJqY1BL?= =?utf-8?B?dWl2ZFhKOGV4bm9kNHQ0RFpqTDlhYW9nZkI4QXpFSGdJcld4ZXIwa2lSb2k0?= =?utf-8?B?NjZmMkdZMzBHQmdTOHpxMUxmbFozZCtYbjBGZytxNHZUeGZTYVhNa1VRa24w?= =?utf-8?B?U1ZVd2VWTjkzRDBOTDc3d1VDY3gwSy85VlhpNUxERWFZQlc0Y09WcjVSYStQ?= =?utf-8?B?T0NYTWtleVVETXlkRUtzamRVcUFRMFZ1VEZGNlMxRXg5Qzd0ckR5VVIrQ2s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Nm44L3piRHNSNGw2Mys4Zi9IU1U2?= =?utf-8?B?SFJlWk9mMFZuWGFuUDRyWWdQdGNZZ1Bkb1B6b0RMMVdYUURPU0dZZENpNVN2?= =?utf-8?B?cEE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: ba132946-4a5b-4af9-3eca-08db351f3858 X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1251.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2023 15:14:01.6350 (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: HdZau3xRhC9OuW6Unf09tjHGkf3AbjckPHGgTV+GYasKLl0Nsw/g01R+Uk3nXXaFE6RwYMUTPPk1vdp/EVHJSUjmK/J1ITDvg34+Y2az+nQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB5827 X-OriginatorOrg: intel.com 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 On 2/7/2023 8:56 AM, Gupta, Nipun wrote: > [AMD Official Use Only - General] > > Hi David, > > I agree that change is not straightforward to review, but it should not cause any functional issue as we are still creating all the memory mappings, but one by one for each segment. > For hot plug case this causes issue as mentioned, that VFIO does not allow unmap of the individual segments in case mapping was created of a single coalesced segment. > > But yes, I am not sure why this code was added, which Anatoly may have more understanding on. The motivation behind this code was that Linux allows limited amount of page mappings, so we were trying to save on those. However, since then there have been a few changes related to partial unmaps that may make it so that this code is not only no longer necessary, but is in fact actively harmful. I agree that this at least warrants a second look. > > Anatoly, > > Can you please provide your feedback on this change? The patch probably shouldn't include the mailmap changes :) Could you please provide some steps to reproduce the hotplug issue you're having? It would be great to have a test case for this patchset to put it in context. -- Thanks, Anatoly