Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2456667rwb; Sat, 29 Jul 2023 07:12:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGIWYPkYTi98KszfVeeEjZm93boZ1xQG1URd/2gC2YJG/uJS3HaI7Em/tbZy0JIMFFd9Uxx X-Received: by 2002:a05:6a00:2e8e:b0:682:26e4:599e with SMTP id fd14-20020a056a002e8e00b0068226e4599emr5863903pfb.21.1690639948954; Sat, 29 Jul 2023 07:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690639948; cv=none; d=google.com; s=arc-20160816; b=dXgPYSno9NVS/lynRC99lJh/D1sWoSdlWak5ePtjFtAYLqFGxwTquso7+9VujFtrHc zSb/A2akvRBZVLhAWig/AhQBHFtd2AJ1e+fIVAe6xxgPoBgR0JQFk5WArGR7HGCvIoBW GMd63qG6ehCMjRJlCut9cA2yhImCwB2E0Uv0U9bdvEC10Guj2oF4WUDB1bu0z4x4dARB /z1HEHXaafuswRBhCG9x3uT7CSGjufVf8GWVluFtts8bNQZDmUrgCWgxI+1Urtvq1EDJ zUYVqQxaqCBxnA53iM4aiff2Wg98JeTPaxXUOuX1OoORKYuMP0TMeraT1fO2pBHzBNyT nUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DYsvUvmt45kLH7Z6vKc30dsLp2sZL+ej9xA8u0GeXhk=; fh=iIrmuiooHb58lVSZg9OlpW7yJYF2kt3Km03sQ9AihSM=; b=rgRmwzj0mUdaQj+u4iFCyzt9HqG5qgGXx7gmwNYUeByA2qe8oza8GxeRls0UvukDVg nk8IrKcRPp3jfjQSzpfE/arF+oZfpfudihV1kJrU3IVG2JOEKjspcFzM4opTJ8wya/3Y a2aOKeGfyfz1shB+brKXWkdmxPMEDBxYW89csNPVCoV1PthYjwtYy2r63UwXZPKyRsOq RNf0KUibVULMwXgV6D5M50hqewZj3PwxFT4f3+s9HgXvn4/SifeMHrCL6PY4NGCg//Ti T2jlnwgY7QmeeSqDVF8f2prhC6nIT5JnaPVNmxzBk171Rl4bQ7AzKvnwycDcAcNSfk9v on4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw5-20020a056a00450500b006870b9bddbdsi2973393pfb.62.2023.07.29.07.12.16; Sat, 29 Jul 2023 07:12:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbjG2N4L (ORCPT + 99 others); Sat, 29 Jul 2023 09:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231518AbjG2N4G (ORCPT ); Sat, 29 Jul 2023 09:56:06 -0400 Received: from p3plsmtpa09-04.prod.phx3.secureserver.net (p3plsmtpa09-04.prod.phx3.secureserver.net [173.201.193.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1783326B8 for ; Sat, 29 Jul 2023 06:55:58 -0700 (PDT) Received: from localhost ([82.27.99.45]) by :SMTPAUTH: with ESMTPA id PkO5qj0LwPVHGPkO6qd5ER; Sat, 29 Jul 2023 06:53:43 -0700 X-CMAE-Analysis: v=2.4 cv=NMoTuW2g c=1 sm=1 tr=0 ts=64c519e7 a=YwMIiW7BGddQzL8MrqPWMg==:117 a=YwMIiW7BGddQzL8MrqPWMg==:17 a=j-LfP5YGAAAA:8 a=GEFmKsjkgO09kH4bplAA:9 a=pci6KG57UX3UzFLC8IW4:22 X-SECURESERVER-ACCT: atomlin@atomlin.com From: Aaron Tomlin To: linux-kernel@vger.kernel.org Cc: tj@kernel.org, jiangshanlai@gmail.com, peterz@infradead.org Subject: [RFC PATCH 2/2] workqueue: Simplify current_is_workqueue_rescuer() Date: Sat, 29 Jul 2023 14:53:34 +0100 Message-Id: <20230729135334.566138-3-atomlin@atomlin.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230729135334.566138-1-atomlin@atomlin.com> References: <20230729135334.566138-1-atomlin@atomlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfMj1Olg5iWlv2paV4ar06WTogbgtL9xU/Az9oJG7AVchwkVuVW2WBWJP09XjCVFhic7Fv3YhWnelxsQj1MlKmN/KW2AB3MI5DUbS8ocNd0UTPKd/QeXW GZLrbuUWyITNru6NzmZR7IrawBOCh0oWOiMGwXC1dyNg/8FlupqzJI0MyZtKxVWRkPSMMG7B/rJA1lrFX/xojAgIXT+XVCQjF3bn0bkNHbruoyrFG/6inY2o CgsGUc28O+WfUEBFLO4kCRZa50rD2pqVjI4uTQuL2RQ= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional change. This patch simplifies current_is_workqueue_rescuer() due to the addition of PF_WQ_RESCUE_WORKER. Signed-off-by: Aaron Tomlin --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6d38d714b72b..3b7a4d60cb6a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4890,9 +4890,9 @@ EXPORT_SYMBOL(current_work); */ bool current_is_workqueue_rescuer(void) { - struct worker *worker = current_wq_worker(); - - return worker && worker->rescue_wq; + if (in_task() && (current->flags & PF_WQ_RESCUE_WORKER)) + return true; + return false; } /** -- 2.39.1