Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2409419rdg; Mon, 16 Oct 2023 03:47:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFL3xgv9yhJdweJkBAp6tAdlGIzRgpsjsZR73ef5LWu7RsrTvQ2uPdP24gjY1brwcANL7Yi X-Received: by 2002:a05:6358:5e0b:b0:143:5d3f:f397 with SMTP id q11-20020a0563585e0b00b001435d3ff397mr38228109rwn.16.1697453263638; Mon, 16 Oct 2023 03:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697453263; cv=none; d=google.com; s=arc-20160816; b=pQJRzg9nmVc3mRbE2+iaNZ5UWA9QIZ4Pe5+mxY5DA1yAVuXPIn11jA4eIUJEKnA+dR bvV7vyfyMy4+eceprRZgL9jIl9q2iXIg7fz3rdTuSeKDjvNgLHaCBFqRHezWzztMVEGQ dPbVw/p5BuBLebfNcTeUvYRpiP5sC6M0X2NB1ZgXeAQQQBpqiXUfnMQ6RvUFz1O3IbRD qtt41iyWTbJ5+EIir8d3e4JidI/tsIowbr9jgfLled+QFvNM7RxoRNE+NLYtVsSNuYL2 Uipiky4y/3S+GvbWEikw8o+pQzauykKFmDHVUuI74WGPsHw7s5/BxLZ8e68anQQjeFxx 4Zyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8JHOTtUjxuP8/r85XxffuHjiZsCkvdof2m8aLRPc2us=; fh=UifezLYM7zmE36RwLsvSl14WLzmnRF71eKOP5g3P3i0=; b=vtOCMjZLjJoEd3bvqJsxVIDzSs/wxuXlxKsDIwJQBPcq0f9oWAscEoGONm11ZKrCbF Z6bzG4zCjTii6aEvAtPcPiXNDYCRCUJFEUXRymD3NgHlvshhPMoPf4Zq122gaM2jKX4/ rMxivjuXWxnARPhhc/gcCeDg0Jxt4vbcQwbmYdimWrNCkh5gIbe3+9+zpPMI9sWtdL1a rO4yz1AhecXTB8oawkq+P2lBVagctXrxbaIutbDk1YsUGbTnlnCVG3N+rMWp6psPfQIN LZnfFoPqT2TdaaESlR921MQuyc1PD/k5m2dAl+qVHVXRi9u6W2NnL+J+qJBXeFc8fEU0 aqGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s12-20020aa78bcc000000b006b905fe37b7si5302064pfd.221.2023.10.16.03.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A5D3B80BB5F4; Mon, 16 Oct 2023 03:47:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbjJPKrh (ORCPT + 99 others); Mon, 16 Oct 2023 06:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232630AbjJPKrf (ORCPT ); Mon, 16 Oct 2023 06:47:35 -0400 Received: from a.mx.secunet.com (a.mx.secunet.com [62.96.220.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22CDEB4; Mon, 16 Oct 2023 03:47:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 712DF207BB; Mon, 16 Oct 2023 12:47:31 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XuE_aQheVAQ2; Mon, 16 Oct 2023 12:47:30 +0200 (CEST) Received: from mailout1.secunet.com (mailout1.secunet.com [62.96.220.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id E660620728; Mon, 16 Oct 2023 12:47:30 +0200 (CEST) Received: from cas-essen-02.secunet.de (unknown [10.53.40.202]) by mailout1.secunet.com (Postfix) with ESMTP id DF4DB80004A; Mon, 16 Oct 2023 12:47:30 +0200 (CEST) Received: from mbx-essen-02.secunet.de (10.53.40.198) by cas-essen-02.secunet.de (10.53.40.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 16 Oct 2023 12:47:30 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-02.secunet.de (10.53.40.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 16 Oct 2023 12:47:30 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id D28A23182C75; Mon, 16 Oct 2023 12:47:29 +0200 (CEST) Date: Mon, 16 Oct 2023 12:47:29 +0200 From: Steffen Klassert To: Wang Jinchao CC: Daniel Jordan , , , Subject: Re: [RFC/REFACT] Refactoring and significantly reducing code complexity Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: cas-essen-02.secunet.de (10.53.40.202) To mbx-essen-02.secunet.de (10.53.40.198) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:47:40 -0700 (PDT) Hi, On Thu, Sep 28, 2023 at 04:53:38PM +0800, Wang Jinchao wrote: > This is a refactored version with the following main changes: > > - The parallel workqueue no longer uses the WQ_UNBOUND attribute > - Removal of CPU-related logic, sysfs-related interfaces > - removal of structures like padata_cpumask, and deletion of parallel_data > - Using completion to maintain sequencing > - no longer using lists > - removing structures like padata_list and padata_serial_queue > - Removal of padata_do_serial() > - padata automatically ensures the calling sequence. > > Testing was conducted using ltp's pcrypt_aead01, and the execution time > comparison between the old and new versions is as follows: > > Old Version: > real 0m27.451s > user 0m0.031s > sys 0m0.260s > > New Version: > real 0m21.351s > user 0m0.023s > sys 0m0.260s > > Signed-off-by: Wang Jinchao > --- > crypto/pcrypt.c | 34 +- > include/linux/padata.h | 95 +---- > kernel/padata.c | 815 ++--------------------------------------- > 3 files changed, 43 insertions(+), 901 deletions(-) ... > > -static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name) > -{ > - int ret; > - > - pinst->kobj.kset = pcrypt_kset; > - ret = kobject_add(&pinst->kobj, NULL, "%s", name); > - if (!ret) > - kobject_uevent(&pinst->kobj, KOBJ_ADD); > - > - return ret; > -} Users might rely on the existence of that sysfs files, so removing this might be dangerous. > static void padata_serial_worker(struct work_struct *serial_work) > { > - struct padata_serial_queue *squeue; > - struct parallel_data *pd; > - LIST_HEAD(local_list); > - int cnt; > - > - local_bh_disable(); Note that the networking RX path must run with BHs off. The call to padata_do_parallel might come with BHs off and the serialization callback should also called with BHs off. Please make sure that the networking usecase continues to work with that refactorization. Thanks!