Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3848737pxu; Tue, 20 Oct 2020 01:58:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZLrCV8kJ7xD4tmyEIcYtfIeB2fW8zvfvPsewTESJvXOWOaZbsf/8EtFSrk4rcv36KUsJt X-Received: by 2002:a17:906:93ef:: with SMTP id yl15mr1937291ejb.529.1603184302061; Tue, 20 Oct 2020 01:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603184302; cv=none; d=google.com; s=arc-20160816; b=h+vM6MygDZPpNAYrfiSQTiHNVDBhlyWZu2j4KwjEu91hXKS4CVEjsjmPBdDoTpajKP 8ELgpeWF1FLUEQ+SmZnnzpTxhndNvK/sm3l9aLZ2+vy8W5u28BO9UCxX5sZmtS5UdPDL 8UA9+kB/9PWyJY6RxW1+OogVIB9FP4svAHwj26DDpKmrxXl9dHI8Yx0OnuBR1UIgjVrJ 1GZFHudWHUJO+sgxvk2RCEmDsEdkgLBabuxIM/UkfC1SMMqxv3cMtfNADyFYEdJwLwUb C/XNoBWizOD91uaWFL3k5RzApkycn8i2J6q0jTv2f2JrXam+3B8OhpjivbPYgcZ1JCao GHVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XAAkRNg7A/TYOfd7TzMRVi6CP7WYBCVGkA6DPvfq6rE=; b=Q1+7gN0TMkO7Gagofp7ijBU4lbNTddiBvmUDPCGvheZz4+yXMeSBtuFWzy9dH6ZSfA 9a02fjZeOMUPLvx/k9KtxjUWJRj4xI+zOmFHijwAeO4Px9a/8Edg9mE4oQm4Z4mCNV/+ 3Il2rmSRua69ZXIiacjNzHivIG2VAmSyuKYe8IPFyMFzOgqSO/LALHEgAWu9k/Y8TzK1 0kg/R8+8YtOS/a6FzJd8Mvc38Vq1U7qzSMN+MNFhzfWALwExWup1pYlKzj1VAHSnTHbb Q9apKo04Rom/YcBoLxJtoWxqkkJxlVu1TVbhbdLZSLDCJIoHwQJFRxzlIp/KVVkg87O1 8Q+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=ic2+GU9q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si878099ejy.288.2020.10.20.01.57.59; Tue, 20 Oct 2020 01:58:22 -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=@joelfernandes.org header.s=google header.b=ic2+GU9q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390146AbgJTBoB (ORCPT + 99 others); Mon, 19 Oct 2020 21:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgJTBn7 (ORCPT ); Mon, 19 Oct 2020 21:43:59 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3380BC0613CE for ; Mon, 19 Oct 2020 18:43:58 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id n5so299596ile.7 for ; Mon, 19 Oct 2020 18:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XAAkRNg7A/TYOfd7TzMRVi6CP7WYBCVGkA6DPvfq6rE=; b=ic2+GU9qCIr0q4tZ/OA7CdybQQTIEbZ367gA6JQaD7EYLvU+9CfP+BxV/63bVsNVD5 EK+HKnzTAhkjk1I75VTCo/xauPUjtShI9gnvk7zBsW4SlCbXkZTTSzdzcalAKuJLAgXL hTLGTpWv46yXBS43a5FgwJf/zWanC3ll4O33Y= 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:mime-version:content-transfer-encoding; bh=XAAkRNg7A/TYOfd7TzMRVi6CP7WYBCVGkA6DPvfq6rE=; b=tHC3gThtnHWH0WMnbvnFlxtEQ6YxqJ9RrxHqzqLlTv2rGnxDLgouvJ9y8AHe4DfVyr N0sZd8mXLjaqVIVDYey6WHY8IwnXuHb2wZHYdWQOtigNckzQkVTuKKNTbNdplrWNdAeU 2+e+c65wuotxhD+sdGrkvml1xeE74SxK2j0RcIlS+SU24XuKRqr2B++yCnxtJWYn6nEZ yi2gsxOMnd5hBDnrqOTeTdejkEj37ppW2inZhpGlQqjLQpg+YKui9JXc+lTZScNF7l7x xWCPVxxKwsleBHJk4QCXpggStD0m/zoMbkTYOTmM0uvQZ9Woo4GFL1qU+P4/jAwuE8VX 3eDQ== X-Gm-Message-State: AOAM530LjlytFy/tuE0c2MtT5WF4A1poLgxaH151PIzbva3Gw9GDiB2l 9BMtCOASqe3w45PswiCtlpxd7g== X-Received: by 2002:a92:cc92:: with SMTP id x18mr221058ilo.63.1603158237569; Mon, 19 Oct 2020 18:43:57 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id t22sm485306ili.9.2020.10.19.18.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 18:43:57 -0700 (PDT) From: "Joel Fernandes (Google)" To: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org Cc: mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , joel@joelfernandes.org, vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: [PATCH v8 -tip 04/26] sched/fair: Add a few assertions Date: Mon, 19 Oct 2020 21:43:14 -0400 Message-Id: <20201020014336.2076526-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201020014336.2076526-1-joel@joelfernandes.org> References: <20201020014336.2076526-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra Tested-by: Julien Desfossez 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 bd6aed63f5e3..b4bc82f46fe7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6228,6 +6228,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; @@ -6670,8 +6675,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) @@ -6682,6 +6685,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.29.0.rc1.297.gfa9743e501-goog