Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5653020imu; Wed, 30 Jan 2019 01:02:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN6+NKVYe9tXQ6FSk75U6bzpt5DilNfFwAxPtWWZ+Xc73/2pzhQ7CWGnyV5mb+Qgj8f4/Wmu X-Received: by 2002:a63:6207:: with SMTP id w7mr25835553pgb.90.1548838969877; Wed, 30 Jan 2019 01:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548838969; cv=none; d=google.com; s=arc-20160816; b=ykJCsawpD/WVphK1TQUD/7h5wUq8NYSWT0jAtmk3c6fmZ2fIC4y24zbkHLYrvWpyWg ighJ6UiJOeTZuwhMPczxwaRuspvRlr/qmpQUuqm972Qk45lKsVcYk01rk+ts0ngTOkrc oreF6Oe5uPi00WPhlHVs9qfpT3ynClRnnt5tqUEUUKZjRIrnT/qfwzADDg046A0Q6XGX OaVCAUt0J9DUcDlWvGQ5ZXrQPSujDRPAy4IXX761oi6zoibdiKuJjy4Dah5rTMCp/OOE tah+DXyHnhBnML74Kp+vcnpRoqZ8ItUS/e41ZTWDx0fMy2xPIx1XEE2C6fxjTRzciVQY u7ZQ== 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; bh=NqDUB5Wd/XUEMgwbEk0/BKMTKVF42AwD0C25SlxCTsM=; b=KEm3eHnjEcJK9n8/4bS0vmvyR0d1D0aPqkyF8fSrOb2npUnpdP4n4s3wFnApw2oCLE yFhbsjW2FzJewBH82jsl9cDbd1Y7cKSoKKY7eLPfChVYQnunPryYgMgP9XvwHqPoKTbO pUVkrV/Ql6YNA8uVDUMlip8hbZ2MVSMBLbZDQ1/NbatTUQ/vIw/7SPgRY5oFFhzpebH1 aDo8lNNvPxmh2bN2KU99q5G2ZvbXHwyfgC0/XwvtXYaMVrjyqIrdI7TIIj2guTMc/DI0 aPGFl244XGe0EnRk8iskbeiEM6+QybdfJHRXEFBqsv6XC9WMBOrtbiR5gq0TMhhssMZQ QEzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SvrFrD5c; 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 h32si983649pld.387.2019.01.30.01.02.34; Wed, 30 Jan 2019 01:02:49 -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=SvrFrD5c; 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 S1730359AbfA3JBx (ORCPT + 99 others); Wed, 30 Jan 2019 04:01:53 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41716 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfA3JBw (ORCPT ); Wed, 30 Jan 2019 04:01:52 -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=NqDUB5Wd/XUEMgwbEk0/BKMTKVF42AwD0C25SlxCTsM=; b=SvrFrD5cUNam1gYWkvb1RnzpR hNfxNzmybxyoP19xMFsEJKPRUpI+/COB/9jjy4pg5F9BlbdgfnIg90I8yXvSMPZ6WG4ApAJqmNajs zPMFx6BjDAGPK4GG4sIDm5YV8KfH9s7NcnH+nc1vEtuUgOCS3eiBRJtqfCroG3J6d6gWHcUM8eUj4 xUqIEMTUwQlnC/XEHRjZb1fzwEC+tQ6frpPUb/G6seIPLKd+YK5vo5KhJFcLDWA1xfMKfv9c9sgHH mHODA4EenUzIqVqtJwKX8vFaL/t1a70AO6MA140B6B3cfp2CGuYYbUgq6Lx3D91H30Vcwy4ysDUGu jwf2QmVVw==; 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.90_1 #2 (Red Hat Linux)) id 1golkj-0005NI-8S; Wed, 30 Jan 2019 09:01:49 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BC9F020289CC5; Wed, 30 Jan 2019 10:01:47 +0100 (CET) Date: Wed, 30 Jan 2019 10:01:47 +0100 From: Peter Zijlstra To: "Reshetova, Elena" Cc: "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "acme@kernel.org" , "namhyung@kernel.org" , "alexander.shishkin@linux.intel.com" , "jolsa@redhat.com" , "keescook@chromium.org" , "tglx@linutronix.de" Subject: Re: [PATCH 1/3] perf: convert perf_event_context.refcount to refcount_t Message-ID: <20190130090147.GB2278@hirez.programming.kicks-ass.net> References: <1548678448-24458-1-git-send-email-elena.reshetova@intel.com> <1548678448-24458-2-git-send-email-elena.reshetova@intel.com> <20190129093748.GF28467@hirez.programming.kicks-ass.net> <2236FBA76BA1254E88B949DDB74E612BA4B98D3A@IRSMSX102.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2236FBA76BA1254E88B949DDB74E612BA4B98D3A@IRSMSX102.ger.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 01:55:32PM +0000, Reshetova, Elena wrote: > > On Mon, Jan 28, 2019 at 02:27:26PM +0200, Elena Reshetova wrote: > > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > > index 3cd13a3..a1e87d2 100644 > > > --- a/kernel/events/core.c > > > +++ b/kernel/events/core.c > > > @@ -1171,7 +1171,7 @@ static void perf_event_ctx_deactivate(struct > > perf_event_context *ctx) > > > > > > static void get_ctx(struct perf_event_context *ctx) > > > { > > > - WARN_ON(!atomic_inc_not_zero(&ctx->refcount)); > > > + WARN_ON(!refcount_inc_not_zero(&ctx->refcount)); > > > > This could be refcount_inc(), remember how that already produces a WARN > > when we try and increment 0. > > But is this true for the x86 arch-specific implementation also? Dunno; but when debugging you should not have those enabled anyway.