Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9132513pxu; Mon, 28 Dec 2020 07:25:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDkDWSHGH0YM5Zy8yJ3/nISK3Dh96dkrno1EN3tjUoIUD6YU4FhOS3ygnG0SzHuuNzf+5r X-Received: by 2002:aa7:cf85:: with SMTP id z5mr42958590edx.274.1609169130566; Mon, 28 Dec 2020 07:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169130; cv=none; d=google.com; s=arc-20160816; b=Cg9qNDNR45EamXhFPybHmTLIY0Y2DDUS1PVVWWc1J5Hf5Bbz+n4zUU9aoetnSudsVj noSUvuhDt4oC+beQ9h3A1IKZ2zf/d6kzWD2AQOrrkNX5HK0hTPA/BshV9CcWVs0E3MHB Hc11j0w+wg19ZCUV4pgmij+eBTb5/iJVzW9Z5EYAGjmJGu+unT7VWlnmve2jsPtAgutn FEw1gnUSUbjU/97iWyqEghNd/PJS72Fh5k690yJRg8hTbhIVH4ogdS8DpedHTd2apXjj /jAUSsJpWgr50T1otMTYhk8qK1HWoUn+HREeADyh/g9xKofn+htrNPoucKRim6rXcEoW ApMA== 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=4SYDkqpYQ7IAZJ/VdUtwFl76VpVIHsPbM9ql9TNCvc0=; b=suAJsaReO1dQPq1eLAVZvYbs8LBxPvoMyavZS2AQL3piwPvhl1eZ6vZb488T4aKZUN xNiwnsLLmCRbC+k03NIUCa4tnZtWNtpVqOtoHEFI6eB55ce2GBqPSY79DCLGKU/0Ehrn 4AzDwEYaRBG3le17wsd57zfHizUPcjW2BlGbNAuAoLS8oUG5aGh3D7qY/xn1ICVKxg0X nOibTtbPPXA8Cf9Uv0HMvfKP6hxDDXcCUVWEEASskFebQa+32hscJUKrIUgcUcGZ1HaF 1jkzPSjvoMUyTSlmAmRCjrSq/GMHQl3vdW4Rq7SmaguMO+m38Ms6yRoNWUrgFixbzqWE ChwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ncZEe4Ku; 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 d27si18439174ejc.384.2020.12.28.07.25.06; Mon, 28 Dec 2020 07:25:30 -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=ncZEe4Ku; 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 S2436629AbgL1OBc (ORCPT + 99 others); Mon, 28 Dec 2020 09:01:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:33656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436538AbgL1OAg (ORCPT ); Mon, 28 Dec 2020 09:00:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94E2C20715; Mon, 28 Dec 2020 14:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164021; bh=a3bmUpkIJY4ziHeV3D2/Usl0wfBHv0En6+1l4wLJAHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ncZEe4Ku1zOKA8mlCa61YhVRjpUHt6jPspa87y6ibZQD7juPHBVi153n6VaroAiWu Ve1sgO5tJY1WAShyyc5/xHrybLc6I8go2F8Deh4VZoVRthWGahPzMhL+VRATxsLJy0 D/V+LqBH94I6VfYemy2hNtCnbzuN4lPfOEe09sCQ= 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 5.10 032/717] sched: Reenable interrupts in do_sched_yield() Date: Mon, 28 Dec 2020 13:40:30 +0100 Message-Id: <20201228125022.527728564@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 e7e453492cffc..77aa0e788b9b7 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6100,12 +6100,8 @@ static void do_sched_yield(void) 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