Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5186844img; Wed, 27 Mar 2019 03:59:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUbBJRmBdJZWIt4gkabH4/8w4e9Muz4zzYmRaSqyNuLTrvBXYMbBMrkXNzWPVoNwxW6DbI X-Received: by 2002:a65:62c9:: with SMTP id m9mr28265248pgv.309.1553684343872; Wed, 27 Mar 2019 03:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553684343; cv=none; d=google.com; s=arc-20160816; b=m4OyHAJFcktEBpAet9bxK81HhNMcNL/lfWLJKWT8WRiqRxDLIzh5C7E6Qjz+9niTra GGiZ/Xf6W0GElTOnxPm85kThBlC/7O/IVnF7fVoraXOp3sXFKMzLoXHO7zeLBypZTN6K D+gZ2sW1bm5SoQyMlE2KW/8x3Cu7cfEHoQLB9mS0fmMynhKMZkpgG8/wQgqn3MuutJY+ Y4lWwCyucHa5MuBhHcxOdehb4GZflnJEtY/e5R7qNEuHYvpLHOeuh1Q2suTUGe8/Nvaf D6B5vLvTotv6I/6fVccL83HoQRZtZ6CvF4RazZlijO+Ji0POya3xC9+H016DD38ZQkeN pGCw== 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=9hJKNuvkGkOKp7brGBhKkM5io1INaegLfamDgfcKXg4=; b=MN6ElYLKDDLipTIvv4DgkN4lWUdFBX2slF/sYS+5aFJGeQf3LEVXiKbFXk3yxTRnVe ulpU/1Q+xboiiqu6U+x2G6Ys3EVdjnKCWWMDvhlHdwGG9jqTFxU6sJQsXwj0lPKsDVzx mpHcAaseUWdVHMZojqSvvmIHkZcHPR5zW5yZdGnJiW1PPraCIfzfMyqfzAXhbB7rZYt2 5wzgYgWMVeNi1q/vi5ENhgVgrvDvzG9eE7E0+CNeogq2LQZWHsi/qjdOf123GtiyLqah NdcV67SOCVSbwm1t67GmniRgE/SEfBOpx7Gn0E5L9LiC0s9GEF7V0EOLKRjXBb3I3Ye6 qb4w== 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 14si152592ple.218.2019.03.27.03.58.48; Wed, 27 Mar 2019 03:59:03 -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 S1732942AbfC0K4q (ORCPT + 99 others); Wed, 27 Mar 2019 06:56:46 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52618 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729489AbfC0K4q (ORCPT ); Wed, 27 Mar 2019 06:56:46 -0400 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 EA236A78; Wed, 27 Mar 2019 03:56:45 -0700 (PDT) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 256363F557; Wed, 27 Mar 2019 03:56:44 -0700 (PDT) Date: Wed, 27 Mar 2019 10:56:42 +0000 From: Quentin Perret To: Lingutla Chandrasekhar Cc: sudeep.holla@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 v2] arch_topology: Make cpu_capacity sysfs node as ready-only Message-ID: <20190327105640.ibiw5mvuggp35msl@queper01-lin> References: <1552048728-29657-1-git-send-email-clingutla@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1552048728-29657-1-git-send-email-clingutla@codeaurora.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Friday 08 Mar 2019 at 18:08:48 (+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. > While at it, remove cpu_scale_mutex usage, which used for sysfs write > protection. > > Tested-by: Dietmar Eggemann > Acked-by: Sudeep Holla > Signed-off-by: Lingutla Chandrasekhar Reviewed-by: Quentin Perret Tested-by: Quentin Perret Thanks for doing this, Quentin