Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1063796rdh; Fri, 27 Oct 2023 03:54:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkW9R9HPpEi2DPKE7veHwlGbiv5SwOpSuFwrMXP5wJ2dmzWr3w2hiFgKoh1GWdqnoJ9+Zo X-Received: by 2002:a05:620a:4047:b0:778:a9f4:bba with SMTP id i7-20020a05620a404700b00778a9f40bbamr2429936qko.2.1698404077519; Fri, 27 Oct 2023 03:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698404077; cv=none; d=google.com; s=arc-20160816; b=jpOwkjPQ9E0GgPMJ50GZWA8tE62CKrshwXKcqbuILo0xOJ8ckNkYS2SRSrRGtvVUnY +8r5X+lzB5cRZrTeQ2ZOSwcfcEgTgCDnSs0LANly8XT7+MvBx0ibHI1GEyyYETd+/W/V 3vo6ilV/cUNLhRzsJQK/3wBynobfpGRw1RVM9ukO2idpR5FavDaHql5Yko0WZSijhmhQ e1BgS9DP4+Xaf65AUSpAHrkLoaaugyvGzpgwzmnyB9O4YmMLizoud1cX/wYox5nzIKFX gbNmHftUAKtRITmOMgLr7Zq7aoAGXZhBD069c1289qusrBdNN2iXG6xtaWTcymHtc7hK MUhA== 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=zIBEJgVIYd/uLuaObryF8CYZ+YbPhYFSvgawBLqBeWQ=; fh=XXxUPpg2/+vhElZLhhiTULL217btPiAq6rk3BtUpq98=; b=fhtIKY80gpKgslH1XzSSHAXS8b7tF2xxRk8J7Vq39hFJy4au78yTNJKCo6KChxPhSo veYPpI+xxyRSTz6gjaWig3faHIHaj0/bEpej+8cPcrxOjemPEKRet0ayW/oBjIplWJ2b tg45KLsV6eWpm1l+h5FUYioqhI6tEb5t2JhVyXZMxdWMkD7YReTveJN0f6DYQpkk9GhX ZBrEFU513hxqR7MWlZUgR8zRJxmdniZTED/0pcEIpKXq0RkO2BtmzIIEQp0/2ycbH+BK pNPWrhPbDLs/LDn3SfXwhfL+colwiaXy/WYyjnwNUQWU3JlXw3xDaJwTxql4Dp7ORgW9 es/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m15-20020a81d24f000000b005a7b2085d14si2117739ywl.331.2023.10.27.03.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 03:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 79CAA83154AA; Fri, 27 Oct 2023 03:54:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345488AbjJ0Kya (ORCPT + 99 others); Fri, 27 Oct 2023 06:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345696AbjJ0Ky1 (ORCPT ); Fri, 27 Oct 2023 06:54:27 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74E51A5; Fri, 27 Oct 2023 03:54:24 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qwKTd-00BeXP-1r; Fri, 27 Oct 2023 18:54:06 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 27 Oct 2023 18:54:11 +0800 Date: Fri, 27 Oct 2023 18:54:11 +0800 From: Herbert Xu To: Longfang Liu Cc: wangzhou1@hisilicon.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: hisilicon/qm - prevent soft lockup in receive loop Message-ID: References: <20231020093558.16695-1-liulongfang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020093558.16695-1-liulongfang@huawei.com> 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 27 Oct 2023 03:54:31 -0700 (PDT) On Fri, Oct 20, 2023 at 05:35:58PM +0800, Longfang Liu wrote: > In the scenario where the accelerator business is fully loaded. > When the workqueue receiving messages and performing callback > processing, there are a large number of messages that need to be > received, and there are continuously messages that have been > processed and need to be received. > This will cause the receive loop here to be locked for a long time. > This scenario will cause watchdog timeout problems on OS with kernel > preemption turned off. > > The error logs: > watchdog: BUG: soft lockup - CPU#23 stuck for 23s! [kworker/u262:1:1407] > [ 1461.978428][ C23] Call trace: > [ 1461.981890][ C23] complete+0x8c/0xf0 > [ 1461.986031][ C23] kcryptd_async_done+0x154/0x1f4 [dm_crypt] > [ 1461.992154][ C23] sec_skcipher_callback+0x7c/0xf4 [hisi_sec2] > [ 1461.998446][ C23] sec_req_cb+0x104/0x1f4 [hisi_sec2] > [ 1462.003950][ C23] qm_poll_req_cb+0xcc/0x150 [hisi_qm] > [ 1462.009531][ C23] qm_work_process+0x60/0xc0 [hisi_qm] > [ 1462.015101][ C23] process_one_work+0x1c4/0x470 > [ 1462.020052][ C23] worker_thread+0x150/0x3c4 > [ 1462.024735][ C23] kthread+0x108/0x13c > [ 1462.028889][ C23] ret_from_fork+0x10/0x18 > > Therefore, it is necessary to add an actively scheduled operation in the > while loop to prevent this problem. > After adding it, no matter whether the OS turns on or off the kernel > preemption function. Neither will cause watchdog timeout issues. > > Signed-off-by: Longfang Liu > --- > drivers/crypto/hisilicon/qm.c | 2 ++ > 1 file changed, 2 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt