Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp146310pxu; Wed, 25 Nov 2020 15:47:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRJKyCkIq9SjnucRLtNmDP402hoiWyzp8CatRXcnLql6F95kAbNz3KtT2EjHHN3gK734+r X-Received: by 2002:a17:906:e082:: with SMTP id gh2mr344095ejb.406.1606348022594; Wed, 25 Nov 2020 15:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606348022; cv=none; d=google.com; s=arc-20160816; b=hi107SEuKDKeS951IrxWXfNVkRxxPwsWnKViMg8RztMAQFzK4rvzAQmlrGtFBXKSmH CozQ8VbzuaaSyaNadJPRlJDjquE7DOelJu2wZPcQQFpe7rWqUNcDA+WAxLQl4OmJaciy CTIaVzgStBySz+dLMsceq/xe8XI7aVrYhIfCKixEyFPRGV05Luw/D1kAL6l0677K32rt 8TJ/n9/wyXJvHQEm1uKWvh9TzC06ZqoutmNaoyxm1ARpo61sKSqrVZPVaHDqNDqb+zBX UyFJ06K89VlOaSia1Q1JtAKn7I/BI+dz2R3WRjfZGjnk41g7kqvTstwPdQXsrwGfS9c/ 0FTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g64g7U4GAHaKj7z3gZ4urzrJeg/GRUrDZaN3e2rg/7I=; b=L36GSd0HX+JrKurnAIFDh6zmEQR5ixnYSWqUMNnqgDVvkBkgxwy3p3cAydzSTLfHU0 AXwYP1WWQyJxVNNkj9YkaZE4ZI0tLi1zqkBmB/5V61zeTBgzHJYVVAY9UJ9Jg0IPoINF 6bLON4kx4ZnvfXfo3DSxg8GpNz4luzauHTQVowiTE9qhVVH1Nk7+4Qy6EWM+q1n6KftW Z8hxXn8PEL7rI98N9cu4kreDWJim6TFvcMTLDFMoGITJOSzAhRBITFrQlT3m399u69AI CtAk3VBzbdA/93fctEdH4/Nel4csxkmA+nXSkmjYPQvyMeYojKkLgHT3AegX9q3QUQad ybAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gX0UGA3R; 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 n18si1992893ejy.547.2020.11.25.15.46.39; Wed, 25 Nov 2020 15:47:02 -0800 (PST) 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=gX0UGA3R; 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 S1728545AbgKYW5u (ORCPT + 99 others); Wed, 25 Nov 2020 17:57:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728467AbgKYW5t (ORCPT ); Wed, 25 Nov 2020 17:57:49 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54FB4C0613D4 for ; Wed, 25 Nov 2020 14:57:37 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id k5so151647plt.6 for ; Wed, 25 Nov 2020 14:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g64g7U4GAHaKj7z3gZ4urzrJeg/GRUrDZaN3e2rg/7I=; b=gX0UGA3R4cMOytViDwEKeKS6Zu+WrrqtPOgPrEI7lBwKoywrWQcz6qxseyyuWERJgH u7upTWQTpNQ+MsE34RjsOo+DQhbGgQznlOLyU8DO0A5SYx9QSotFT6QxpQ6sjcF4WUgR eGwSPMgFrABuoFZCy0+ekxc3S+FbmJt4NdNfkDq8dXoxc8gEq7oXbyGRwmzv3he4Z56j wTy5FGPTZVqVR76MtEABh24iKjko5FtGL4Jsfj0Rr6B1PoFWPDOaebroaoWRdURUVS26 zRCCXrpoG0QCEUYnFMvSnLariZZWTwdV+w0PCwppNAdbsU+wbfr8gd1S4n4S97IunAHF tmnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g64g7U4GAHaKj7z3gZ4urzrJeg/GRUrDZaN3e2rg/7I=; b=TjuyyFQiVOEH3ydSNvSIk2QGIJTeIRcMxQFnvaxrS9dcgjuplneE8Nr2ibhzi/aets 3PQA8Y3D8Dqiy/WAMf9bTdlrRwgIE4kR+R0E52RLs8f4yrrDmiBTPkJ1Dt384i3eh/8o uEWk3rvONdjms5LrfkL4DaGx66S/rPDZ2EWIzd41q0eQ00iz+Sg20W6eNN3Mgav5T089 SclkMKhCyJX/wA1rieKDpuDNpT/eCz208cUW34w0P5KbpvgI6t1M0olZlrfsuHAokqBT 8ZNLqM/2nsPH628caMTD0OMqZLvoibRnKjCVOd3o8O9kQmiwbEv9z0prILfWr/B9CRCq Rc0g== X-Gm-Message-State: AOAM530sv+d1k2KmgE+mWrajPETHa/OQ4TJrRayEM19aaqEunKNeZGW5 JJFh8dawcnDWcPFag+OEF8o= X-Received: by 2002:a17:902:7206:b029:d7:e6db:38c6 with SMTP id ba6-20020a1709027206b02900d7e6db38c6mr119974plb.6.1606345056679; Wed, 25 Nov 2020 14:57:36 -0800 (PST) Received: from localhost (61-68-227-232.tpgi.com.au. [61.68.227.232]) by smtp.gmail.com with ESMTPSA id u4sm3425319pjg.55.2020.11.25.14.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 14:57:35 -0800 (PST) Date: Thu, 26 Nov 2020 09:57:31 +1100 From: Balbir Singh To: "Li, Aubrey" Cc: Peter Zijlstra , "Joel Fernandes (Google)" , Nishanth Aravamudan , Julien Desfossez , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, 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 , 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, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 14/32] sched: migration changes for core scheduling Message-ID: <20201125225731.GB163610@balbir-desktop> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-15-joel@joelfernandes.org> <20201122235456.GF110669@balbir-desktop> <0b2514ef-6cc3-c1a3-280b-5d9062c80a31@linux.intel.com> <20201124154237.GZ3021@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 25, 2020 at 11:12:53AM +0800, Li, Aubrey wrote: > On 2020/11/24 23:42, Peter Zijlstra wrote: > > On Mon, Nov 23, 2020 at 12:36:10PM +0800, Li, Aubrey wrote: > >>>> +#ifdef CONFIG_SCHED_CORE > >>>> + /* > >>>> + * Skip this cpu if source task's cookie does not match > >>>> + * with CPU's core cookie. > >>>> + */ > >>>> + if (!sched_core_cookie_match(cpu_rq(cpu), env->p)) > >>>> + continue; > >>>> +#endif > >>>> + > >>> > >>> Any reason this is under an #ifdef? In sched_core_cookie_match() won't > >>> the check for sched_core_enabled() do the right thing even when > >>> CONFIG_SCHED_CORE is not enabed?> > >> Yes, sched_core_enabled works properly when CONFIG_SCHED_CORE is not > >> enabled. But when CONFIG_SCHED_CORE is not enabled, it does not make > >> sense to leave a core scheduler specific function here even at compile > >> time. Also, for the cases in hot path, this saves CPU cycles to avoid > >> a judgment. > > > > No, that's nonsense. If it works, remove the #ifdef. Less (#ifdef) is > > more. > > > > Okay, I pasted the refined patch here. > @Joel, please let me know if you want me to send it in a separated thread. > You still have a bunch of #ifdefs, can't we just do #ifndef CONFIG_SCHED_CORE static inline bool sched_core_enabled(struct rq *rq) { return false; } #endif and frankly I think even that is not needed because there is a jump label __sched_core_enabled that tells us if sched_core is enabled or not. Balbir