Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9176358pxu; Mon, 28 Dec 2020 08:28:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSnH+60XH4BFezbCidEV1DnvmKSgI6AxM1Kz/jPbYFUHe31eRcwwEEyuwWC1v9hs0mPoo2 X-Received: by 2002:a50:d757:: with SMTP id i23mr43102589edj.116.1609172930181; Mon, 28 Dec 2020 08:28:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172930; cv=none; d=google.com; s=arc-20160816; b=QZr9lmGhgittPzCLsednuR/37nCr+Ck1SvsgtDIztK36exHBLB3xhF/xr76ArukVoY /OqX/tH4p1lnP/N9ryN4vFbuJYKCNHLv7zUicslgci4zKwHiXIUcaeMdfXggAA+8eNWu 71GHa+F2xYk4mMdV/QopUbfzO6rMupsJtNFs0g/ssCs3eXd1cF+vr8vlWwVTImc0es/L 2Xaskj840NVHIM1Zt+ENogy+xzzdGZI4buSAqcFWEM3S4+kHkJYedNvC+RYfuBL1GmMK pCu2LRboqLSN7GG5wbQIQfecXlk9i6iiCoxwG0Nx6ytqrE6UwaTldwG8fVVWmPGo2r4j tMYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MM/Z1sU1+ArYdGQdSDvuSHS2bqZormc/Dq330t49hVc=; b=uigAizXJ/u4nGkW0fBgnaSjQrvsU50VD0qBk1c6vF2r4ILP9W/IFtVRCXCAk1EbpUE HhfwibuBAEoD8W2k+HtMR0OaX07jrr8ZihVD1594FfmAJITcWUQa9g2MOsO/jiWne3hE xJGUO+bYYVDxiXQWcTcGgAmYGhzngvfTVwTqB/nqvqz93+HB01XBWS+kbwzP7usCWckV 2s00yZ9y3yYJAYeOzz1fep55shBqPMrfnd+cuPADQHNUjhEJMT0g2tPUFdE2rZTJiOVW sKz9xwGTF8hJKPCQDap5ILVYG3TDDjaz7XrhC+LBbJKxhyX4ITlWefBFRHME6MHGTm/n FJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uKZwmCyS; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si20393917edx.538.2020.12.28.08.28.27; Mon, 28 Dec 2020 08:28:50 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=uKZwmCyS; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633097AbgL1QXO (ORCPT + 99 others); Mon, 28 Dec 2020 11:23:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:39772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731876AbgL1NLx (ORCPT ); Mon, 28 Dec 2020 08:11:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6B4C207C9; Mon, 28 Dec 2020 13:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161073; bh=CKvCff/TjX0Irjb1rYE0n5vX4aDYDAx0sSYOzQctXwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uKZwmCyS7D2I08kQ9lBvOc4mBCcKuKLT0IKxF++vI9+esT3odw75MV4CdVXPvYWF7 9DnT/x9oWrj4OUBMzhCVaVOLFnvIDGMhgZKW2UmQ5/2ECeRW9M3jNQWj7FoQvi8AOf ILbLz0Hg6716lhCi8BdjseZV+np6v+LVtyMI3zXM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 4.14 074/242] sched: Reenable interrupts in do_sched_yield() Date: Mon, 28 Dec 2020 13:47:59 +0100 Message-Id: <20201228124908.329826479@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner [ Upstream commit 345a957fcc95630bf5535d7668a59ed983eb49a7 ] do_sched_yield() invokes schedule() with interrupts disabled which is not allowed. This goes back to the pre git era to commit a6efb709806c ("[PATCH] irqlock patch 2.5.27-H6") in the history tree. Reenable interrupts and remove the misleading comment which "explains" it. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/87r1pt7y5c.fsf@nanos.tec.linutronix.de Signed-off-by: Sasha Levin --- kernel/sched/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c5599174e7450..7cedada731c1b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4826,12 +4826,8 @@ SYSCALL_DEFINE0(sched_yield) schedstat_inc(rq->yld_count); current->sched_class->yield_task(rq); - /* - * Since we are going to call schedule() anyway, there's - * no need to preempt or enable interrupts: - */ preempt_disable(); - rq_unlock(rq, &rf); + rq_unlock_irq(rq, &rf); sched_preempt_enable_no_resched(); schedule(); -- 2.27.0