Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp482792ybg; Thu, 19 Mar 2020 03:26:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuKLFAxyvszrllXJFdvQoNnMBoxtUzAuwnXVcUJx3UmjbDJgTDQUgpPK36qZhUqYY4YnVzG X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr1773239oij.161.1584613588174; Thu, 19 Mar 2020 03:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584613588; cv=none; d=google.com; s=arc-20160816; b=dzraaT/BnBKAZJVjaNWl1+0HorgHLJ4K/lJBeydqdOGuO0jt5Q8N4W32YiRn7UWQVb mF08qnx2xjRT5eIdLpcPf+yDROlsgwseHmIRhbTex+JP7S39pm0EqKc4CEjWGu6ubNDj YCEXnRzaJY2Vr6YolHJ60qhk9/HBvU250lVMCTauIm1edE4GY2fR6M33YQ2GnsZNXEZ7 0lpk8YHIO6N/18sU7Ea7km8oTDhdxhkmvY6OC++0EM18Jk9+q43pbsmw7AdbYvQTsIt2 g38bWSnbsQq2HdijJm6cc4gi9pOYf6nB1guHT53++27oPpYmV3Gw5FsL7Y3Bi/X2YTRT oAnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=/Af8sc6VmAZcTDgMoLYNCqeFLBZp73cr09xhBgAYDDo=; b=c2YruLq9HWL22Npsx+tUerlGqdTNx5sxV6I8QZL2QDaOiTZNz/XbaqTZpvLZrtC+fh BdWS0cBsu1HHXdsJTjDYFtwWfPE1P9ypJqGN8ZqEFcH/jSe6CQ7188BS36YMoQAy5oan RgbBtG8d8lfSyPAjQayRZlodk1R++dAHsa9b4Fm94tU8XWL1EST57bUF5mv9oxSkLvbq 1aw1ukp+FrgY6fnhyOWEB/G+0jrXPoVy6QGpvihhy1IrMkg5gE8J5q0pp3nIs/i2kWcH +p6FeALbmdSYoMIRKi5KtfYWUmCN6wQQUNcDk3L8PmP/NSAtAhKiI+Aih1cWiabqz1BC k/Jg== 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 k15si1044046otn.6.2020.03.19.03.26.15; Thu, 19 Mar 2020 03:26:28 -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 S1726947AbgCSKZ1 (ORCPT + 99 others); Thu, 19 Mar 2020 06:25:27 -0400 Received: from foss.arm.com ([217.140.110.172]:32906 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbgCSKZ0 (ORCPT ); Thu, 19 Mar 2020 06:25: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 278EE1045; Thu, 19 Mar 2020 03:25:26 -0700 (PDT) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E4B503FAB1; Thu, 19 Mar 2020 02:07:32 -0700 (PDT) From: Dietmar Eggemann Subject: Re: [PATCH v2 2/9] sched/debug: Make sd->flags sysctl read-only To: Valentin Schneider , linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org References: <20200311181601.18314-1-valentin.schneider@arm.com> <20200311181601.18314-3-valentin.schneider@arm.com> Message-ID: <4a7fe6ae-3587-4a55-1cf2-c4fe568a5ffa@arm.com> Date: Thu, 19 Mar 2020 10:07:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200311181601.18314-3-valentin.schneider@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The question is, do people use the writable flags interface to tweak select_task_rq_fair() behavior in this regard?