Received: by 10.223.185.116 with SMTP id b49csp1043138wrg; Fri, 16 Feb 2018 11:21:29 -0800 (PST) X-Google-Smtp-Source: AH8x224bSGhifPQD+tJbOzxxGORaLSW0aWTVBZARR1VdagRBktMRJLvv5yWHv9we0p+H+hHJ2Gzv X-Received: by 2002:a17:902:981:: with SMTP id 1-v6mr6836521pln.345.1518808889699; Fri, 16 Feb 2018 11:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808889; cv=none; d=google.com; s=arc-20160816; b=FHimZ4e37lvsLY7TbWIu3HVbrz0+2x+ngqIEkRBP3/C+CuzrH35q2DlQMGaNCOh5m5 O+2yi/wuMXTAKX4i8YuCvOQ+rNfHjtWhGnF0JU7dlHH3GZzGf/fBIjhu7KKrhLg/Gkpt RC6eAST6fq8167W6b3RmLBHk7Bhuh15G+p4mxNvJ6ohPudfVqpEX0OOJfrVKy8uXEUqM Q0DJ2TE2KcpWdTm13D2Kmwb9kbgsiiCVIxu6EH4J7VTZ8VqHjaebeyfqcJsivUF8ocz5 kcV8Y+5sHRCco724/jqX1+M5Jc3AOyTawrb9iHeJ59KpsWVdomaXaYCvVhVEBD0123GJ GWPg== 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:dkim-signature:arc-authentication-results; bh=B+fx217GgpzytCKGAKTmqG97JouqDLbiFiR//xtl7n8=; b=PQgQcvcAQusruVHMP50tACPdhdy7pc0BAaFc9BMboxTqnIgAUCcXOmkltIMkX041o9 YL6d/xfF0+M6woy5FRmSI+2HjvMEUfYXG/JSFlNMyLEEkt8oQk4zp725sAKYwg7aV5zy wtGVtib4TiAmfko5FRhe/x9jvV241DxBTnTYKVe9/q7DH1ahkx3DuWG8FkUHBe1F3kiV XINkQEdPzUzZAb9hH46RLayvM1DgKFGZLgR12d16Arq8wlE82I951L3p7iuijTZDxCHV 8omw206+nQW+9IE3Ik89mH5OXroUtjM96oWPQ7idf8WRCBVDaoNm/hswQQjl4vxshrTH eLuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VLgcXBRQ; 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 q82si3475515pfd.240.2018.02.16.11.21.15; Fri, 16 Feb 2018 11:21:29 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VLgcXBRQ; 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 S1756297AbeBPRoG (ORCPT + 99 others); Fri, 16 Feb 2018 12:44:06 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:40832 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbeBPRoF (ORCPT ); Fri, 16 Feb 2018 12:44:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B+fx217GgpzytCKGAKTmqG97JouqDLbiFiR//xtl7n8=; b=VLgcXBRQfCGUiuIfsu/KY6hcF OYHttmIqpVzKepq3syWJbjsL+rOtI5qYkpy3U9GbXSMP0n+dd5Aych7HbXI82VtpHJZyTyEj7ZM7B 49qGPRUz1Q54Y8hisU9HYJ4LNa6SaMlafmJsjerp4M4KAIR/w45UjqF/d73KPRr/XTL0g6NuaMviR 7+6fueYhwr6ChYmDImPVFPhJtheq0IQnW+D35e8xaB+q7RR+ovVxZB2H0JqTECLeyvakt3u4FzOGh o3GM4Qx9eYkJTHyitWJUgMqP4s8sZq7TGkwhXBVn+T0turKtYL/z6zARoT/nGk9aDalSwrvIMlJya OsjGz/QSA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1emk3B-00047A-En; Fri, 16 Feb 2018 17:43:57 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C585C201FB4F0; Fri, 16 Feb 2018 18:43:55 +0100 (CET) Date: Fri, 16 Feb 2018 18:43:55 +0100 From: Peter Zijlstra To: Quentin Perret Cc: Morten Rasmussen , Morten Rasmussen , mingo@redhat.com, valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations Message-ID: <20180216174355.GK25201@hirez.programming.kicks-ass.net> References: <1518711654-23503-1-git-send-email-morten.rasmussen@arm.com> <1518711654-23503-2-git-send-email-morten.rasmussen@arm.com> <20180216134704.GE25201@hirez.programming.kicks-ass.net> <20180216154101.GE28799@e105550-lin.cambridge.arm.com> <20180216173927.GA5352@e108498-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180216173927.GA5352@e108498-lin.cambridge.arm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 16, 2018 at 05:39:27PM +0000, Quentin Perret wrote: > AFAIU it should be safe, but without your check you'll have to go through > cpus_read_lock()/unlock() every time a CPU is hotplugged. There is probably > no good reason to re-do that again and again if the state of the key > never changes. I don't know how expensive those lock/unlock operations are, > but I bet they are more expensive than testing static_branch_unlikely() :) This is not a performance critical path, more obvious code is more better. Also cpus_read_lock() is dirt cheap most of the time.