Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5080853imb; Thu, 7 Mar 2019 07:20:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyTA64Xg6i1ISu0G2+W1wp/HEYnFwTS3/vYU8WZSWiiLcGMSQYi8Ir4+bTzfsXo4b2Wf+tB X-Received: by 2002:a17:902:834b:: with SMTP id z11mr13538030pln.257.1551972050378; Thu, 07 Mar 2019 07:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551972050; cv=none; d=google.com; s=arc-20160816; b=Ee3uFR0HTA6zhvCye6J1CmpyvryQ/e+Rx8Uz2pYdED3XSROIb4981LNTu5XkJuKGAN JKbbxWeadbxkX6I/j6snjhjEgnY/rstgM/ipKvABOcoF4xmy/krmBy2w7adL45YbFC0S 2Gq9tkeVlOCubH76SpOuFYv+09xiZWp7REyPm1lDBdsTHgh/GZ1JRuRaa0qoGka2q/BG EdvVQ6nIK81wtRUUJ4g41lBLjfO/XTq/xC7n7UV8EuF+HGNJjfOPTaF3Cg/Ew554uBZZ NY9QBhelmd1l3pBNbxd1FW/lXHxz2VV4r7lMukNEvdSVbZYYGPJ5cWSqhqZ++7cTRkH5 XlvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DZ/dx1dhew5U9aK82rDosfbvERdvbvlpEdYDyG1MIsg=; b=H6AnV5O6mQ10ILP9dt1A+Ugu/SDe6BwwTyuTHA8q+ZLtGz7/An+3yPdNtSPKIqJOlG AgZ0XVNHTuo29BLi76MdGJ67d1X98G9f2XP9+prTqxxIAuCeZHo37LxBk4nkZmQCXpzT aFTzY6NKQlT44AB6ySbZfk7wduVwVSo0J+BB8WC5ej+6sdi1zuZ436SoCkn6BlPzB0P6 UnjQUyoEjJHPU89tH9vfWLhcgtL1a4SF4y7d8OOy/VDGjxmANCq84asEI0alih1E5Eah jeJs2fksGAWZNnUa7++yi6aa20WgRsgDYmX74D+UCBgovtzWiieTavDQO+giH73Gj85h L/7w== 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 a73si4013986pge.5.2019.03.07.07.20.34; Thu, 07 Mar 2019 07:20:50 -0800 (PST) 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 S1726455AbfCGPT7 (ORCPT + 99 others); Thu, 7 Mar 2019 10:19:59 -0500 Received: from foss.arm.com ([217.140.101.70]:47142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726161AbfCGPT7 (ORCPT ); Thu, 7 Mar 2019 10:19:59 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 88E68EBD; Thu, 7 Mar 2019 07:19:58 -0800 (PST) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD5813F706; Thu, 7 Mar 2019 07:19:56 -0800 (PST) Date: Thu, 7 Mar 2019 15:19:54 +0000 From: Sudeep Holla To: Lingutla Chandrasekhar Cc: quentin.perret@arm.com, dietmar.eggemann@arm.com, gregkh@linuxfoundation.org, will.deacon@arm.com, catalin.marinas@arm.com, morten.rasmussen@arm.com, linux-arm-kernel@lists.infradead.org, jeremy.linton@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] arch_topology: Make cpu_capacity sysfs node as ready-only Message-ID: <20190307151954.GB5778@e107155-lin> References: <20190306152254.GB19434@e105550-lin.cambridge.arm.com> <1551886073-16217-1-git-send-email-clingutla@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551886073-16217-1-git-send-email-clingutla@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 06, 2019 at 08:57:53PM +0530, Lingutla Chandrasekhar wrote: > If user updates any cpu's cpu_capacity, then the new value is going to > be applied to all its online sibling cpus. But this need not to be correct > always, as sibling cpus (in ARM, same micro architecture cpus) would have > different cpu_capacity with different performance characteristics. > So updating the user supplied cpu_capacity to all cpu siblings > is not correct. > > And another problem is, current code assumes that 'all cpus in a cluster > or with same package_id (core_siblings), would have same cpu_capacity'. > But with commit '5bdd2b3f0f8 ("arm64: topology: add support to remove > cpu topology sibling masks")', when a cpu hotplugged out, the cpu > information gets cleared in its sibling cpus. So user supplied > cpu_capacity would be applied to only online sibling cpus at the time. > After that, if any cpu hot plugged in, it would have different cpu_capacity > than its siblings, which breaks the above assumption. > > So instead of mucking around the core sibling mask for user supplied > value, use device-tree to set cpu capacity. And make the cpu_capacity > node as read-only to know the assymetry between cpus in the system. > Acked-by: Sudeep Holla IIRC this was added for 2 possibilities though I don't completely agree no one had any objections(including me though I wonder how/why I missed to notice it now, anyways it's too late) 1. For systems that don't provide this information via device-tree/any firmware though that's the highly recommended way. With more complex topologies in horizon, I can't think of fetching/deducing this information *correctly* in any other sane way. 2. For some sort of tuning(avoid rebuild and reboot), but that's questionable as this is not a software characteristic. It's more like deriving hardware characteristics using software experiments. So, for me, we can compare this with some hardware latencies we have like CPU idle entry/exit latencies. They are tuned but not in production kernels. So if there's a case for adding this back as write capable sysfs, I would prefer that in debugfs and this sysfs is read-only ABI. Hope that helps. -- Regards, Sudeep