Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3772233yba; Tue, 23 Apr 2019 09:20:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhAL35mWr/2EvVzkSLLQPuHtNxm6Am98mqLDJ3WBtfU/EgCgr/eE+K9F61DbY6DKS4U4rK X-Received: by 2002:aa7:96c6:: with SMTP id h6mr27059844pfq.239.1556036446058; Tue, 23 Apr 2019 09:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556036446; cv=none; d=google.com; s=arc-20160816; b=FutmNHgMp2Ds5FK9tPQZVEuvWoHbhtJNS6n1XoWxWw611OxsfV7jdL8MyJCTXQMB7y sElblhfWezrmCknGJ7qwpdtA50ec2bZgkniP6HxGV1Yf3xij8Uhz+PRGbEu4DHvCxhdj CHc7U1Geuq/nPdyVpaDBSIvVLqtqO+seZz5/iIl6nHciiLHNeVNV80szWt6mCFb6ULHI YkD77WLFwAiZK2Dymp7/E47yk2f+9uYXe66assGgOr8Jchgcr3yg80jJd82eBVbGtxVN K0q1O+CBMtr1CoO2ledF+6CJWRO6EQai2aMALy6JjfVm5CKqEbFCI+vpGvL7FbSjJehn kNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=fgeFoIILT4xE7cfwH2FoP4Bn5blNU711c0erOTBmHAw=; b=P8A5F5O7u50v0iTnn+JcDPQWJ8cNlJrdCsN53yi9SLXiVfK/6D8wkzh614XGe87KS0 ZTBZ48ZzTnH3erYnPkdMcymt3Svj/kFjw0woKiIxetEypnJo/X6+C0oFIP2FJ0QrcQ4n wXuGu7sjqCxW5LEdfunvbT1dBTeT+rjhzi4pXhOJ6RJMiKjBdRdCN+aMg1KdNMVw3Buc Z1mGEZpJlO/B9cINq7021aM6EZZ8HXv9tY78ZAR5lOq80a/KikiJCkGK0ToZC71xK1CP kCCVTaHkEIxWUeRDC5xPz4WsX0S8qRnXwkGPnOkcN1Qq7ASzWudlNNs6ZqStaKhcV0oB 8dfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=PQ3PhRYD; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f191si15093865pgc.570.2019.04.23.09.20.30; Tue, 23 Apr 2019 09:20: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=@digitalocean.com header.s=google header.b=PQ3PhRYD; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728799AbfDWQTN (ORCPT + 99 others); Tue, 23 Apr 2019 12:19:13 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:51776 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728712AbfDWQS6 (ORCPT ); Tue, 23 Apr 2019 12:18:58 -0400 Received: by mail-it1-f194.google.com with SMTP id s3so1150785itk.1 for ; Tue, 23 Apr 2019 09:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=fgeFoIILT4xE7cfwH2FoP4Bn5blNU711c0erOTBmHAw=; b=PQ3PhRYDGiKjNlIcEvNAHIJByNS4XlRIIKfqT8Qf//bFnrO9dYT90uQTI4ZQ1qceYX rlEOpILilLWrPRmWnIsbwBVbqyXFb2FpbGv+61KCNkTIfqpzAWJspnRPTj+ULyFBYl81 AzraqW0zPFRfNscbHnec65SHJqrvjBm3I5e/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=fgeFoIILT4xE7cfwH2FoP4Bn5blNU711c0erOTBmHAw=; b=kOWjRrrdsh6+sNOrvlIViyThA/zWrVu3yb9IF2Wb+hOeukzF1XTkP2+G9g+iMhLMPM wW28asuwLA3URnn7+OfNHoPp1YbHi15BX2UGc/5ocIvJ4UKyYtQjQHCCv1oLFRvYPRPZ 3bCaSB0tKFLViZmxFVP9qG5zDWcZhMX7BGDTnyhoZhNqh2ofa+VhxHTEtTmbLwWh6wAN cYO8F6RYNRgQWYeP27A5QXvXiwO7Sgb0+bEhLi7sQWoYQwE9MqMoVx2goJ3XLE0HwzsX yZzP94EpkPK3vZWwTa9F5V0k69RFb3G14eJ6H2+gbvqPY4IIY1a2PrpARtlyAIshDJjU gDHg== X-Gm-Message-State: APjAAAVRzYttAuV+ygRqaZ2A7ULPkD803t7bNwx0ZiSVEwqTDH1VOShu Kxwy4fFTgpTIKIAkLk8H21cd0Q== X-Received: by 2002:a24:a505:: with SMTP id k5mr2722258itf.160.1556036337159; Tue, 23 Apr 2019 09:18:57 -0700 (PDT) Received: from swap-tester ([178.128.225.14]) by smtp.gmail.com with ESMTPSA id x187sm7510452itb.39.2019.04.23.09.18.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 09:18:56 -0700 (PDT) From: Vineeth Remanan Pillai To: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org Cc: Vineeth Remanan Pillai , linux-kernel@vger.kernel.org, subhra.mazumdar@oracle.com, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: [RFC PATCH v2 16/17] sched: Wake up sibling if it has something to run Date: Tue, 23 Apr 2019 16:18:21 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During core scheduling, it can happen that the current rq selects a non-tagged process while the sibling might be idling even though it had something to run (because the sibling selected idle to match the tagged process in previous tag matching iteration). We need to wake up the sibling if such a situation arise. Signed-off-by: Vineeth Remanan Pillai Signed-off-by: Julien Desfossez --- kernel/sched/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e8f5ec641d0a..0e3c51a1b54a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3775,6 +3775,21 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) */ if (i == cpu && !rq->core->core_cookie && !p->core_cookie) { next = p; + rq->core_pick = NULL; + + /* + * If the sibling is idling, we might want to wake it + * so that it can check for any runnable tasks that did + * not get a chance to run due to previous task matching. + */ + for_each_cpu(j, smt_mask) { + struct rq *rq_j = cpu_rq(j); + rq_j->core_pick = NULL; + if (j != cpu && + is_idle_task(rq_j->curr) && rq_j->nr_running) { + resched_curr(rq_j); + } + } goto done; } -- 2.17.1