Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp591473ybg; Thu, 19 Mar 2020 05:24:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsFhjxxVs6agiX83a2eKg/C/5pp/kTYbf+oDVypAZz4FaR2rhvFj69DYTrDsbIri2rXvZVA X-Received: by 2002:aca:7506:: with SMTP id q6mr2104127oic.73.1584620640167; Thu, 19 Mar 2020 05:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584620640; cv=none; d=google.com; s=arc-20160816; b=vL4c9ZzcVHK213iIrXMhcHFFohjoxLMUsf6HJQAUYHukm4SO4u0EimISXDQTsl50hL 7HCyOTafgV3vDOZgerQIkNbPBjh3O1azWlQoscx9Y9J+b9uPlvcuwIQx9zQ6ilnm4KAY pGGf5qft3Pi7hxQhVwTb1Y+R7ROdmlncQQ/NUioofVCC478TnlmL4bGypOFowLLcP4+i 2kAo0/pWsEfHajt9T99rgYa+iyQQucUseXmKpUFxZdko0Q+OXr2eZil6suJFyJ1V0QjT nGjTb4Oj3TKiYVN9N+UXkvBRu7J91aKX8auoLBICKavb+SqhPJTEeW2l16eRXIQTOfUa AsAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=jhAb1wqvTH8fFszW6ymTHgCllSe3u2iI5rW5ZXKCJ1k=; b=mp0JN7ffVMsF6aAOSAzfUQA1Edi8o8XYHGaN2LQZdv3lTpyZCR3fYLoPNo5o3Wd04P FXoxeffW9NbI2AiLd+9xmaedBjDecDqzc0v/IUe678K3G654PYBtKGJgOf7W2BQcvaEg 92kT0VhNFPhJB+b+4QStbiSRPukSXyDQQf3TWDUSp2KZMHrdAshqeOq3+LVhBYqqr0Fl K7JjLP+Wfb5Jrlas6cfqchZWVO2bnIYlMB2I1jNcH+tGw6X6WEOguMU9XFjWFrW25kST NQpHeGArTNrSHGsUbZaClwelgeVmZRAZKSklkOIA7z2itDHF6Ta7tfXtPCXkXXXnt53x /f8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x79si841107oif.180.2020.03.19.05.23.48; Thu, 19 Mar 2020 05:24:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbgCSMXX (ORCPT + 99 others); Thu, 19 Mar 2020 08:23:23 -0400 Received: from foss.arm.com ([217.140.110.172]:34410 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726936AbgCSMXX (ORCPT ); Thu, 19 Mar 2020 08:23:23 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CDBA731B; Thu, 19 Mar 2020 05:23:22 -0700 (PDT) Received: from e113632-lin (unknown [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0ECD93F305; Thu, 19 Mar 2020 05:23:21 -0700 (PDT) References: <20200311181601.18314-1-valentin.schneider@arm.com> <20200311181601.18314-10-valentin.schneider@arm.com> <53763a32-0ce5-e267-9d5d-99e65c921d08@arm.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org Subject: Re: [PATCH v2 9/9] sched/topology: Define and use shortcut pointers for wakeup sd_flag scan In-reply-to: <53763a32-0ce5-e267-9d5d-99e65c921d08@arm.com> Date: Thu, 19 Mar 2020 12:22:34 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 19 2020, Dietmar Eggemann wrote: > On 11.03.20 19:16, Valentin Schneider wrote: >> @@ -6621,7 +6610,19 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags) >> >> rcu_read_lock(); >> >> - sd = highest_flag_domain(cpu, sd_flag); >> + switch (wake_flags & (WF_TTWU | WF_FORK | WF_EXEC)) { >> + case WF_TTWU: >> + sd_flag = SD_BALANCE_WAKE; >> + sd = rcu_dereference(per_cpu(sd_balance_wake, cpu)); > > IMHO, since we hard-code 0*SD_BALANCE_WAKE in sd_init(), sd would always > be NULL, so !want_affine (i.e. wake_wide()) would still go sis(). > > SD_BALANCE_WAKE is no a topology related sd_flag so it can't be set from > outside. Since the sd->flags sysctl is now read-only, wouldn't this case > be redundant? > On a purely mainline kernel, yes, 'sd' will always be NULL for wakeups. I'm playing a bit more conservative here with SD_BALANCE_WAKE, as I could see some folks using that flag in some ~franken~ downstream kernels (I am not aware of any, however). Also, to be fair we've only very recently gotten rid of the last SD_BALANCE_WAKE user (asymmetric CPU capacity topologies), so I felt like keeping it around for a bit before entirely killing it would be a sane thing to do. > [...]