Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp371041ybl; Wed, 21 Aug 2019 21:14:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYqMTvElxKnxBgM6Sc8TEMxWF8bHv791L7MLeFE0wiuOPNXvXG0iQEdPKMRGa4sZMiHHK0 X-Received: by 2002:aa7:8106:: with SMTP id b6mr39311635pfi.5.1566447265837; Wed, 21 Aug 2019 21:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566447265; cv=none; d=google.com; s=arc-20160816; b=myBnFkhUW7mbOqrJDiheWP0BPq1B64rh74JxwlbM7vA0n35CsuXaAtyRSGwS98yq7a xPQFVW8Gd2Yz00hvGYv7uJsAIO6JHWLxBp+6lvaEqwkhADpHw6zaeF/Vk33XeLGdSjWk 0K0sxRnbgFV3rDwKA05RaU06M7E/Z7bVEQlyasaGj70sjnUrwJ812+XeBb1TUE4GOjp2 OTTs74qK5xStyKScU1o1EIydofehX58ZFyKuLpGSdMTT4ZwQbXiGdzLkwTY4qyfwGzBt d8j34JWwM3NF2MdNaKoN5P+7oo9caSnoaxwW9nPr3PWS60dwNnhks7B3zOhScUjWJd/0 wVxg== 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; bh=+6MIEDVDz+kYKvVqocLwN0oxTDJoTtrEmOVUlsQfLjI=; b=07KiU5JPQCsckf9n8Fhw6dcSX+5gg20p6geETESU2G/Cempu1LBoBUuCvpG+pygF7v qapLboFH+KdVrkNPK8gH3b3vKpz6MJCN2uZx4eR5N/wxWos8QJbS6dMhw8WaSnv1NEHg INEbEAVCQH4FOFCbqZAGJeb5T58M9w7++L8hgJnNTZFRQWlJjczZ2XYjgIcwxEm3u1pk UkLjkXbMQBpm0/m3bTuMSVaOF7bBds4Fr6fSO/oEm63R5SG+lv+p3hkdLkeIP2qgry46 LosNGi7+Npf+7syGEEO/fn7qjcybjYpZa3Zp8q9ygtz/dPTjlfwjoskFnpi0j0L33n7p PFVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si15900665pgm.412.2019.08.21.21.14.04; Wed, 21 Aug 2019 21:14:25 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730337AbfHVEN6 (ORCPT + 99 others); Thu, 22 Aug 2019 00:13:58 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:58330 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbfHVEN6 (ORCPT ); Thu, 22 Aug 2019 00:13:58 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6] helo=gondolin.hengli.com.au) by fornost.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1i0eTq-0001w2-S9; Thu, 22 Aug 2019 14:13:46 +1000 Received: from herbert by gondolin.hengli.com.au with local (Exim 4.80) (envelope-from ) id 1i0eTk-00009t-MR; Thu, 22 Aug 2019 14:13:40 +1000 Date: Thu, 22 Aug 2019 14:13:40 +1000 From: Herbert Xu To: Daniel Jordan Cc: Steffen Klassert , Lai Jiangshan , Peter Zijlstra , Tejun Heo , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 8/9] padata: unbind parallel jobs from specific CPUs Message-ID: <20190822041340.GA590@gondor.apana.org.au> References: <20190813005224.30779-1-daniel.m.jordan@oracle.com> <20190813005224.30779-9-daniel.m.jordan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813005224.30779-9-daniel.m.jordan@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Aug 12, 2019 at 08:52:23PM -0400, Daniel Jordan wrote: > > @@ -191,22 +184,25 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd) > padata = list_entry(reorder->list.next, > struct padata_priv, list); > > - list_del_init(&padata->list); > - atomic_dec(&pd->reorder_objects); > + /* > + * The check fails in the unlikely event that two or more > + * parallel jobs have hashed to the same CPU and one of the > + * later ones finishes first. > + */ > + if (padata->seq_nr == pd->processed) { > + list_del_init(&padata->list); > + atomic_dec(&pd->reorder_objects); Now that you've changed the test for whether there is work to be done you also need to update the code at the end of padata_reorder that checks whether there is work to do. Otherwise we can end up in a busy loop that just wastes CPU cycles. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt