Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp576086ybg; Thu, 19 Mar 2020 05:07:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmNlzXPCgqQnE8xoxrOea57HooXQdmzoln2Mgz2baq65XcIjBOibtOdcuEb7ti8d66gYmM X-Received: by 2002:a9d:138:: with SMTP id 53mr2016968otu.67.1584619674471; Thu, 19 Mar 2020 05:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584619674; cv=none; d=google.com; s=arc-20160816; b=mvWocRSkeRD8pjDMi66/Kkk1fcOUDd5tza0I7KjfOzUropIBuXg6Z4+PbsshCRkU+c pfAqL/EGuliGXO804bXU/o3z7fy42sMQ6itu0/ze13GHx6klSsVM20nU/TkJRXt+ChFb upU5H44ByUEFWHOgAaGl3DhywDz0HLNXXlrTwdeZ8oACniddzjw/jI/1wHBMXI7sF7JM YgdkW/x7aq4KQDL51Zy6PmPVfZqQ/QWfOgxy+I1kqjfklWyefZSyi8J4Vq9j2W/Yy5Eb GxIEl3q7hJaOuXYIym07QE6T9lM1zrs346Aqk8jqE4zd7ap6WOTEIytEPpxrHW9bQU5U Xl0A== 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=fPhEn0pvGVa7o1OvHLOC8TD0k/UlX9C7zH46G3rXAa4=; b=gpt2WH3zlrISyTi8phtVFuRb+Eeonm+nHQTIWKiHSWPasxDHfGCJqt8ImMHHbq4caH a8WtthbES/P5DtLqQF9F0GlBiC8libLFTlNP6wHFQcjoOeqtoOqGHkCPTWS7TG6C3/uw lHvFMID0C6IikrDAtkMNEzi1K5lGQWoBKICo31m9lxxLmWrArMSEhNTiYUjqbSE4CXtz UJAQiFvris4b7OfoGRdxtWbjKy/AUR4cPKoN29wBSAr/GoXPV2N4cy07q1u/ZIRMqVf0 lWSTqeJLA5YpdEI9X7E28iPn4dx8BAw6sHuGyd1igEop5gpWU/cAs6Zsr+9K78h2Dtcj Z52g== 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 z204si1023574oiz.133.2020.03.19.05.07.29; Thu, 19 Mar 2020 05:07:54 -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 S1727065AbgCSMF0 (ORCPT + 99 others); Thu, 19 Mar 2020 08:05:26 -0400 Received: from foss.arm.com ([217.140.110.172]:34050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbgCSMF0 (ORCPT ); Thu, 19 Mar 2020 08:05:26 -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 D99E431B; Thu, 19 Mar 2020 05:05:25 -0700 (PDT) Received: from e113632-lin (unknown [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1AA8D3F305; Thu, 19 Mar 2020 05:05:24 -0700 (PDT) References: <20200311181601.18314-1-valentin.schneider@arm.com> <20200311181601.18314-3-valentin.schneider@arm.com> <4a7fe6ae-3587-4a55-1cf2-c4fe568a5ffa@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 2/9] sched/debug: Make sd->flags sysctl read-only In-reply-to: <4a7fe6ae-3587-4a55-1cf2-c4fe568a5ffa@arm.com> Date: Thu, 19 Mar 2020 12:04:56 +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:15, Valentin Schneider wrote: >> Writing to the sysctl of a sched_domain->flags directly updates the value of >> the field, and goes nowhere near update_top_cache_domain(). This means that >> the cached domain pointers can end up containing stale data (e.g. the >> domain pointed to doesn't have the relevant flag set anymore). >> >> Explicit domain walks that check for flags will be affected by >> the write, but this won't be in sync with the cached pointers which will >> still point to the domains that were cached at the last sched_domain >> build. >> >> In other words, writing to this interface is playing a dangerous game. It >> could be made to trigger an update of the cached sched_domain pointers when >> written to, but this does not seem to be worth the trouble. Make it >> read-only. > > As long as I don't change SD flags for which cached SD pointers exist > (SD_SHARE_PKG_RESOURCES, SD_NUMA, SD_ASYM_PACKING or > SD_ASYM_CPUCAPACITY) the write-able interface still could make some sense. > > E.g. by enabling SD_BALANCE_WAKE on the fly, I can force !want_affine > wakees into slow path. > True, although since there is no explicit differenciation between the cached and !cached flags, this is still a landmined interface. > The question is, do people use the writable flags interface to tweak > select_task_rq_fair() behavior in this regard? I did try asking around on IRC (which admittedly is just a small subset of people) but didn't find anyone.