Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp75633ybt; Tue, 30 Jun 2020 15:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRq4Qdg1Q7D3v8jyNh/uRa08XKWj1nhqMXvq59Drt4a9jIPV7l2EzJyJVhdWbQgu9JEe89 X-Received: by 2002:a17:906:488b:: with SMTP id v11mr20973259ejq.173.1593554495770; Tue, 30 Jun 2020 15:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593554495; cv=none; d=google.com; s=arc-20160816; b=WTnwPrUP82srJ0UiTLaUm9Nv8MHt+VLXFHM+ErcU/3G1FLKDzp0htXds+AAAVUVaqi aZsV8p96/Up4PDzlvOrZyHf+hMs6FC2Es1d/PLE63JYFJOzUcZqWxGNV0nhPCORG45f5 CYJp+R6aj88DqNkIDtbidPZSvBh6EBTsKrZlXhukmhoTDPPR1h0uxes7UHpa2VcB26GO En60p3A41f6VowBqRr9scOT1jomWsEOdZ30hNFcQVHaPoUKQERNGfEn86gil7dAmKpnA 87uMVxI/S5/Di3xSbAFj9fehLYFyLTZzTQctGd4NHPOS0A3+jjRaqH4+CpOHGVcoi7ov Ck6g== 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=pxi/wyHIF44tvV/JLf/LlI24pXaiTE4ct5buGjr26HE=; b=GKKQRhq0EYLBoHQTt7gxATxPAYjjwF3gMS3rBjj2eZ37mDo0KQ9oNivZyFgVD4iYaE 2JfGjIgqP1PaDk/lGT8nnis2RSTeSYh3odGEQg73593EfNMA0KEP60YmqwRNEFYxSRWY uwACvshgBC+RCAEEtVH4QOO9MSiZkTfn4Ug28rdCKIN0CS77DhuE5RSGuUhZL3BnNT6e NjiltIBijz0Qw0Q8V7BPTyjcL2VwuhU5h2aoLeb0wwOmthzW5RrL50XazD6wK4nTr82u rasB1zLKkkeIP56fqf3OhZbFt9OhktD5/FbWmMzsF2fLU/3cCpzHp75ROnQo/DMQSTLP aJhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=DHEhOZRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g23si2435562edr.1.2020.06.30.15.01.13; Tue, 30 Jun 2020 15:01:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=DHEhOZRt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727790AbgF3VdL (ORCPT + 99 others); Tue, 30 Jun 2020 17:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbgF3VdI (ORCPT ); Tue, 30 Jun 2020 17:33:08 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3E3C03E97A for ; Tue, 30 Jun 2020 14:33:08 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id 35so9026522ple.0 for ; Tue, 30 Jun 2020 14:33:08 -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=pxi/wyHIF44tvV/JLf/LlI24pXaiTE4ct5buGjr26HE=; b=DHEhOZRtOJUlPHEUsd5Bciiqc96dD7FgHNGZsIYLbW6ZdYKz1XU22l4N4+L9JUVG6G nkjN2RFx1h3uM1PT+s/ZHxuvQovF6wQtUDga0qwgR3lGfHhFvrlzjtyDEfb2mJvRMhM5 hbzwkPiWEfFoMJY8S9AAUk0yarZqu2T4Snunw= 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=pxi/wyHIF44tvV/JLf/LlI24pXaiTE4ct5buGjr26HE=; b=ZN7o9+NYlmdAcJtSG1DSHWqCt50AlPFZ0Pgz1OA4Rs9mvaQ1B9N9nB8us3lkBwkrZf TMwW0zJF+QaZKWv9JtsyqGWGFOkWFFYucS1d2NV/qvXAmyGOS3bdbQ2xZMz+legxCuGK rgxagi+0wozMopOD56ljsF9Z5nGHiNkkc//RUwPJ3QWD1cmtmz4/YDhKuOn0ya1SDkTp Oq2okpGzWh7Pz5KqqfuHll/9YTx2cGMswIxxa8No+qUK4Ri8ruA8gb8hc5KRutBaaW/7 De3y1glOCnzoRgPC4hcI9BS0izCv7mBRMPDF5e2n7PSECmN+35Yp94Tl9r6F9sKDX1fj z98Q== X-Gm-Message-State: AOAM531Ee3/TVYQmuSH4Cfe5MygmtlLE6mHpzSRqq56B7m/mhWO9Dmn9 +fcUvRrVtW1CeNR5n3ylUoEEIQ== X-Received: by 2002:a17:902:8a82:: with SMTP id p2mr18549387plo.316.1593552786824; Tue, 30 Jun 2020 14:33:06 -0700 (PDT) Received: from vpillai-dev.sfo2.internal.digitalocean.com ([138.68.32.68]) by smtp.gmail.com with ESMTPSA id a68sm3180492pje.35.2020.06.30.14.33.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jun 2020 14:33:06 -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 , Joel Fernandes , joel@joelfernandes.org, vineethrp@gmail.com, Chen Yu , Christian Brauner Subject: [RFC PATCH 04/16] sched/fair: Add a few assertions Date: Tue, 30 Jun 2020 21:32:25 +0000 Message-Id: <8916c2d1121bb35ef0fe52fd050bf9705e673793.1593530334.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 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 5e9f11c8256f..e44a43b87975 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6203,6 +6203,11 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) } symmetric: + /* + * per-cpu select_idle_mask usage + */ + lockdep_assert_irqs_disabled(); + if (available_idle_cpu(target) || sched_idle_cpu(target)) return target; @@ -6644,8 +6649,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) @@ -6656,6 +6659,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