Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp919286ybc; Tue, 19 Nov 2019 11:24:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyxlCjg41eS6IlnG6Cq4QYyT2l8tBZM+DyBGByGt8j2jBT9CNesGJgEPWuyiNELl4SZh1FH X-Received: by 2002:a17:906:7251:: with SMTP id n17mr37329610ejk.329.1574191490691; Tue, 19 Nov 2019 11:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574191490; cv=none; d=google.com; s=arc-20160816; b=J/I8MgaN3yP39sZs7EnzMgGOt0Ut4XDqaCpOG6TtqM7dNP9aqZosibjzXJKuWghsrQ KhHlmxteMRM2sdHvE3NGABkIrK1zgNSqU73URk1dJau0LwJ51ltYXMJadUYo0rMZTWSA IGuN7WdyvCyLULLWHHpQXWabTZoTtG4Q0R/f9dd8u1BTkbC0F0zKtHutU3UGrIujhOUI Dh0ckiDYzoh4U74JpqmmqDVDAlHePTttl8+4bcw+TZePMnia97HNYCBXbY7oHSvob3vt c6/zINyk71Tl0jrasesBjGKnNaCt379Wf2zDgZu6uZkbmMHrJKDNhDSkW/ALs5E/N1j5 Y0Eg== 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=QxgcqLxoGjB8tiiHLUzk3bvI2hEG7GG+c6sd93JVxAE=; b=MMvC0O7qDD2Tt8rcS0vyn29NukeyFYFHmHwvJCmr055xtdxXVm2B/iIKF9s9FuY6JE dn7+o+U78tHyxdgpTaj5LOzMExzWSpGNKR8KhTWZIIGKmvrCz2PPu2YEfU0S+jurZqvm TuT1r17wz4bkjkVnHY5eujpcQluOoQMMmNjPO9SruiugMtSx6wmrOaxBGQ8FfhvgUkB0 /DjHD4xU/szRUgjpQaEVBizcPyeA+efrqzpIpNPI3TWQ2HI+YXhOl6QhasFjqtN8XXMu nS8vaaEIADZL7yTN53iLrOFD6KMf1vDhw1J26VMFVwmr/XGcT3+DCpgCM+jTDOpXk84c uiVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=LO2dRHCy; 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 nq5si14225658ejb.161.2019.11.19.11.24.18; Tue, 19 Nov 2019 11:24:50 -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=LO2dRHCy; 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 S1726874AbfKSTYP (ORCPT + 99 others); Tue, 19 Nov 2019 14:24:15 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:44236 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbfKSTYP (ORCPT ); Tue, 19 Nov 2019 14:24:15 -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 xAJJJBoP072724; Tue, 19 Nov 2019 19:24:05 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=QxgcqLxoGjB8tiiHLUzk3bvI2hEG7GG+c6sd93JVxAE=; b=LO2dRHCyRmYOfZlnkSFpTudygOdKoIXFYUlzaOU+k/zAwyqxK9wZ0FqSjLQfvpa+2b4u VQc6RDJdqRZaJMX1Si5+Xs6oiVCw/JmUuVRDedNlVVlrZ6LOYxFYR73HTPTlqyVgLdGN o8x6kxeowdy1Cvxbh8sluYiMj9/fb6bSSZl26s1sRjXf4UBBDkqQNyxYpict6sjr32Fn Q2Gc+hE4vm6RGNEyPeUipHatR0onaYfKsUyy566GsWfU4vv6TU4Bs2jUgUMPfj8uAzyd p1AoUS3IITiP58zJ3HQMjL4YzfkuUpTuo8Byn4s2UCEXUOH2IuajUluzzkbHnRYHFXAx aw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2wa8hts5u4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Nov 2019 19:24:05 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAJJN8uh170689; Tue, 19 Nov 2019 19:24:05 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2wbxm4s9c3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Nov 2019 19:24:04 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xAJJO3Qu019812; Tue, 19 Nov 2019 19:24:03 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Nov 2019 11:24:03 -0800 Date: Tue, 19 Nov 2019 14:24:05 -0500 From: Daniel Jordan To: Herbert Xu Cc: Linux Crypto Mailing List , Daniel Jordan , Steffen Klassert , linux-kernel@vger.kernel.org Subject: Re: [PATCH] padata: Remove broken queue flushing Message-ID: <20191119192405.imfi6q4u3g2zgstc@ca-dmjordan1.us.oracle.com> References: <20191119051731.yev6dcsp2znjaagz@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191119051731.yev6dcsp2znjaagz@gondor.apana.org.au> User-Agent: NeoMutt/20180716 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9446 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 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-1911190160 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9446 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 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-1911190160 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Nov 19, 2019 at 01:17:31PM +0800, Herbert Xu wrote: > The function padata_flush_queues is fundamentally broken because > it cannot force padata users to complete the request that is > underway. IOW padata has to passively wait for the completion > of any outstanding work. > > As it stands flushing is used in two places. Its use in padata_stop > is simply unnecessary because nothing depends on the queues to > be flushed afterwards. > > The other use in padata_replace is more substantial as we depend > on it to free the old pd structure. This patch instead uses the > pd->refcnt to dynamically free the pd structure once all requests > are complete. __padata_free unconditionally frees pd, so a padata job might choke on it later. padata_do_parallel calls seem safe because they use RCU, but it seems possible that a job could call padata_do_serial after the instance is gone. Best idea I can think of now is to indicate the instance has been freed in the pd before dropping the initial pd ref in __padata_free, and use that to bail out early from places that touch the instance or its data (workqueues say). Will think more on this. (By the way, I was on leave longer than anticipated, so thanks for picking up my slack on this patch. I plan to repost my other padata fixes soon.)