Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp385888pxb; Wed, 25 Aug 2021 05:43:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwpGGvlvD024r//ONyi4lissquOnGMES7Ry974FZh1LXIuFMVQEsTB0BSdNWq9hazBIKp/ X-Received: by 2002:a17:907:94c6:: with SMTP id dn6mr47884506ejc.287.1629895426443; Wed, 25 Aug 2021 05:43:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629895426; cv=pass; d=google.com; s=arc-20160816; b=hKQXbz2uLQA3EVnVspA6YkU0HBAAN3sTNGJ7qlSW0Zg8cKu/8kBeVuUBCclNhRBcei wgG0iUCprIwKGKI/oo9Nu+Auot1qzaOLKLmMZrT379SLddnPebCE3YnZn8trDF8LyKsM V8NWGlVIs1g6AYIAO2n/3XIpLyArsmt8iWaGvHAPXe7d2HTZ8q7SJtwNeFo9wOB3ZXU0 1nitxyZUGLa4dwCl2QtLuOu1AAYP/SGvxBWsLjOduKL7UnpENoIuxufJah7MO/i39rjc VMUMpi12dtr1kfSYQWheqcilQ8OEqj6+6eMvQMQUExoO2TtZIJ55MRlirWbE3DHjFwv8 K2Yg== 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-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=6wA/QykVxwmbJScSmGXv9PeBBKbGZF31oOssGPfINyc=; b=lJ1S1s3KqvTPUybMYFKlJmFksT8xjBrjU64IF3n8/LYq8ZYzKTrpNZRjOdwdq+cWa7 T9N69BezSFm5QTYR6GAwdgOXoCBXemfL6S5YFHJ4/QHsHpu1eSwUboDn/AUcQNd6MYip ajgJJMlk48i6aGxRVRoAmtxS2oyuAo+6O2C7O4STlI3pJsDaGvvOyyUdXa2S2BthaFw/ weZAWy0m1kRqh8bNe89WLoZ1pU+FzcJela5gb539xv48VmP6IUQSabnCbhFZEzf7nRKS W11dkVfeQ5Sc3SCvuWXqw3AV+VWaEvxAkx4Ozk0SnlmBM4frK/Ih0YbyOplEPt8YRoS/ jlaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=BFOWB4WC; 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=QUARANTINE 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 d4si20681708ejb.7.2021.08.25.05.43.21; Wed, 25 Aug 2021 05:43:46 -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=BFOWB4WC; 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240372AbhHYMiy (ORCPT + 99 others); Wed, 25 Aug 2021 08:38:54 -0400 Received: from mail-dm6nam12on2051.outbound.protection.outlook.com ([40.107.243.51]:60641 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229873AbhHYMiv (ORCPT ); Wed, 25 Aug 2021 08:38:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WVKSjxoyAilNmnDXrwahENGZoVSuPrVJgJbU8z1LQyWGfi+EfGQpx4Y1FpQjgX0N7cEZrPgyj3fM98WX+od8U+eE4w2FOW8Mr5Plhq0BTUC2lfiF5ToSMaC4Z6LKK3Nud7Ax++imYMBZybopW4Ynr9gE5Tv9HIxeg/CXt4ZXjVOgTUQ+KpkNAUzUwKkJelAEqlvqVYX6ikTqS42tQR0+6S3H78F7QmcaoaB7O2o29ryLxUxzuOgLcabBecqJAq5TQ6whRwoz+FCyCCCl1LHijLOoDTMyra2Kmel5rQw6K+Ta7+GovPm65oEQodr4gDKYMhSsBEXpu23nExpMOPaxFQ== 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=6wA/QykVxwmbJScSmGXv9PeBBKbGZF31oOssGPfINyc=; b=iONJ3kDoIdVJjXap/7c7wxZN0NMdDhZl5aForahYmihBjtwaHn/l+zRw9I5lJcbh1Qi78yTYjKF+6thKDl7//yyQL88pnrrAv453Zo52xqd/soUjt6Rat9tpzLAUxGhhaVJcufBKpXVNeZtpILO1oMJp8KznKtoFoAA0nt+Ov6jSHZKFPSmvtkJjKVSzDfrSp1uS+3ievmCbFlKzJM7KjF+rAVRv9wzockUpH5WDdkuRxZdZe6TSv+wYeNovwpOl9gVRzHQGspbuP4zl5TU4V+MRCORKPE5eual3MEDpGliFYxwwA3RoL0LJjxkWU8yK6f1iu8MbFoay5zA2MvhdBA== 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=6wA/QykVxwmbJScSmGXv9PeBBKbGZF31oOssGPfINyc=; b=BFOWB4WCpBH1SgG1l9xXIsXpFtijRgikeIS5d/R7D2jikqzYq3fPHN+v0BKa/udqjCqWzpYNH5NczXbnLJ7YiEUePZ1LKvYdMCSWMGnHxsvgeZura+HQLn9XjsLZIheHR5TPxyWbmAmYGmrVxppPFGLKxDfJOKVs4iYRSmJYt9/Ua8pT60VUFUyciI9RKPUR0ZxlGzFNVPCUYMs+pOJoLXis3ISOmXk3ZXUNR6JAAeiHn64VX0Ad60d+CuanIyG1B9aLqeOSOWTkWHou46hSUEBVlzEUVIWOS8AIl2YLZO5TaBkUpA9TI0P/+7NvvLQiP8yF1HJXNl/4KT2iIDT59g== Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL0PR12MB5555.namprd12.prod.outlook.com (2603:10b6:208:1c2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 12:38:04 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::1de1:52a9:cf66:f336]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::1de1:52a9:cf66:f336%8]) with mapi id 15.20.4436.024; Wed, 25 Aug 2021 12:38:04 +0000 Date: Wed, 25 Aug 2021 09:38:02 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: John Hubbard , Gal Pressman , Daniel Vetter , Sumit Semwal , Doug Ledford , "open list:DMA BUFFER SHARING FRAMEWORK" , dri-devel , Linux Kernel Mailing List , linux-rdma , Oded Gabbay , Tomer Tayar , Yossi Leybovich , Alexander Matushevsky , Leon Romanovsky , Jianxin Xiong Subject: Re: [RFC] Make use of non-dynamic dmabuf in RDMA Message-ID: <20210825123802.GD1721383@nvidia.com> References: <20210820143248.GX543798@ziepe.ca> <6b819064-feda-b70b-ea69-eb0a4fca6c0c@amd.com> <20210824173228.GE543798@ziepe.ca> <20210825121832.GA1162709@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: BL0PR0102CA0023.prod.exchangelabs.com (2603:10b6:207:18::36) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (142.162.113.129) by BL0PR0102CA0023.prod.exchangelabs.com (2603:10b6:207:18::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Wed, 25 Aug 2021 12:38:03 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mIsAM-004spl-J5; Wed, 25 Aug 2021 09:38:02 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0fe0ee7-128f-408b-8d27-08d967c52e83 X-MS-TrafficTypeDiagnostic: BL0PR12MB5555: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YRKLJ4QwYs0MJ6Ji1MKFUtGPiZ1xUmmiFTMQGQYF9tTNQNlgaLHwXRWu74FQvHDCmLjdceAf71g8IIsBFGhpjkod83KFLxZYMJcDcDYdVHYtb/fKjT2MQ2l1OrtXSCqO2C9cpv4mZtuuwqo5gpCyLMc7hI/HrzT3KITizuQSJrKmnGS5VVl8KOnX0APIdOMH9p56UiQa2UoHKEkggdeWj1Oi4rmiDUzwzYtP25Az//u03+6X1SqbnEhU270JGD7zGIlJCsImsKNaLBaNuUyurinowfyc94NkMpp70nSuFdxiGksC83UNuRsnQbRPgux55v68/OoXCQ4IQ9iX3ABw0NLQvVt74TOEKB2u+RMnaGM9gD76kQXvYOVxD6NNJ2dPRxlFQTqAFDXGEzs8tA3IsyoHjaSBqdTJ4J8LFOQ9j75O3xNT54pIVTYh2asSNLCz0mJNiNXTZ4CtH4u0zRTdwedXE0B9cGlBjRJiEv1BWWBMt64/aW1WbpangJVxIKP+75KBZWPmbEWJqLqleEmpjkmPU9WbRufRwYnGRdTWdn8zayEvBuWnOE0SjlJdpvKXJjkGdMZOc/nmi5u7QYp8BW9AIJyvBrI4MYU1VrkI0H6760butoOB2EcRgu8k3EWdNOl0MAkGKORVD+x0tOFbGw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(136003)(346002)(39860400002)(376002)(366004)(38100700002)(66476007)(66556008)(8936002)(8676002)(86362001)(426003)(26005)(316002)(66574015)(66946007)(9786002)(9746002)(2906002)(186003)(5660300002)(478600001)(2616005)(4326008)(83380400001)(36756003)(54906003)(1076003)(6916009)(7416002)(33656002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bHZPdlB6NjVRZE54SldHbkJjY2xZd0c4dFZwVUNyK3ZEOVRVWTRJa3dCdnpG?= =?utf-8?B?U2NjeC9MN1lWWS9LbEM3MW4zVEhnR2lyWVZ2U2doTmdEMVQrNlNMU1Z3dzBx?= =?utf-8?B?RndOQWpIckl1MkpxdzlqU0RSYmVMdVdYZWtWZzlINUZxV2MzdXRkdnh6UEUz?= =?utf-8?B?NDEwUGtCRHZFQW9PZUxKdTBseVpQMWhEcEsyRWhPZGFkRXlkcVFHNWNsbzVI?= =?utf-8?B?U3hORzJQZ3FuZXJkdlJ5alMyci9tNEg0dk03aEJqc0ZETlJEM01RYU0zNmxW?= =?utf-8?B?eld2a2JSSkdO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0ZLRHd6cFV3QUsyRVdkQ0tPOWh1emRxWGZDajBTUmZhUkR2T3hV?= =?utf-8?B?Q1k1QXlZV1hadXJVTkU5MlQ1V3ZXQ0xrQU9XRHVjLzFUUTYvNXNaNE9zeERl?= =?utf-8?B?bVMxclZqejBzT1lwOVhoY1RvTWpMZkpFM1BqYXNiUWlzWGlvNTFlNFhMWDBn?= =?utf-8?B?dkd1ZVJUVk5ERmV1TGVzMDZiWk9nYk5BcWF3NVAzY2JjRDJXMXIrNGVHUUJ3?= =?utf-8?B?RndiUU13bnBEb09pM3BzU3lhbHdVa0RrT1F5TTNvb0F6WlZEbU1zbHg1MGVw?= =?utf-8?B?MElSVysxTUhwd3QwZVlPTmp2N2RkUm03WWxaWkFaeHNaVGx0aXFBS0tPNGM0?= =?utf-8?B?NnhXc2JWYW5jc3dlazE2NkFMUmRDWkV3UjFJTkxjdndJUHdTazJ5M2tJSm5D?= =?utf-8?B?UHR4SSs0OU9SWkNpV1lpZmw1NzNGWnlueVA3WFdEYTFUNzVXdUN5ZmtuOE9Y?= =?utf-8?B?Q2NVN2ZQVW5kbHJ2eG9SOE1xNTRKR0g0WXNzbmkwQ3NXQlJHSkNDS29NRVBQ?= =?utf-8?Q?09U10APO8JZDab0TJ+JwX3yQ3Us0tPz5FQlGQBb?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0fe0ee7-128f-408b-8d27-08d967c52e83 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 12:38:03.9453 (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: zGPH/hBu4bRlgNE3C3znOAVEbv78sAbMEAJ3xJfEeJuE2STlMCrESM0UdFKLFRaZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5555 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 02:27:08PM +0200, Christian König wrote: > Am 25.08.21 um 14:18 schrieb Jason Gunthorpe: > > On Wed, Aug 25, 2021 at 08:17:51AM +0200, Christian König wrote: > > > > > The only real option where you could do P2P with buffer pinning are those > > > compute boards where we know that everything is always accessible to > > > everybody and we will never need to migrate anything. But even then you want > > > some mechanism like cgroups to take care of limiting this. Otherwise any > > > runaway process can bring down your whole system. > > Why? It is not the pin that is the problem, it was allocating GPU > > dedicated memory in the first place. pinning it just changes the > > sequence to free it. No different than CPU memory. > > Pinning makes the memory un-evictable. > > In other words as long as we don't pin anything we can support as many > processes as we want until we run out of swap space. Swapping sucks badly > because your applications become pretty much unuseable, but you can easily > recover from it by killing some process. > > With pinning on the other hand somebody sooner or later receives an -ENOMEM > or -ENOSPC and there is no guarantee that this goes to the right process. It is not really different - you have the same failure mode once the system runs out of swap. This is really the kernel side trying to push a policy to the user side that the user side doesn't want.. Dedicated systems are a significant use case here and should be supported, even if the same solution wouldn't be applicable to someone running a desktop. Jason