Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2578454rwi; Fri, 21 Oct 2022 05:39:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5S/NNVu9G16o8Jdh07w+ahlXNEqeSdoSTyKk1cN6Q2RRrBw2r3fbHZ0iVant41IoYqssEl X-Received: by 2002:a17:90b:17c9:b0:20d:b4ee:aec2 with SMTP id me9-20020a17090b17c900b0020db4eeaec2mr47504419pjb.234.1666355964747; Fri, 21 Oct 2022 05:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355964; cv=none; d=google.com; s=arc-20160816; b=qZStmtVNtRrnEPEcgh+hiasNo43d2pFjgZFlfaMJRgAvOY7Nb+1uL4hwXMIGbw2Mew naeAoI3k5C+QXrezUzrFQxPhNGfa2LJO2WST4iwkj69wcQp3lEvg3DmD5UkpLIJ0Hnjm gpk0LGQM7HONqkvyNcmw+EG5s6O+J35qkxX4arB9UTrPD1QztQsmBRkvmAy5pvVHwivg Bv4iEGjgt5p+qOCaOpKIwpnv3omXvPn6cQsGUgLX2Ywtn1cOTvYjBC1/ro+cy57LaGBJ CqVWDSJcq74FaOg0YhKFlGsbAmRSpLhyFRaYrmCUVENwnSSZXHLWTYqkWKLlpD/+iEbl qmlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=Ix1uBobI9o+Hwx9mkxSgwrjZvrcNBw5GmPYnoSmZC0g=; b=bYHjdkrbTE4VqiI6gJN9xtQ9B9LqWc2YEyzIiOs4PRMUQyy4jGeKV9/gpGPeVZlLW4 Eir1sW9ungg1a8qvnT7pKnr8RUazyup6kwkKKsUi2R3GFaTIF35YVv9JHE3dm24n+hmV ferI+oi3FYWRqKzk5PdMd5Z5i7bLjeqZFiKIZcmHrM46zodOAbSAcMgcF4C1UH4sIwgD mErguM8cAfIt1+5kNB8FjyMowFueLI0DiMFoby+ez+eH/ddeWilUjpjU2yWwOSFGXHi6 OOhgNZVhLxjjEKuc5/Gat+9I+MjRwEF+VYyD4vf024yB7WMILdl28wS1n9dLh5+L2LO9 MdPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=P1LKqhyU; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j65-20020a638b44000000b0046b2ebb0a4esi22468734pge.212.2022.10.21.05.39.13; Fri, 21 Oct 2022 05:39:24 -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=@ibm.com header.s=pp1 header.b=P1LKqhyU; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbiJUMJO (ORCPT + 99 others); Fri, 21 Oct 2022 08:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJUMJM (ORCPT ); Fri, 21 Oct 2022 08:09:12 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B5B42608E1; Fri, 21 Oct 2022 05:09:11 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29LBhP7Z020693; Fri, 21 Oct 2022 12:08:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=Ix1uBobI9o+Hwx9mkxSgwrjZvrcNBw5GmPYnoSmZC0g=; b=P1LKqhyU3TpGsKuM06Gy0Z0lzgC6pwAGAdNNfCkg9SmFoeUHab7+pLaI6WFyLv6yKBg9 EZ9dyhn1VLPwHykJWwTCk0qmxDeuB+ZQ1bzACK1eqALwXX/Ee3JTwa8eVFdfAW1KOR6I 6IfcfGVe0LwytkEzn33l8PUx3K1Xli0KjsT9wzX9YxPiQ31/OcWOlNrwObRUtvVIlAjx NpC7Ug2OpqZma7HlxrxWdDfMOvJdQeFXhRGdRjuVe+m8UNXX35DSDVAKfUAmjJQYGjV6 VLmrZFvVvm4eck1RBc/XugjJgj/u23Bb9QxStJvUCea0ULL98OTWPxS6YrwvHmbNdUcM qA== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kbtsx0u61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Oct 2022 12:08:54 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29LC5MVa022822; Fri, 21 Oct 2022 12:08:06 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 3k7mg9ahwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Oct 2022 12:08:06 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29LC8bXV26673600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Oct 2022 12:08:37 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FB6BAE045; Fri, 21 Oct 2022 12:08:03 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EE4AAE04D; Fri, 21 Oct 2022 12:08:02 +0000 (GMT) Received: from sig-9-145-0-12.uk.ibm.com (unknown [9.145.0.12]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 21 Oct 2022 12:08:02 +0000 (GMT) Message-ID: <68d91d7a5aadbd46dc34470eccd6b86a84c9e47b.camel@linux.ibm.com> Subject: Re: [PATCH 3/5] iommu/s390: Use RCU to allow concurrent domain_list iteration From: Niklas Schnelle To: Jason Gunthorpe 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 Date: Fri, 21 Oct 2022 14:08:02 +0200 In-Reply-To: References: <20221018145132.998866-1-schnelle@linux.ibm.com> <20221018145132.998866-4-schnelle@linux.ibm.com> <8e268ab5e0dadf86be5fd7ffaa9debb76cea67f3.camel@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: klfKJ7beKJOkBDRPKCrx-JPXjTSQ4Qiz X-Proofpoint-ORIG-GUID: klfKJ7beKJOkBDRPKCrx-JPXjTSQ4Qiz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 mlxlogscore=952 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210210071 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thu, 2022-10-20 at 08:05 -0300, Jason Gunthorpe wrote: > On Thu, Oct 20, 2022 at 10:51:10AM +0200, Niklas Schnelle wrote: > > > Ok that makes sense thanks for the explanation. So yes my assessment is > > still that in this situation the IOTLB flush is architected to return > > an error that we can ignore. Not the most elegant I admit but at least > > it's simple. Alternatively I guess we could use call_rcu() to do the > > zpci_unregister_ioat() but I'm not sure how to then make sure that a > > subsequent zpci_register_ioat() only happens after that without adding > > too much more logic. > > This won't work either as the domain could have been freed before the > call_rcu() happens, the domain needs to be detached synchronously > > Jason Yeah right, that is basically the same issue I was thinking of for a subsequent zpci_register_ioat(). What about the obvious one. Just call synchronize_rcu() before zpci_unregister_ioat()?