Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp266223pxj; Fri, 7 May 2021 08:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxglmKptU26WfreZjPkqBL133xVhqX8U3SHiBgFa3Gxq0N+v4C9cl2C3+ch31l04+Og3B0P X-Received: by 2002:a63:1c6:: with SMTP id 189mr1009185pgb.144.1620400375751; Fri, 07 May 2021 08:12:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1620400375; cv=pass; d=google.com; s=arc-20160816; b=ilYuCpwXq5LtmCF303AvWevxhuhojw/KW84e3EaDzeiPBK99HAVVUGxD6ieJYyXTWF Eib7eU0Pog/GaUO5Y4qGlbG4JyfWAZyVPjwLupP1+6xf/mvd0pMB3oxMQPyXll3j2CdV 0zJI6bALFpUs9yDsfSTP+GDdcV/au7jhSt6xgMb7K4OQpUflDJx2UWzrD+sGRnym3QxF g/I2JrkKp0te1BlMDo6VcVInJK7l86kr3w4NxqVmqqOg4QWFDAOOzysN0lVaeIEkaZby T2Td8YPW9u/uEnERVeZm1SC+06GuXPKAeg+xizQhPi9pg+qEHdDPCLRRao/l5ccL9yd1 RHvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x91ShF55DsdK1AQkgu8r0q9DqTW3y3LHvdTS6vEtdHk=; b=nZRUUoUenrRR5QwE7Di2RUwHrO8rQBf9fX3okqQwebNlMw1yjGKN/Exk1fIfVOJIIZ sltAwTrdagPXKOw7oVl8hYll5zLcQJJn5A/ABipzRS2/YBa9R8jkI7w6O1mgCdzvcwRW 37HJYdD8Yj33J8TattIiWCew0IGWglbZ1g8+NdzfIs54PE/RIF/+B5X617IDXmxR3lEI Yse6j8Vsbf3oBaSJxz09uruX/COekOmQTxHLf8sq2dylFNqLNt+fsLZCrW/mclJoFA+L L8yZCZH8bg5k4wjI11C68RK6iIk5ICOAZeKLuTk0NAtsn4RAJxHO6tBMeqsWTcyZsxli MhrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="gZxIii//"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h34si7114157pgl.179.2021.05.07.08.12.42; Fri, 07 May 2021 08:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="gZxIii//"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235557AbhEGL5q (ORCPT + 99 others); Fri, 7 May 2021 07:57:46 -0400 Received: from mail-mw2nam12on2066.outbound.protection.outlook.com ([40.107.244.66]:44257 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230412AbhEGL5p (ORCPT ); Fri, 7 May 2021 07:57:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRJ7/itJvtDUFf66BOfsidWpxrZKlkJCjnMKJxIQb8Avqrv2w0GzXUvHCL3TuJB5Uzll9PU/to121WLEuXk1iuIhNqY1RvUfxMcx/c/b54OdyW3TnPye35Z/keQQrygy2rvS57Ngm4yWyzeq7XwZW7ty1vbIdl/OJBMDFYA8hTHaJ8jn6DHq4aNfuz8T80uMhbiq/EL3Y6zGXMgWzgzcv2LsRKfWtPiJOAGjXErMu5u5eewH5askvlTCrtuycZxlVc1ILFcBP8thlHezKkRIiM/7E7g1xbMRo/UbdlevPSLOd5zCy8SMA6z/Rv+tv9Q8wp2mxKRZ/ma/TbpjKgsY0w== 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=x91ShF55DsdK1AQkgu8r0q9DqTW3y3LHvdTS6vEtdHk=; b=HsRKi6Jo5FQgWiFR71Z0hChS3SmJxlKYX11kl4JyfgTLck7Ehypo9sOlHkHReTk9nLBRepXoT6kCKM+9O9kKEY26o9ENddjlxhfXqW21m2pYLeBIKpydnMSjIQhHtXAUxaCEX058BPaVWeaMVcg6hk/Lkd+IXKBoGN9yCjPy/Ji9B+7+gUB18AYLnlgbDbMRiJpKw57wcJ7AYc1eEh+rPn1r4liTTofl0VZhcl3jAXEA0xTE+zyyFu9vooAFE432HxPhFbRp/nPebQrSmdrnOMNM+gGqGtWosCSBdby3GXew+tJZJl+ow1lTG3EICZZwELnWydX3QHR487uIZqgEbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x91ShF55DsdK1AQkgu8r0q9DqTW3y3LHvdTS6vEtdHk=; b=gZxIii//zTVu02wO53I0Iyk12vZGYGqf8Yk97sXqdbzMG4AstQvk0w5eOPMBsNhJzN7l+kviggOuOceMpRLlKn+DjWHj8HxbeOwcFH9KUPCwaw9fJo64LggyEgJDVWXe1oB9ECoCLaACeyzLhPwXAhQDKS0oYUJvDHFGGDhB00obnYUUxND8cfnTlSpPauegbwIIjJWnviYfIPpCsekKJVj0Mi8fCBou6HRQJZFBivOciSKTClpVlkeRY8YnxISZjktG0V29hH4alLJKRy3dhX5mEKx0Nm3ddHof4rY7kt+Ut77Cb1l7HMXwpJTLBvjN4Zegmn5u8GLf/1M7xB9b6A== Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM5PR1201MB0203.namprd12.prod.outlook.com (2603:10b6:4:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Fri, 7 May 2021 11:56:44 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039%4]) with mapi id 15.20.4108.030; Fri, 7 May 2021 11:56:44 +0000 Date: Fri, 7 May 2021 08:56:43 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Alex Williamson , "Liu, Yi L" , Jacob Pan , Auger Eric , Jean-Philippe Brucker , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <20210507115643.GU1370958@nvidia.com> References: <20210421230301.GP1370958@nvidia.com> <20210422121020.GT1370958@nvidia.com> <20210423114944.GF1370958@nvidia.com> <20210426123817.GQ1370958@nvidia.com> <20210428090625.5a05dae8@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: MN2PR05CA0055.namprd05.prod.outlook.com (2603:10b6:208:236::24) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by MN2PR05CA0055.namprd05.prod.outlook.com (2603:10b6:208:236::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.9 via Frontend Transport; Fri, 7 May 2021 11:56:44 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lez63-002kCu-3Q; Fri, 07 May 2021 08:56:43 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2b3b70f-96a9-4a5a-2c1d-08d9114f2f2f X-MS-TrafficTypeDiagnostic: DM5PR1201MB0203: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VxQoQnBlixazE4T2P+YtkjTqzFM6VfRaGUdAD1FtDX/VwnYNxfwqQTr+/kjVHWeblQhavuBD4CGIHrW0z6IzfoDoXb9aXtqpsgGtaNyxK/G7uP1TdnhD4h90zya8ng9yYxmLTRVPMCTk653Qzx/XwRNgrSc3JE3zA5/rurbHuZlFfn7M3p1741Vv8ldY1rk9Ne4zOEa4GAoRK1GeTcSwa1NxetvBS/oZSERVJOCz7ulpwZTw/0S3/CFrGzrOj2tdM+W65AsIgzK+ZCNvsyB89yE1Bv6o2LL5vUAwQkZkkKlGh1XoCFyFY9ZeULiYqw/Hw1+abn4/mY3TNinPtdO/TssXGaU51sP4bmIi0lBSaSUHC2c4vYkUGEiPnoobSa0SCLFKOgD2ZFxsKWH0kq4OeTAyX8/bTyUzww3ivZFbtoRS5QfLtRowXYTfAh3GYdashyMsANh5NjEVyvJzTKWRTbkJlU6HT17TWp+nCPlF5k3j1r0kfR9rguhs9JegVCGgaRXX47P254jgQLhrixxK+hNO2C1SXdevm/GhWjN2Kmzao9R24b1k+/Z9sWY+LaDNtqn0K1I/IfXnntzpAFuJEtSo33SWN25/fGQ/pfBMNQ0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3834.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(376002)(136003)(366004)(396003)(66476007)(8936002)(7416002)(8676002)(36756003)(316002)(9786002)(38100700002)(9746002)(33656002)(26005)(186003)(54906003)(426003)(66946007)(83380400001)(2616005)(5660300002)(66556008)(4744005)(2906002)(478600001)(4326008)(86362001)(1076003)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?+DitjvQSCUIYmT/gOw/LJSMU+QHAg+5IJBasGLRWWHfOWnTLxjA/JBnbK++G?= =?us-ascii?Q?xDJBoRfGAu0Uh9HJqc1vJ4XDQZhIouod/4Gltz29l+IlKyqISiQC5s/ZC09I?= =?us-ascii?Q?nie9qTHVHeBlCxeoVxJffpEv3gd0uQ5PgyGLsB/vEu9pqY7maxeNnU6xb3pD?= =?us-ascii?Q?kPHmcEtWyOnd3g81NcJCg0E8KMdB2DUetMra1Nlb3LS6xhJ0wBU9qRvf4SjF?= =?us-ascii?Q?fVdmZWnGwbwLWhosgeuPSfJhugnZrAvNJNMU5v5tMyCJ5/kBm+d821vZFK5f?= =?us-ascii?Q?bZBCgvcsnTn/GihdF2apCo6igSrCPJjBtE5LfFJLamx0vMbF4I3Q98h9deJT?= =?us-ascii?Q?o7X6CXSBEAyT8uWt90suAsD9IKSP8+ucrqrNshLEcJgcgCvNVSdn53QcdZ2W?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n2kJd++JwH3hNjtx7ZsRQOKtfv9?= =?us-ascii?Q?kxUwXq4qUfQiXsokXOX6kwht?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2b3b70f-96a9-4a5a-2c1d-08d9114f2f2f X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3834.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2021 11:56:44.5132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iEitO0pbGoSc+vPviUXjF4JsOBP3cdi0cc/Jrj06Xt+zPq0E7lnQ81tSs0Ako9PG X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0203 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2021 at 07:36:49AM +0000, Tian, Kevin wrote: > for /dev/ioasid there is still an open whether an process is allowed to > open /dev/ioasid once or multiple times. If there is only one ioasid_fd > per process, the accounting can be made accurately. otherwise the > same problem still exists as each ioasid_fd is akin to the container, then > we need find a better solution. You can't really do tricks like 'FD once per process' in linux. The locked page accounting problem is much bigger than vfio and I don't really know of any solution.. Jason