Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7199117rwi; Mon, 24 Oct 2022 11:06:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LisH+Kw6TnRXQxMnCd0gDhspKFvxsl9xW+97Cwo9yApCrTuxu2eb4LDN4uyNooFUO0UL0 X-Received: by 2002:a17:90b:954:b0:213:c01:b8ce with SMTP id dw20-20020a17090b095400b002130c01b8cemr7885761pjb.168.1666634768901; Mon, 24 Oct 2022 11:06:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666634768; cv=pass; d=google.com; s=arc-20160816; b=KO65Xv6YDT7s7p58HbnJ2sNTnhsz0C+hfldiH5+fsk/8n6wEc+6umZPJ8YlMCVxWWg IqqWsF49eVWkj4kUBtmI7NPbcWtYSyCaMt2EhkyGzXbXvV97tBalhgf8LAUl52GriQSf 6lngPjZx9QByFFe/42TVq4HNuRCMXOBPk8XbbZkq0xrkOlQIhShUARjg//Tltt30qEFu l1wkz6VjDWzg+EAkfcMqzFupxsJC407nIxA0UzR4GO3InemEu1uszTo9Puv8V1Z5cMak hg0ChBe9xEbA7w4PB6zdr6CFwWhbWlevK4gMzZ4HufEveoUHINM7V9/saokfGO4RDY9g Eijw== 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=IrtS4FYtHSaz32ZmTGgr+QmGisXQJbFA7vhnud4kTqE=; b=wVnYdDuVmls4YwEHmS8hI98pq2lv6BOdDadRiDuXjC+DUcUe/OHSq/zRHU2Po7hKHf /Z/udpeONPfL8OVLSmEtY55Go5vOqYP6MC/tbQ9E3x0eqjlPoCs/sCV8XapiQWDu5m3O IqwnEuu+sRXIv2/E2hcISFLsbgmLThlv2jfIuc8ESHZn5AklmgIThQypui8/85oADBoC 5bBOtI/RYH52OZohWX3B1LAwelpmEdM9ibtu7L6puCuPCdZ4WeHMxjERE6P3WotdmAb+ N6PKPs8WnimvRsKlzPr00tp5yfGa1iR/dxVam+QE28YRBaN77kLWrr5+OlnHB7aSu1Yy YSIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=neo5nPDO; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a170903200300b00186940d7eaasi183983pla.31.2022.10.24.11.05.57; Mon, 24 Oct 2022 11:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=neo5nPDO; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbiJXRvj (ORCPT + 99 others); Mon, 24 Oct 2022 13:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbiJXRvN (ORCPT ); Mon, 24 Oct 2022 13:51:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C528175AD; Mon, 24 Oct 2022 09:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E5FcPd3a0IRH8wELBm3YiQuTyfCJ7eFrcW8Z0MI16Qq0tzKdC8Uz89Eazayz4q8Bt1QAx0Qj4vwHQ4e6wylBukMVFqM1hyLKK4adXzFlKygfJAzNImspkmwyKXGXgGC1ueQtRILT/cnYRledK7bpiYtfEItR6jL0EnzgM7KS49fGt1GOSj11P1WJF7x+40rOP1Ak9LCyygl9lPxD4fmrqPtIqIM8ey1wmZxmFqhPJ/1KM2SBfN+uTfixbMmVSJ8MRQzBHs0FhpmbgKVhWUcD1wYUd5yPuQ45V3AsYCiLPV9omz37ckR9YZGD8GDmqzHQbPhRmEdNyvN0WYrijN1hIA== 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=IrtS4FYtHSaz32ZmTGgr+QmGisXQJbFA7vhnud4kTqE=; b=l0LEQo3kgMHnzhni2U+c35nc+IPgB0D/McDLyTYNoak+SbBby2yyuLE/gHkq8MbqVyuHWBH20x3dJHgZCbdUadXA5NkQ1N02ehUEIiGgQx6c95GOlRxiy8jyROqpfTRx/V+t+ixWSx7yBMXbLymtMfzQrPELey6WJ3jQtAdQrri60dOfoLnejo4kRY2/3ckG+Zzg7wv2bCydUH24CFFTDPalxXbJt8SZ3UkqpNJR0FYGQYkSv4LgkCHBl/pHQpi5/qC7ROQ2RqutP3/P/Jft+/USkem1Or76mFNu1WPqxjJq30/t11nm5LbzlBgdOjBh2iW1/z5uiFvdiUHsjT2ekw== 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=IrtS4FYtHSaz32ZmTGgr+QmGisXQJbFA7vhnud4kTqE=; b=neo5nPDOe5KbqnjC1aiznu7MZzATbT2Bq5DInRnX6Cou4aE8TKiFl7qnQ9trTqGeDTwg88NBwMWhbzq8FNG+WscqoWIZB7omRoRw0dK5jxns8wtIOYswGPkZ3GS6y/ZVao6crSsReSgVp6Hrbz2Mn09WC7HrMX0y/1lRSaXTju01F6ejTa3mMSXboDdcvhJlR5AbOJhI5GfrWn3qDDY2cZ9s/o4j0M2rAB/F2zqLu9McCfp8raD21v5Ir7zaWPJCUV5rK3ozG17vKXZ47nncIjrieLDdUCjflIwe3ITe4S+u9PkXhw+fJ9u/SSr4W/AiNcltlyvN3FVxw8elmUNmeg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by BN9PR12MB5308.namprd12.prod.outlook.com (2603:10b6:408:105::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Mon, 24 Oct 2022 16:26:17 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de%6]) with mapi id 15.20.5746.021; Mon, 24 Oct 2022 16:26:17 +0000 Date: Mon, 24 Oct 2022 13:26:16 -0300 From: Jason Gunthorpe To: Niklas Schnelle Cc: Matthew Rosato , iommu@lists.linux.dev, Joerg Roedel , Will Deacon , Robin Murphy , Gerd Bayer , Pierre Morel , linux-s390@vger.kernel.org, borntraeger@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] iommu/s390: Use RCU to allow concurrent domain_list iteration Message-ID: References: <8e268ab5e0dadf86be5fd7ffaa9debb76cea67f3.camel@linux.ibm.com> <68d91d7a5aadbd46dc34470eccd6b86a84c9e47b.camel@linux.ibm.com> <89a748fb5caee8be5d91806aa5dfd131e92d5d82.camel@linux.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR16CA0009.namprd16.prod.outlook.com (2603:10b6:208:134::22) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BN9PR12MB5308:EE_ X-MS-Office365-Filtering-Correlation-Id: 554ee1ed-fe36-4046-f990-08dab5dc7a18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zin4tzB1jjQDYsmF4N2LWXGSjGixtJAazwZXepEdT9Ib4y4nHNUwjbhI3GyYQBUVYRfysPqzRzrUYsA+i+DlbmC0AHQWy2DnrV6knunpcCKlhdmSdeMhIHLvGvzoYCGQt5FUKIvp2PrWLYtsHBgstuR/eFx9mnZgS0gyrQ76npwlYInyVZCMsCwvDnva8b1yE1rIBNmgln6dWtFJKjNvE0r7MkYOmCmvX+l7XT/86zBqb/1HqOt9pp8NWhDmbX7xv4UXHwQ++Ci0S+6qHubnWHkgrUtW7soL5JRE3AHuV90JvmLxr8oaBX8P36lXTs1RFS2k7MFy0mp9kPJ0B/OEY8B244gWP4xgUF3Pp1CrZMPwCPO2p1wE6pxDunqlmo8feFyUlLkBKG7rWxaor8xB8X+NlrkOfWybn06nePwLB8Vz3nYVQS4KzeNN0cp9aXtt4Xv8EOX4OgnMzmtBMU6xgrykxLSBEWZwaBaChgdqPiE0hg32sCWk8/Ln+QO9RsBiJIXWVsGn8F1R7IVbnBgqQPTnSajUrAaLaYcUy3jRTxNiDbY5pNLQZYFrLxL/V/OXXi61sbYgQYRpj6ZlolLLLJCDunluJG7ftFhjrNlXronLUcw7jkR9LRdfTZGY2yqw2ESeYTl25jhhHh3ho1h8tKKYokjQ21YCgvbM5cFOq9j5iCv9N12k8Nwhkas3veTY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(396003)(346002)(39860400002)(366004)(451199015)(54906003)(36756003)(8936002)(316002)(5660300002)(38100700002)(4326008)(8676002)(86362001)(6916009)(66556008)(7416002)(2906002)(66946007)(66476007)(83380400001)(478600001)(41300700001)(6512007)(6486002)(6506007)(186003)(2616005)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jOXPyBf3PCQwv44HSmEv6/B0B1ZXv5v2X0GSIhOg6VaAXK3XnIQKzPvNUT8m?= =?us-ascii?Q?/NiLVoFXw7Xh9jSo6S1a/Xh29dPQt4vbecLbQj1030yzdApI586dssB54CPK?= =?us-ascii?Q?P7xFN+q9NFqgVvmuqVm8+e1gyqyt5qgYKh++f2vxUtv0gMmIYQIGFtGGC7Se?= =?us-ascii?Q?YnGWQYznteDckSjNNvXzXD6gftTYu7oDzmKJmmlWb9RgYqXQDsDgDfkyg2Tt?= =?us-ascii?Q?hPNETbJ768p3UtOFaZDNA4IJw8CDFtmQd6+Qx7NToHYzrhNllUgtdo8cgNd7?= =?us-ascii?Q?ShjcQw/vCEV/cGAVstEX1Y7es+RTwNc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Y5jzh9qKFU+3JM+6Xk72mN8034NDzEu1BU+XMoMAiCDcxdwt?= =?us-ascii?Q?Luurl5cq9PeKCe5LINHYhoADEu5CwY7vj5q2CbWigaLpCjTOAcSHLSNeNzsJ?= =?us-ascii?Q?RBOZUMgXNxNToe4UOvsjND83SV9SMDOtEVvppmb72zRqFkpj57nQ90jzWutt?= =?us-ascii?Q?V8vRxMV6vulpjCt9XJzLp8HZHVX+taipz7TL/S+2hi1N51gjzhCbJ9hTZthP?= =?us-ascii?Q?/rlmDvxZRoetsM9KIAK6SPJjg2vGPuxlto3u1ErGbWbmiPuLLCBItIZ4VDDw?= =?us-ascii?Q?99zd8IuO5Hq/3pD9O93+u0QMc5wzfAk8XbhVaxnoEEbCcK7cXJfm7lpbeUng?= =?us-ascii?Q?SRuI/2EpRgPJPJtZhqk=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 554ee1ed-fe36-4046-f990-08dab5dc7a18 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2022 16:26:17.5998 (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: Qb3hMsXPVlUknvKxlH81w/nhfBHhOGWW8jMv73JpxNoY8o4YbH5KNdTOr+NyRJu+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5308 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 24, 2022 at 05:22:24PM +0200, Niklas Schnelle wrote: > Thanks for the explanation, still would like to grok this a bit more if > you don't mind. If I do read things correctly synchronize_rcu() should > run in the conext of the VFIO ioctl in this case and shouldn't block > anything else in the kernel, correct? At least that's how I understand > the synchronize_rcu() comments and the fact that e.g. > net/vmw_vsock/virtio_transport.c:virtio_vsock_remove() also does a > synchronize_rcu() and can be triggered from user-space too. Yes, but I wouldn't look in the kernel to understand if things are OK > So we're > more worried about user-space getting slowed down rather than a Denial- > of-Service against other kernel tasks. Yes, functionally it is OK, but for something like vfio with vIOMMU you could be looking at several domains that have to be detached sequentially and with grace periods > 1s you can reach multiple seconds to complete something like a close() system call. Generally it should be weighed carefully Jason