From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 88648C4321E for ; Fri, 7 Sep 2018 21:46:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3966E206BB for ; Fri, 7 Sep 2018 21:46:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="rO09Vwjr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3966E206BB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731236AbeIHC3R (ORCPT ); Fri, 7 Sep 2018 22:29:17 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:31852 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730347AbeIHC3Q (ORCPT ); Fri, 7 Sep 2018 22:29:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1536356780; x=1567892780; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TSqWXNVHH4zS3Ac52N2pCU1qafIkJxXpnQ5R3q3Ee34=; b=rO09Vwjr+5HG0IE2HSBbREJXGbidJ6I33kHW+KxwNI3WaQYDc7JcRULl ePsmFbmUiyP1GAqQa/c04EvtFGcb/fiVzwUrnWm4k0yDfNmVYPhJZJD1q Tn+jEMFKYmroD0bnurHEQyFGcYeDAJB6Y5Npy6E62ow8ioVhxIIz1tl77 w=; X-IronPort-AV: E=Sophos;i="5.53,343,1531785600"; d="scan'208";a="757370700" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Sep 2018 21:43:45 +0000 Received: from u7588a65da6b65f.ant.amazon.com (iad7-ws-svc-lb50-vlan3.amazon.com [10.0.93.214]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w87LgKJa039246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 7 Sep 2018 21:42:22 GMT Received: from u7588a65da6b65f.ant.amazon.com (localhost [127.0.0.1]) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTPS id w87LgJU0027515 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Sep 2018 23:42:19 +0200 Received: (from jschoenh@localhost) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Submit) id w87LgIxX027511; Fri, 7 Sep 2018 23:42:18 +0200 From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= To: Ingo Molnar , Peter Zijlstra Cc: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= , linux-kernel@vger.kernel.org Subject: [RFC 33/60] cosched: Allow resched_curr() to be called for hierarchical runqueues Date: Fri, 7 Sep 2018 23:40:20 +0200 Message-Id: <20180907214047.26914-34-jschoenh@amazon.de> X-Mailer: git-send-email 2.9.3.1.gcba166c.dirty In-Reply-To: <20180907214047.26914-1-jschoenh@amazon.de> References: <20180907214047.26914-1-jschoenh@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function resched_curr() kicks the scheduler for a certain runqueue, assuming that the runqueue is already locked. If called for a hierarchical runqueue, the equivalent operation is to kick the leader. Unfortunately, we don't know whether we also hold the CPU runqueue lock at this point, which is needed for resched_curr() to work. Therefore, fall back to resched_cpu_locked() on higher levels. Signed-off-by: Jan H. Schönherr --- kernel/sched/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 337bae6fa836..c4358396f588 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -457,6 +457,11 @@ void resched_curr(struct rq *rq) lockdep_assert_held(&rq->lock); +#ifdef CONFIG_COSCHEDULING + if (rq->sdrq_data.level) + return resched_cpu_locked(rq->sdrq_data.leader); +#endif + if (test_tsk_need_resched(curr)) return; -- 2.9.3.1.gcba166c.dirty