Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2740970ybz; Sun, 19 Apr 2020 08:33:53 -0700 (PDT) X-Google-Smtp-Source: APiQypLnKidoQRi0jbrD181o4ElEKerDoPWhnk571FuHBXz1hrJ1lJpo4259LhrY/G8VAyhhsjZp X-Received: by 2002:a05:6402:290:: with SMTP id l16mr10102960edv.207.1587310432952; Sun, 19 Apr 2020 08:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587310432; cv=none; d=google.com; s=arc-20160816; b=hRPjeSBf+qeDEVb2DL//f/pJI2yO2jV/ikbADQT7XOb062QkfAJCK9eCksdoPXTjZy zhqpXxjK0/yQ1q7ewI3SjvDDLmlnR77pfjEl02hf2aldU8GmP9G4sIal08qAGzBhHvqz /JdXaaNhyysOYJBUh4ha0pjr9n4A9gEwch/vQBB+geX3NqIT3/qbWM8FrQSBFUFpkYw9 T5SO0fouewJqOgY2y/kEH08b4Q8bHijNmcUQ0KZ2Bom7BZ3wiiHCFgo0K/ahsKKN028h W0TuyV7QrwDgjaFtobKDYZBTVxjAeYaJ991XruOSiO+mOBN1tCA1HuoQHioITEIUJjBM L6wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=azedkZ7sHyccnMqTcjQA1pZkShaS659fQJ50ILayAM0=; b=qG8WBi3cfzXoj+ptE72wNud4vYAEwrDwBID0lyy5F2xledZ+SxvxO38cMU3t6ge0/q JtOxFFRHA/+VVp/L2bsEJtA9PCTTQureVJbSIBdvcqteIGIW1RRBOc7ohZdmayVwDIrv S1zgnhlpD/bChQzxBkGE2ROFqknbXmxL0Zw4zOpbLdp9wVAbHBOriKNWgnX9jk/AukmD iZ+CFZjiROsYzxSL9KJ32G6+9CelOyqubdTWiscPzQ/5JWOwrs/qz+26zr7YnL/jXBVL jqoW3+INH2i5RnW7tQuIHQA+FLdttsAG8qAmdx9CxtOztcV5+im/Z1wZR8wTCqE0F1tn gIGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rIQEWnih; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si2020575edo.526.2020.04.19.08.33.28; Sun, 19 Apr 2020 08:33:52 -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=@gmail.com header.s=20161025 header.b=rIQEWnih; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726287AbgDSPbr (ORCPT + 99 others); Sun, 19 Apr 2020 11:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbgDSPbr (ORCPT ); Sun, 19 Apr 2020 11:31:47 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF6DC061A0C for ; Sun, 19 Apr 2020 08:31:44 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id n143so1129469qkn.8 for ; Sun, 19 Apr 2020 08:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=azedkZ7sHyccnMqTcjQA1pZkShaS659fQJ50ILayAM0=; b=rIQEWnihbCVEPOKaGMKozAq626/D428rig9I/e5lhsRwS89p0uEhcaU/bmmjw2edFY s8CzSRXxOBMZQxhGujejd1CpO6y4A1p625mO8QXoi1wFnJV18nufi5rGbRLuvhQeE3KM 1iIWQYq546HtuHvf24A69a2VI/TboV37MD38XsNklTUFnS2rJVMtdD3twhjiKokrV9pj za91okqDVBGfvjjiaa6siGuxyF8KRzFuCO+FyFUlyVUYUiXhPnex6xBzMcP64IwZ3N0r 1Nq6uABZqek7cxBBzKjGPqvoDc87GBIzlx956n3uM2C5feBmbyspb/YOR2d6xVqjxzgk TE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=azedkZ7sHyccnMqTcjQA1pZkShaS659fQJ50ILayAM0=; b=rMcfNmwq0tLkA3O+zpieUAxzYHDuugmTgKd7HoxPHEnznIMlmYlQU8onuIx02pwN/h v5wzOkABjUSlVOcmwJg7h5m4zB68XII0sJcPVb2jRFHDMSSu3ROJGg/HGlu3LDUjvPqC Cx/9lqHy5DKtG7c2GWVo/hAFJpQtJ4RZ4fA8/R/qstgk8IjE32bhDG/zs+AyhlqB2PCF HBCQIAzVP9so+KJHRfCJLPyTGd1cRQ1smrfW0XcWcZflNMcz5kEYL12a3xxrX4Kjwu0+ pYnLD2uiGUI4+oUpCQ7GP2QaaQ3FRWnS2oMHY1Gz+v5yxfUztgyX3aBxW3ikE03nSA2p DB4A== X-Gm-Message-State: AGi0PuaDTp2RQihj3dKRxNpNxPSjExxiRJisYTe9NhwnDMzELM38Y4im qfWVZxiPeo7Xv99Y9bey6LCeRPrIM6ozWhAin74= X-Received: by 2002:a05:620a:81b:: with SMTP id s27mr12268158qks.351.1587310302828; Sun, 19 Apr 2020 08:31:42 -0700 (PDT) MIME-Version: 1.0 References: <20200416033804.GA5712@HP-G1> <20200417111805.GA20730@hirez.programming.kicks-ass.net> In-Reply-To: <20200417111805.GA20730@hirez.programming.kicks-ass.net> From: Chen Yu Date: Sun, 19 Apr 2020 23:31:31 +0800 Message-ID: Subject: Re: [RFC PATCH 07/13] sched: Add core wide task selection and scheduling. To: Peter Zijlstra Cc: vpillai , Nishanth Aravamudan , Julien Desfossez , Tim Chen , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux Kernel Mailing List , fweisbec@gmail.com, Kees Cook , Greg Kerr , Phil Auld , Aaron Lu , Aubrey Li , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , Joel Fernandes , joel@joelfernandes.org, Aaron Lu , Long Cui Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 17, 2020 at 7:18 PM Peter Zijlstra wrote: > > On Thu, Apr 16, 2020 at 11:39:05AM +0800, Chen Yu wrote: > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index 02495d44870f..ef101a3ef583 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -4477,9 +4477,14 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) > > return next; > > } > > > > - prev->sched_class->put_prev_task(rq, prev); > > - if (!rq->nr_running) > > - newidle_balance(rq, rf); > > + > > +#ifdef CONFIG_SMP > > + for_class_range(class, prev->sched_class, &idle_sched_class) { > > + if (class->balance(rq, prev, rf)) > > + break; > > + } > > +#endif > > + put_prev_task(rq, prev); > > > > smt_mask = cpu_smt_mask(cpu); > > Instead of duplicating that, how about you put the existing copy in a > function to share? finish_prev_task() perhaps? > > Also, can you please make newidle_balance() static again; I forgot doing > that in 6e2df0581f56, which would've made you notice this sooner I > suppose. Okay, I'll do that, Thanks, Chenyu