Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3771826yba; Tue, 23 Apr 2019 09:20:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOG32F6y0O7a7JUuwYJSZ0MPP73PkVV+2tfN2sfdC51kD++Zvo9kJTqGc5CZig9iL9nz2X X-Received: by 2002:a17:902:b70c:: with SMTP id d12mr18211854pls.178.1556036422226; Tue, 23 Apr 2019 09:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556036422; cv=none; d=google.com; s=arc-20160816; b=MwE14uxjvK4Pf7GMgSE/6aBBUkmFXvhm3wqqozDBQEHqJ5C67xwBMLkXz32DxiCaSX 1TPrirl0mQWrR4OslV3qx4tLSqRzPLH/zawpwvo1d9EmapiCqYaerDo6qNU+Tu8cnCxJ mpI9N6SfTVV5A+3xmbguwAfIbqplXNKhRmoxe/5qe5keI6Wvc/SkTaBIv3d/YfIb4UuG 19WZTH7pWfTcolC4HsxJ7hHn6fqU31z9DBti3gq09VhL/04/fWlIoF9mXkvM7+YSYLRZ l+KmsG8xUABJK/6fDH/Wo/rWNxk7c3f5yHdMBua24Nci2OObETnHUUIM9XN4cXwxzpQD bjGA== 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=gF03tPu44e7kldOb1nXs+YXmafLRpdS0s/ocQ3uC+Ys=; b=E/dsenbUUDZ1v/OqWSrutOPJMQnO27KZiav09oGsDENxXfH9BXEKJhVe2r8xUjE5US KBR0oTcxi7NzxYCG3HAeuFdR03PKa1ZG6WwNfMwwsQw5Ysq7XVkwxiA64Ey0yNt+KTQV 4mwXxpMu0HBny8CE65ns0rlcC2z+wULsUfkxZu0YHdIyOXfrBl65UCed+EbMYNwz8Ym0 ftOEK6IuZmNt5Fkmwu+LZZ6z1f0abIRWlbM6YOfsE8cNa+Xm/mMnhJehxgpoEKZaf7FW TYWuEpeKKXI1VKRrkVT3LOvfyGY1qiYS4Og9uM99pQyqLbIpaKEc8h8fwT2iJcYEzDUk msKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=gAJNovF6; 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 h13si15368952pgh.57.2019.04.23.09.20.06; Tue, 23 Apr 2019 09:20:22 -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=gAJNovF6; 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 S1728759AbfDWQS6 (ORCPT + 99 others); Tue, 23 Apr 2019 12:18:58 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34377 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728693AbfDWQSz (ORCPT ); Tue, 23 Apr 2019 12:18:55 -0400 Received: by mail-io1-f68.google.com with SMTP id n11so13073871ioh.1 for ; Tue, 23 Apr 2019 09:18:55 -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=gF03tPu44e7kldOb1nXs+YXmafLRpdS0s/ocQ3uC+Ys=; b=gAJNovF6M+Betf51nwMmAUiheUbHJJfItrRh7I9mix91Y2QA+l4djmnTQPo8w9kXqf yt2pmhHreL5OBL/ZfXFZJS/T9A+yBZI23le1m9QSIOpZDHXeaSVYALJNuqB2+AxiD2nM rPxA8Wh5VfherT1z+ZqdMG5aSHRFwq2Nir8xc= 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=gF03tPu44e7kldOb1nXs+YXmafLRpdS0s/ocQ3uC+Ys=; b=LkgVq/GVwQh3GZFVEKAKVsbA7HyQpDvYZRk/X1TbQ3QLMk3QFvZFb01V91eAM7/zO5 /ufW+vhWrlGVfk6D0waWDwP2WncVr/IjqwZ9Sc284Hz1VbqQ2R+7qqpHn4dsq1Dzj8He /PZpoRjb+LVzXbRZgi39uQAV3rsQDuMgMLRJMw/dK3V7+OuHarJuIdcKiEORDiEptypx fj+5KenTmsqK9HvuTiPHoLqK4tXzTcoQYDxpvFHpfvfoaXKX4S6o1P2VKcxIVud9hr2s Sco9NcL93d3kvnoXHrU/atPTDxMl1cEO011jKE2Hg7upZQs/e1Yy/HvjT6Rqfb71DBVF utKA== X-Gm-Message-State: APjAAAWbj1oT5v9d9XDJDHlmDwePeCYGYGNFT8Ema2DyiYkP7MkxOuYp TqgRELlXHyIdVp0Eu+Oiqn8iZQ== X-Received: by 2002:a5d:9cd5:: with SMTP id w21mr1494316iow.298.1556036335053; Tue, 23 Apr 2019 09:18:55 -0700 (PDT) Received: from swap-tester ([178.128.225.14]) by smtp.gmail.com with ESMTPSA id e8sm7672894itc.23.2019.04.23.09.18.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 09:18:54 -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: 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 14/17] sched/fair: Add a few assertions Date: Tue, 23 Apr 2019 16:18:19 +0000 Message-Id: <61e1213f85d1087d9b7a28e207223df29930432d.1556025155.git.vpillai@digitalocean.com> 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 From: Peter Zijlstra (Intel) Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 45d86b862750..08812fe7e1d3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6209,6 +6209,11 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) struct sched_domain *sd; int i, recent_used_cpu; + /* + * per-cpu select_idle_mask usage + */ + lockdep_assert_irqs_disabled(); + if (available_idle_cpu(target)) return target; @@ -6636,8 +6641,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) * certain conditions an idle sibling CPU if the domain has SD_WAKE_AFFINE set. * * Returns the target CPU number. - * - * preempt must be disabled. */ static int select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags) @@ -6648,6 +6651,11 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f int want_affine = 0; int sync = (wake_flags & WF_SYNC) && !(current->flags & PF_EXITING); + /* + * required for stable ->cpus_allowed + */ + lockdep_assert_held(&p->pi_lock); + if (sd_flag & SD_BALANCE_WAKE) { record_wakee(p); -- 2.17.1