Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp500314ybc; Fri, 22 Nov 2019 08:29:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyL0tlu5okk2d0jmWVdt2/BFZoFCGzj/qGxKvv5T52UGIX+aKvEcuj1R1AYs7LdsPoEhHAl X-Received: by 2002:a50:e68c:: with SMTP id z12mr2169002edm.53.1574440176672; Fri, 22 Nov 2019 08:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574440176; cv=none; d=google.com; s=arc-20160816; b=NEj3HPXT8V9FrwtGJI54VhVTtgX+/kSD4S2ikYdKrWpwrfG0ofykpnBHDVlaewHnvT 9pUPNZ/LMkKqtay8rMNLWQZt2Unhd7Lhe8JK0DkOnu8KX9EknjuLhir050G9MPLHFMYh tZpzvJZhw75w4edIz4Wvh68eAURFS0QQvc20IFY2Pfoqq/o6LvbSJ+fPhkRc5u8Em6H/ 5eJ2Nv8jPJmnJGsOgklAvX0irqA6s2iF+vzu4YPqGL0davAyscOyk8s0MVOI9LebevZP lPSMMvGW0ZuGX3Sd5OIjStWVnRYFeq7nDohw1FxRAN2GlAd2XZ6n4S8EfDmUMXBBktYr UQfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SnkAoFLe34M7NtOQkFzQOWouFU/OBziOwmj95OAqjng=; b=yxcIhlN+3qg3Jt/jnXd5tC8FinIZwK3tpNzO6PviHxA0hc7tGQdfYB+OXw+k2FigQx Ls5nu/nptpEeVSq0xTjQrePXDO7Maj4ZA7hb6DM1p2x5JCCrTT3DPuPkgksn6U5BswlK M66gq9MG7mnNG4ZFk0EBqYiU+HqoeEgEUWLRpUScJFvxjrX1hGyc8PnAsaG+09S+nzd8 jPTpqyzVCq8XB9/uIvmNa07y8+tjR71ozqUHstyzdutMAmKP51+qjgIjnSdF+dUS1YAX wyHWcoCH50j1eQvDaKq8Ka11hhgGGD8+uoLzS8vPscnkg9W+8eI6Zp+o4PyDtYcvcxGk gLQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b="NVHv/2Eo"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b96si5041479edf.450.2019.11.22.08.29.05; Fri, 22 Nov 2019 08:29:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b="NVHv/2Eo"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbfKVQ2S (ORCPT + 99 others); Fri, 22 Nov 2019 11:28:18 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:33638 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfKVQ2R (ORCPT ); Fri, 22 Nov 2019 11:28:17 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMGODnX029754; Fri, 22 Nov 2019 16:28:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=SnkAoFLe34M7NtOQkFzQOWouFU/OBziOwmj95OAqjng=; b=NVHv/2EoAgLwcaRi41l6habM5YyapMqPsRy1YiMlmML2KYCjqbmqwGiT3LjFoxFpyTzw pSC6bBDsHqqxTW/Y0sfu9R1CKX92oBqEZS77kgS8IaVW7ur8XCrUoSrvWbPKKhv7SqSN E653LR0kxSNJVD24rVhV3ywHZWRVJM8YSIUFY+0hDBU3AsIZriXSBLBza0b8Kxc2yDfk EqqPz24WRIaGWaLarsv1X1eVcHcTjtKfv4igC40+nlXEW9qoYshiSzhw1bxHwV8TKSol eHGc4D9shNx1BV8aHbrH+GAqsExu1FwARtMF2T08+pSU0dZ4eLXMoam9ThWjVavOUyBK kg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2wa8hubny4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 16:28:07 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMGJ5qA058800; Fri, 22 Nov 2019 16:28:07 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2wegqrjcy8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 16:28:06 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xAMGS503028121; Fri, 22 Nov 2019 16:28:05 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Nov 2019 08:28:05 -0800 Date: Fri, 22 Nov 2019 11:28:12 -0500 From: Daniel Jordan To: Herbert Xu Cc: Eric Biggers , Linux Crypto Mailing List , Steffen Klassert , Daniel Jordan Subject: Re: [v2 PATCH] crypto: pcrypt - Avoid deadlock by using per-instance padata queues Message-ID: <20191122162812.a4uzsnvr7crghtzo@ca-dmjordan1.us.oracle.com> References: <20191119130556.dso2ni6qlks3lr23@gondor.apana.org.au> <20191119173732.GB819@sol.localdomain> <20191119185827.nerskpvddkcsih25@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191119185827.nerskpvddkcsih25@gondor.apana.org.au> User-Agent: NeoMutt/20180716 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9448 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911220140 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9448 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1911220141 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Nov 20, 2019 at 02:58:27AM +0800, Herbert Xu wrote: > static int __padata_remove_cpu(struct padata_instance *pinst, int cpu) > { > - struct parallel_data *pd = NULL; > - > if (cpumask_test_cpu(cpu, cpu_online_mask)) { > + cpumask_clear_cpu(cpu, pinst->cpumask.pcpu); > + cpumask_clear_cpu(cpu, pinst->cpumask.cbcpu); > > if (!padata_validate_cpumask(pinst, pinst->cpumask.pcpu) || > !padata_validate_cpumask(pinst, pinst->cpumask.cbcpu)) > __padata_stop(pinst); > > - pd = padata_alloc_pd(pinst, pinst->cpumask.pcpu, > - pinst->cpumask.cbcpu); > - if (!pd) > - return -ENOMEM; > - > - padata_replace(pinst, pd); > - > - cpumask_clear_cpu(cpu, pd->cpumask.cbcpu); > - cpumask_clear_cpu(cpu, pd->cpumask.pcpu); > + padata_replace(pinst); > } Clearing the offlined CPU from pinst's cpumasks means it won't be used if it comes back online. The CPU could be cleared from all pd's attached to the instance, but that doesn't address another bug in this function that's fixed by this patch: https://lore.kernel.org/linux-crypto/20190828221425.22701-6-daniel.m.jordan@oracle.com/ Should I add it into the next version of the padata series I just posted?: https://lore.kernel.org/linux-crypto/20191120185412.302-1-daniel.m.jordan@oracle.com/ It would obviate the need for your patch to mess with cpumask_clear_cpu(). Or is there something else you'd prefer? Thanks, Daniel