Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4453008imu; Tue, 29 Jan 2019 01:39:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN4kuqSOaUwav6+7/YNIFPVuKO1nN3RCQMr/lDfBggiXQGRNxgest6oDP7WXddCID4B+SF7g X-Received: by 2002:a17:902:9691:: with SMTP id n17mr25990962plp.9.1548754795551; Tue, 29 Jan 2019 01:39:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548754795; cv=none; d=google.com; s=arc-20160816; b=dKuggpTOqqmSkpaOLGPD+Iip22RhWA13JeEKA0MaHLzpQBhdimZzQngsANxwJXvMJs mGZLyr7v35Z+6KzbmZhNzWCh+vbAEBZcSCag8tDaNN313h8Ja+EM1gd81Up1ZZOklljz GYTWwNnW3v6gXdIpON8lOBB7cXmrli9pLlBn7rdDa2271LMyvmqYu59AnERO1Rz/7/KW dSCbvpBhXld7OwVNYJ6ECLEtQwxxrnfYTg6JQBEOu/JKz8jBgGytI+VRl1fcnyhFUujK uUnIaT/IgMX2MUqUfSP2/AJFvUj5wbXbp/CJcM2gWqUM8J4auEbQyK232xeUTJalJKmL BFZQ== 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=/56xF6oLfxBmXgnzr3HBj0IOJtYizlwY+A20yEDsDUE=; b=z3XFQTwDIT3HAWIip3MPTB52NHpYB9WGVmoDidj7vdi6mX+4wsTop4Qge35ZhNG9wS 155i7Swrx7VzGy6NQ9xFMv2Optur0u1CCp9vJAFVgfOngBCgrAlS+lzlJTW5NziWiVsV xZeRrR2TFts0fHpTjdAS+rSjtBsAens7UOcZF7O0xJ6lZ4hDmdQkE/lriHK0dJ3sEkT4 FzrRuYXppHYftSqd/mKAP4t5EcgJ8bFd75qdu7AAokIxJCMwtJRv+wF+OwLQzyp8sV8V cDxtKxW0ZGAhlnrLBJic9qNDGDFK3/cg6pkMQkIxSvXUDXun8zrj+CR5dNDzQQK3im/l Wu5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EJjAgKPr; 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 a19si36758334pgn.102.2019.01.29.01.39.40; Tue, 29 Jan 2019 01:39:55 -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=merlin.20170209 header.b=EJjAgKPr; 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 S1728051AbfA2JiF (ORCPT + 99 others); Tue, 29 Jan 2019 04:38:05 -0500 Received: from merlin.infradead.org ([205.233.59.134]:56312 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbfA2JiE (ORCPT ); Tue, 29 Jan 2019 04:38:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=/56xF6oLfxBmXgnzr3HBj0IOJtYizlwY+A20yEDsDUE=; b=EJjAgKPrd72y8UvlmQ6giHTSb kYP0ZJOh+i7vazGZyb9ZhXP6U447rYRkfHudIdnsVlYzA/QNYjmZ9RTXTSwfzDceBadtsySCbmGfS KLkm1Hd49GPBOD9LrErMxm1cjdx1OMXX7wPTDD6xMMx2HkzQpqDEgUaaJkbN1QbN0PkkHyocQxw6E DYWRJXPk5Vl2gaAjyYrBDolJiBVqIMtAHeWE0aPbwlCW2E/6DlpDJZXYwitiCnYqfj5dHNNYD3VOe omJ45qpmd2z/b45SImOi14wqNgjvIXDgFVFlRUkhIlTxAACwB10Ck0nxzz9twCgeP6RjVnWprJEUf 37X6iCWwg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1goPq2-0008Lt-9F; Tue, 29 Jan 2019 09:37:50 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9FB842042CFA9; Tue, 29 Jan 2019 10:37:48 +0100 (CET) Date: Tue, 29 Jan 2019 10:37:48 +0100 From: Peter Zijlstra To: Elena Reshetova 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: <20190129093748.GF28467@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548678448-24458-2-git-send-email-elena.reshetova@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 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.