Message ID | 20231127220902.1315692-15-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3499195vqx; Mon, 27 Nov 2023 14:11:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYLClpXFa9UJ7O75sagPL7EYOpg3fdO+LG+7GhIvtHBl5Q/Q/qMAvqn+/czJkyZv6vrEgJ X-Received: by 2002:a05:6a20:daa8:b0:18b:914a:a81 with SMTP id iy40-20020a056a20daa800b0018b914a0a81mr15576527pzb.52.1701123073100; Mon, 27 Nov 2023 14:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701123073; cv=none; d=google.com; s=arc-20160816; b=KgI6b2gwcYE1lIEJVCU5L3LxmofZxu4008q/GtKCgb/4QT/I45lsbjaYZsiZfX14qN kbdPXd0iLcjdEcdNApGSC2SpCWLvPBVrACUv9E+rhyPAt4iaavZHIh8aNwAzdtZ0fKFA 0fZEtpX0V744eJ1s7k6S0bD+UjC7R25Yfex6qtEhJRq0ajSTcUIrrHKL1FIsl0MfxVlj hUMHvi4xezs0PaoJe3DtVKE2CGikedVFic4/NFeHenT5g2yUsLkEtj97mDR2iZ+pNW2S oDdBH3HFBQhsLPl7kzBobUvTqzI70q/wxVwo7mzpDitrcYbBYAypt+cFNEvpcPK/HJlR LYwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=ZecnKr4/DerqIeSqaHVpwjVrdZDxEblZaIh+QxMRJSko2xcZxolDWvgC3OZ5fM0BVP nEFxGW1EESW7cm+Apx12uqI81tU+FzLAJ2k+KAAR2UPwQUAhRs9IpsGkHhRnqyEisw3G tGpqBq+m+rtI9/R9RlZc7LSLjenR4dcXGykUQNGxc1lhqr+H7tx3emmD89rRaBHSxvcM ysOP5nEeo2rtWQbREcIElOcz8Jh8smYBsNMsxbFlDR+oETjfJu1yw0pTUmxsB5znHO7J IfKzOIfJluNUOFIpP3kQl4WfV8rkALHhqSZYitzRy3R8SdqN/vCkyy+8AH62uWk749aZ X64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WPCl6vSI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id lr2-20020a17090b4b8200b0028037d7ed6csi11398923pjb.126.2023.11.27.14.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WPCl6vSI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 33F738107562; Mon, 27 Nov 2023 14:11:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbjK0WKy (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Mon, 27 Nov 2023 17:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233780AbjK0WKL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Nov 2023 17:10:11 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3211FD5 for <linux-kernel@vger.kernel.org>; Mon, 27 Nov 2023 14:09:56 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5d032ab478fso22182097b3.0 for <linux-kernel@vger.kernel.org>; Mon, 27 Nov 2023 14:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701122996; x=1701727796; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; b=WPCl6vSIkYCmhmu5akCPCP2wiA+siWnPsU1ovqYyvnlCilvAj/f6d/b7vgwr+E/diC Ba6bBizXb1y82anhXo8OS5HdKsXpKCjA72oMgZuGAhFyaGlM6TMycIJBW9NdDAqdzyO9 te6IJFlwKLbAZxtZbDSSMlhAZfqszic+zOL7Ercp+Q3xfVjP1Mg/DeWRNDcNYsY8m4PE 5agcqzjazPelhn8a3OdtyzNGmjQHFNE1NUbmPvqx0AVDmc5rnl07tzOO47U5JmptxV37 HousULPdBYyjJfZUeAIy95e8Afl3enRxsd2XgUbJzEi8G5D9WLdQA+K+9FdqpMjMgOiB jL5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701122996; x=1701727796; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; b=IkPcVz+e3ihS2zH7oMNYhW8aoh7K1+wJzPCiUXPPAH5MqrjN2/cBApSDeeJCE/Tb1e jhdDMcIGgiUaAVAR55u9WSFj8ne+4K0aXBxuHc3of3tmi4yw2hO7nvtCBJaZ5D9rxwmw IwvCsECeAdlb5VBenc2zFzRiF2r2ZaP58voPVJYpYQIIV7/dG1mpMPtNqK4uQubDZmk2 iPkJj+UyYSpm+ar2jesl5SUFR9GeBiKosxh5fpm18/fs59kchQFhvAYhqxbP2HNrBa88 aAZSPSzCk7aTdfT0+M9CfkBQ9eAYlishvG1EAKY5cG15nBF9KfUd2Q2Bz1xC5VlbneAC Jz8Q== X-Gm-Message-State: AOJu0YxDtO/xRWiZkCOuuKS3Px/oULPykLcqICKFLNPtMZpApkhg8Et7 nJEJjH28RFgJtCPIIATuSomASvaWa2wM X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:829:6e77:9093:f39b]) (user=irogers job=sendgmr) by 2002:a05:690c:2e87:b0:5cc:3d0c:2b60 with SMTP id eu7-20020a05690c2e8700b005cc3d0c2b60mr369861ywb.4.1701122996145; Mon, 27 Nov 2023 14:09:56 -0800 (PST) Date: Mon, 27 Nov 2023 14:08:26 -0800 In-Reply-To: <20231127220902.1315692-1-irogers@google.com> Message-Id: <20231127220902.1315692-15-irogers@google.com> Mime-Version: 1.0 References: <20231127220902.1315692-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v5 14/50] perf thread: Add missing RC_CHK_EQUAL From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Nick Terrell <terrelln@fb.com>, Kan Liang <kan.liang@linux.intel.com>, Andi Kleen <ak@linux.intel.com>, Kajol Jain <kjain@linux.ibm.com>, Athira Rajeev <atrajeev@linux.vnet.ibm.com>, Huacai Chen <chenhuacai@kernel.org>, Masami Hiramatsu <mhiramat@kernel.org>, Vincent Whitchurch <vincent.whitchurch@axis.com>, "Steinar H. Gunderson" <sesse@google.com>, Liam Howlett <liam.howlett@oracle.com>, Miguel Ojeda <ojeda@kernel.org>, Colin Ian King <colin.i.king@gmail.com>, Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong <yangjihong1@huawei.com>, Ming Wang <wangming01@loongson.cn>, James Clark <james.clark@arm.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Sean Christopherson <seanjc@google.com>, Leo Yan <leo.yan@linaro.org>, Ravi Bangoria <ravi.bangoria@amd.com>, German Gomez <german.gomez@arm.com>, Changbin Du <changbin.du@huawei.com>, Paolo Bonzini <pbonzini@redhat.com>, Li Dong <lidong@vivo.com>, Sandipan Das <sandipan.das@amd.com>, liuwenyu <liuwenyu7@huawei.com>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Guilherme Amadio <amadio@gentoo.org> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 14:11:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783756827533981029 X-GMAIL-MSGID: 1783756827533981029 |
Series |
Improvements to memory use
|
|
Commit Message
Ian Rogers
Nov. 27, 2023, 10:08 p.m. UTC
Comparing pointers without RC_CHK_ACCESS means the indirect object
will be compared rather than the underlying maps when REFCNT_CHECKING
is enabled. Fix by adding missing RC_CHK_EQUAL.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Nov 27, 2023 at 2:09 PM Ian Rogers <irogers@google.com> wrote: > > Comparing pointers without RC_CHK_ACCESS means the indirect object > will be compared rather than the underlying maps when REFCNT_CHECKING > is enabled. Fix by adding missing RC_CHK_EQUAL. > > Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung
Em Mon, Dec 04, 2023 at 03:41:42PM -0800, Namhyung Kim escreveu: > On Mon, Nov 27, 2023 at 2:09 PM Ian Rogers <irogers@google.com> wrote: > > > > Comparing pointers without RC_CHK_ACCESS means the indirect object > > will be compared rather than the underlying maps when REFCNT_CHECKING > > is enabled. Fix by adding missing RC_CHK_EQUAL. > > > > Signed-off-by: Ian Rogers <irogers@google.com> > > Acked-by: Namhyung Kim <namhyung@kernel.org> Thanks, applied to perf-tools-next. - Arnaldo
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index fe5e6991ae4b..b9c2039c4230 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -385,7 +385,7 @@ static int thread__clone_maps(struct thread *thread, struct thread *parent, bool if (thread__pid(thread) == thread__pid(parent)) return thread__prepare_access(thread); - if (thread__maps(thread) == thread__maps(parent)) { + if (RC_CHK_EQUAL(thread__maps(thread), thread__maps(parent))) { pr_debug("broken map groups on thread %d/%d parent %d/%d\n", thread__pid(thread), thread__tid(thread), thread__pid(parent), thread__tid(parent));