Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2331221imm; Fri, 7 Sep 2018 14:48:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTAaFbZ+zpAz1t76zf8MrmTMZ2uuTK68CyUP8V0RE9ox0X0caA7grjw+9DP4SIDM7tSd5X X-Received: by 2002:a17:902:ac1:: with SMTP id 59-v6mr10118174plp.18.1536356926084; Fri, 07 Sep 2018 14:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356926; cv=none; d=google.com; s=arc-20160816; b=kGAp6FkiU0hrH/qqsRQOth9dd1I7CGuN7oU9zl+9BKvXhAIjSRpZxQGaLQG9J+y9ee 4dA+bVuVGvmJU9J1lny17ibOl4bbj7bbOsbw2sg+yr4xj7u72mn7l2ps4FJtSr/ldTe5 nsmNwQ0zwleobVr/O+jgTa7nNw3ZbV2puwS0WCNXcoIINk+cDA7a+8N9NyOxkqXjgKrm dN6KLzG06nD4rfk5kqkOrZkJ87fodFp+gBMJbpmKNqgKjnyNXe9/S7eHwq75ChZUG2uJ ULfoN/gYvzZlv5Vx/1YAPuLZMQYlIKdQgduuJIQ0RvF4B+vnfjRszybnwyC4/Aj9uL1P Xd7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TSqWXNVHH4zS3Ac52N2pCU1qafIkJxXpnQ5R3q3Ee34=; b=eFP5jwVbbCzmDqs5yz6X9iHppRj1i8GOxmcR9ZHWmFqO02qYBZIXFFa2XBUaIoi6jh UsrP99H4ZSBI41fz7gLKWTuRwJPo4UhOlLaFNZpWLUGPXcx3oibTCh9UCmrLR/J3mY3L KtZAOHqi1adP75rFW6VVjeTtlf9Xs4nOAJDNqDnHu+3G2cros58YT/oEsv4kykWjgumm uBWe4kamATWqVs4CVsEdyFZTGw9vMhKLfLkjKZJr5F+hXXW4XQ4Pxv5Hv8EqnOp/Wuyc vuRwR4fdkhGqY1Dgm/NK+qd4QdO0jL8vLXOr6cPUWgSyqLoF1aDG9kRMZquP2nvoZ2nJ 81vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=rO09Vwjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 139-v6si9579678pfb.45.2018.09.07.14.48.30; Fri, 07 Sep 2018 14:48:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=rO09Vwjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731233AbeIHC3R (ORCPT + 99 others); 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