Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1363096pxb; Fri, 1 Oct 2021 09:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVo1JDBcCFe1htpMYxPrm02onpBpkRdpyQku2V3KClfnMh86PqSlqdn+Un9BHZIKea6FTV X-Received: by 2002:a05:6512:b14:: with SMTP id w20mr6199755lfu.570.1633104325425; Fri, 01 Oct 2021 09:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633104325; cv=none; d=google.com; s=arc-20160816; b=Vq4DK4QEnQB7RQeYSFEW4xwB3D+smXY89LqBZOPbz9cGReRVRLE5heF1WNB2ZpeJqw /cUAfu6s/QZcaZJgnSdvif2rLgyBF/okEy5TdFNt94pZIU3Xo9iUL03dH/ITnoeJ8Y6T JAh6PkJN7sTtFEN1Om6bRpH0zRosBRMBAHAZQFyWY0eFe5H00IrJ5oMPmskVJBXgJw2+ PF56FRHCi2fS1/XfZpIR5T4alizwHIBf8tTVjlwc5tq5NDvdBJ0+PeZSSeg/1vDypYL+ FhK1L1HMtjqs1biIRldRXt1sjJhd/PXBhL7nWcNFH931HWWWwJgxtkR/QlEh9f6JilTc KIxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=8fqwxnzpBpUMQmoHLbPiAek+Iahlpht2tcL4eSGmVbk=; b=Kcc7dU9TUGAQplxH0t1GGEU02k9h3uGELRUmD4eF8JL2pWplcpC4WFb4NPzQwRAi+M WWkrI7eWwid0WHspTyUXMHnbXzXsK2lUw3cVgxQfp5aBTmmrKnQssLST5VvU0/+G51Tr 8HALH7dircmCO0iWpe98g6T+VQzoMx7aEqWZe1Xu2Cnxlq+764WM/pdtYoHYc4C7a5Z3 M/nltgp67xCXSpRwQjH85ZJOjwunZZE0EvCZsNpeIp7g2htH1xUN3KwnsA17dbfrDTfz 7/w26PEJjMTRYgdW21j+f8BhuZCAW9g9TnFeJJeRTnKyZXHnFOWrrZ8qmYtRVP5eMmVG 81hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4BhKNgQn; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si9363396edm.263.2021.10.01.09.04.58; Fri, 01 Oct 2021 09:05:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4BhKNgQn; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354810AbhJAPHt (ORCPT + 99 others); Fri, 1 Oct 2021 11:07:49 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58060 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354855AbhJAPHf (ORCPT ); Fri, 1 Oct 2021 11:07:35 -0400 Date: Fri, 01 Oct 2021 15:05:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1633100750; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8fqwxnzpBpUMQmoHLbPiAek+Iahlpht2tcL4eSGmVbk=; b=4BhKNgQn9s13tqotKK4V2RUz1lUMZOFrMwPL5M02OVUjgP4I/4elSTT6o1XR55ILGWuubw ywwtbmypDEligXF6cs9ZK+AkFXMF8sEnmvcFSdXpxQ+me9saFm5eEQPf2gshEcJkgjWYXX MA/D7H8pVQmMopu/Gax8g/06YyrZJNDvNsF6h4WlReFwoSbMEWQ/SvGOYMO7yHjuS1vEsd /Q2DwEQ19OKWxgWW6ob2n4C/qhX3pahTaew7488CrBUWJS2SbBd8nb5kj2WJcHdt4FhbsW jmrDtq9NRUlzLuJZZb9WBrFwJuBXa+PaqwWHu6W87gCbdw4Grm01pmxTvfpURw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1633100750; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8fqwxnzpBpUMQmoHLbPiAek+Iahlpht2tcL4eSGmVbk=; b=LcIECGtkc9fsU8qraLD22RVKPqSPZ2TSldKUz44RxnsZP7MD8liM0y3GOvpkcjDlZXJ2y8 MEnibcAxUBvvdzCQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Remove pointless preemption disable in sched_submit_work() Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Lai Jiangshan , Jens Axboe , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <8735pnafj7.ffs@tglx> References: <8735pnafj7.ffs@tglx> MIME-Version: 1.0 Message-ID: <163310074937.25758.2495577289305556588.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 579df3f2325191322b96906a5898462253a45ede Gitweb: https://git.kernel.org/tip/579df3f2325191322b96906a5898462253a45ede Author: Thomas Gleixner AuthorDate: Wed, 29 Sep 2021 11:37:32 +02:00 Committer: Peter Zijlstra CommitterDate: Fri, 01 Oct 2021 13:58:07 +02:00 sched: Remove pointless preemption disable in sched_submit_work() Neither wq_worker_sleeping() nor io_wq_worker_sleeping() require to be invoked with preemption disabled: - The worker flag checks operations only need to be serialized against the worker thread itself. - The accounting and worker pool operations are serialized with locks. which means that disabling preemption has neither a reason nor a value. Remove it and update the stale comment. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Lai Jiangshan Reviewed-by: Jens Axboe Link: https://lkml.kernel.org/r/8735pnafj7.ffs@tglx --- kernel/sched/core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8e49b17..d469c7b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6097,20 +6097,14 @@ static inline void sched_submit_work(struct task_struct *tsk) task_flags = tsk->flags; /* - * If a worker went to sleep, notify and ask workqueue whether - * it wants to wake up a task to maintain concurrency. - * As this function is called inside the schedule() context, - * we disable preemption to avoid it calling schedule() again - * in the possible wakeup of a kworker and because wq_worker_sleeping() - * requires it. + * If a worker goes to sleep, notify and ask workqueue whether it + * wants to wake up a task to maintain concurrency. */ if (task_flags & (PF_WQ_WORKER | PF_IO_WORKER)) { - preempt_disable(); if (task_flags & PF_WQ_WORKER) wq_worker_sleeping(tsk); else io_wq_worker_sleeping(tsk); - preempt_enable_no_resched(); } if (tsk_is_pi_blocked(tsk))