From patchwork Sat Jan 9 02:05:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 360425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC292C433E6 for ; Sat, 9 Jan 2021 02:07:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A41E423AA3 for ; Sat, 9 Jan 2021 02:07:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbhAICHG (ORCPT ); Fri, 8 Jan 2021 21:07:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:41602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbhAICHF (ORCPT ); Fri, 8 Jan 2021 21:07:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A50BA23AAC; Sat, 9 Jan 2021 02:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610157957; bh=Fzo/QSm35F0Z7LELOpY7VgizteZ3qNLeNfRMdCSQd0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnLp8klBGeRrcBUdXeUNkxoySoLM9jFuUgz4No1rubfYcuQE+O6x7CTwUKL5IddD0 CCS5ncNzXNfERbKR9ClrKbfWIP3wx5G/vTaNQTNt2lugxkHBZrFIhea3doEvOA3WVH HsR5920fqt6Ks+RAGRXJ4A67/mh3fiQfjgIxC+H2v6JWVpVp605nUt+YrmBOUnzC4F 6/G0N64MKOa4yLHnsjGiMmr18faEjsr4kz4Yp/lU4l0pa4datekO+z6I8pHaiBhuFF vY95wYvTlmU0bPlMXoiyKWm0naa61Q63MIZBSH+fhkCLV00l6rThL4yjJyZ91WDEOm QXUkO6LzHlJWg== From: Frederic Weisbecker To: Peter Zijlstra , "Paul E . McKenney" Cc: LKML , Frederic Weisbecker , "Rafael J . Wysocki" , Ingo Molnar , Thomas Gleixner , stable@vger.kernel.org Subject: [RFC PATCH 7/8] entry: Report local wake up on resched blind zone while resuming to user Date: Sat, 9 Jan 2021 03:05:35 +0100 Message-Id: <20210109020536.127953-8-frederic@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210109020536.127953-1-frederic@kernel.org> References: <20210109020536.127953-1-frederic@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The last rescheduling opportunity while resuming to user is in exit_to_user_mode_loop(). This means that any wake up performed on the local runqueue after this point is going to have its rescheduling silently ignored. Perform sanity checks to report these situations. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Paul E. McKenney Cc: Rafael J. Wysocki Reported-by: kernel test robot --- kernel/entry/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/entry/common.c b/kernel/entry/common.c index 8f3292b5f9b7..1dfb97762336 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "common.h" @@ -23,6 +24,8 @@ static __always_inline void __enter_from_user_mode(struct pt_regs *regs) instrumentation_begin(); trace_hardirqs_off_finish(); instrumentation_end(); + + sched_resched_local_allow(); } void noinstr enter_from_user_mode(struct pt_regs *regs) @@ -206,6 +209,7 @@ static void exit_to_user_mode_prepare(struct pt_regs *regs) if (unlikely(ti_work & EXIT_TO_USER_MODE_WORK)) ti_work = exit_to_user_mode_loop(regs, ti_work); + sched_resched_local_forbid(); arch_exit_to_user_mode_prepare(regs, ti_work); /* Ensure that the address limit is intact and no locks are held */