From patchwork Tue Jan 10 11:14:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhe X-Patchwork-Id: 41414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2697392wrt; Tue, 10 Jan 2023 03:47:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvpw/ziZnYSGxi2s++cOlZf52HwLHFuYT7mCZm1u4qhC4r35YKdRpTxWZtIlUIOfS5e5XV X-Received: by 2002:a05:6402:2497:b0:48e:b020:6c14 with SMTP id q23-20020a056402249700b0048eb0206c14mr32603878eda.26.1673351234271; Tue, 10 Jan 2023 03:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673351234; cv=none; d=google.com; s=arc-20160816; b=lG6O3jqZGQfEvZDLk80hpz4/rTfXg0mghTzxtU7ZsJkOLpttTdmPACxtbb7OdUuiNb F/etvEFN8fN7lBs/tYOLenpvmb+X2z7gY1Ik7PS/A6Op6+XCLm1YzfqMQg+TCdEPNPRj /cbkY4MRPJt2ftxFhxaRiZ3IXp8zycxpTWKgAvFrcw4hESKzbFX/aRkR+I3SbkEBQ7tx 5BGL4Lckk+X3AmgcCG8n68WEW5v0PpF1D2moC2kMCwF+DAf4nQhhJzqXV6sJNMYl4cs8 fZRqS0QUZ92DlIj5hyD326CkaLQ5wPiQZlHgFz/OsoujoRHb+PZL6e9JTQqtyeKDoIhx ahZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=uypHTRqIWHEuGCn4N8mdtJ44b2Q/Vg4/vbE4Vrge/BA=; b=pOxt7IN0mnhxgiCgbcI0aDkYGBxTYe0kMIZEQ4b9r+AhstalMefX62l2ehSTEbXC/h Bj7hRIZ7/z58fRhCfmMvrd0eJEKmje4KtmlpQm10I5NIU/IIRubQJwy2dvkQtARs+Rkf VydOks3x13uxVXC1xQ6qRC/VHgGQKWC4VUfisGYXHg7pwvcAd1ZVY+q5ygsI02swX9QO n0e2NPsZM2f026S7tzx8CQ0RiAXOmp2fwLh21WJsjO/DplMZp/yp8ZAuGoR/qzbYCEVg ssjIkAMdobqoo1jjDPhRmTu5GkEFo3VRHVKmewQySjCB159bn+YleYzV41iE/ScOrdjh bq/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=YyAeY4tf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc42-20020a1709071c2a00b007c1052c9243si593739ejc.15.2023.01.10.03.46.51; Tue, 10 Jan 2023 03:47:14 -0800 (PST) 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; dkim=pass header.i=@163.com header.s=s110527 header.b=YyAeY4tf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232076AbjAJLR6 (ORCPT + 99 others); Tue, 10 Jan 2023 06:17:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232812AbjAJLRs (ORCPT ); Tue, 10 Jan 2023 06:17:48 -0500 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4CD121B5; Tue, 10 Jan 2023 03:17:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=uypHTRqIWHEuGCn4N8 mdtJ44b2Q/Vg4/vbE4Vrge/BA=; b=YyAeY4tfim19XSymdWmVRPVMcNiyIkV8eo yL85/D+w1FlgN61dqVyZc26aZrknh+BSTN1WtdboYPT6OSBxZDd/pB7yYhjYQkmD OrAW6KJRlQ3Ca6xqNB1dbiUV8hYbw1f6OCUh+9VVMqTAeQ7bNBkbnHQJg8zB6c8u F6dLSLK5U= Received: from localhost.localdomain (unknown [114.107.205.23]) by zwqz-smtp-mta-g2-3 (Coremail) with SMTP id _____wAXDXqHSL1ji3RdAA--.41461S4; Tue, 10 Jan 2023 19:14:50 +0800 (CST) From: Lizhe To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, bigeasy@linutronix.de, imagedong@tencent.com, kuniyu@amazon.com, petrm@nvidia.com, weiwan@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhe Subject: [PATCH v2] net/core.c : remove redundant state settings after waking up Date: Tue, 10 Jan 2023 03:14:13 -0800 Message-Id: <20230110111413.3747-1-sensor1010@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wAXDXqHSL1ji3RdAA--.41461S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7JF4ruryDJr45GF48tF18Xwb_yoW3WrbE9a yvyF48Zr18ZF1Uur15C3y5Jry0grs5AFn7Xw42yFW8J345GFyDZ3s5Wr9rJr4fW39xZr15 ua9xXF4YkrWa9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRKpnQ7UUUUU== X-Originating-IP: [114.107.205.23] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBohDyq1aEHG08twAAsD X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754635944062091135?= X-GMAIL-MSGID: =?utf-8?q?1754635944062091135?= when schedule() returns, the current state is TASK_RUNNING, no need to set its status to TASK_INTERRUPTIBLE, and after jumping out of the wile loop, its status will be set to TASK_RUNNING, so, set_current_state(TASK_INTERRUPTIBLE) is redundant Signed-off-by: Lizhe --- net/core/dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index b76fb37b381e..4bd2d4b954c9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6580,7 +6580,6 @@ static int napi_thread_wait(struct napi_struct *napi) schedule(); /* woken being true indicates this thread owns this napi. */ woken = true; - set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING);