Message ID | 20231127220902.1315692-25-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 o2csp3499834vqx; Mon, 27 Nov 2023 14:12:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEL/wOw+jBwwYkplHWeGmtLh7ucnF+juOx84bF93VgClkXxW6o5YPBZU64GyBCuqSIRR3xN X-Received: by 2002:a05:6a00:3988:b0:6be:314c:16cb with SMTP id fi8-20020a056a00398800b006be314c16cbmr17201811pfb.10.1701123138662; Mon, 27 Nov 2023 14:12:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701123138; cv=none; d=google.com; s=arc-20160816; b=TYCFGf7kXKLBKJ5ds6T9X8K64dfOZM01m31o35vN1Gge+LhnQOuQpxgzB9F3OHBqQp g+D4TlGxkqvy6ThROWphpg7I5+m2f9X8F2amnITe2MWI2teG6Smbzx1NOlsXINDKaSAg ny6aeGUJOLM15c9qym4BmrWlzz/Dl3Fw+cDjy5TSyUNfCHk5XmKUU63BvE8SI6Twg/Mm KuN07fB/NLxu+MFEhBmF/JguZIao0EPtGIjnTISh6n36cP0kKCKlN53Me5d9174kZFja xUyG/qiwnEvCtvZFleFDn8E+6phR0LarTTKDDZ+xOTZbRhUuISuyaTd0RlSwWA0dpyra e1TA== 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=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=OzNqICyo21UxGXQaf0HwgufcoG/lXzbmF7gaE4L7DUNdhr3OrMoPJuM3K4Uj3o/sS/ zv+a3KW98mAQ4QJ8BqLDlGtDXfa9fhdWX8giW7x/hx/fBLZFqSGxNEIdE5Db5LAjlpw/ QoibXlm0sZU9sARNckfmAfw+5UYapw2++o/7+8TMGl4krPvtk+MsP22xCibbxbcmg9nT BSERWDFadZLvfxr/PAvIHeG8pQdD0Lgb05UjHHOixojjIh0R3GPzt/GjbFGjinM49mYo 8JrFrZZ+RZr45PgrM5CVuM5+IWk++abxuSJ66eCmyzSohagtGDFC3t2ZI7/RcwuVlEqt FQ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ErWAzoVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c12-20020a631c4c000000b005b918d9a3c2si10671571pgm.868.2023.11.27.14.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:12:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ErWAzoVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3227A822C616; Mon, 27 Nov 2023 14:12:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233672AbjK0WL5 (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Mon, 27 Nov 2023 17:11:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234232AbjK0WLK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Nov 2023 17:11:10 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADE126A9 for <linux-kernel@vger.kernel.org>; Mon, 27 Nov 2023 14:10:19 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d032ab478fso22187397b3.0 for <linux-kernel@vger.kernel.org>; Mon, 27 Nov 2023 14:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701123019; x=1701727819; 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=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; b=ErWAzoVPnxhfE/+Z0Z8PJqkWEZp4g33EG283ml20WLX1eLobk99N90+qC4bcNfDOUd oQFCk1EUMQdMP0UTxmdrA1tk9O8AgpjA+HT6NTC1fjZLxA85zBkGRKBHdp3QQ6vqQdF+ LrzWutE9nG+88FZ2ReQLSrVpPy2DFXRfE7658E9fe8pUvIr8eThJZeofHy3bQptS/ArC SyEKWIZQ6Gc/xMWFn9fxoakiQKJCUTo+vhvAjfaeLalwGQRdhxObBWb7qOqcl36PWy95 FIbJJMzXZIji71S2IwxUnUnwc1mkL12ZDaTYyTXriaNlo9Vf5Fq7c0lopW39j/PUrkBm veyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701123019; x=1701727819; 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=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; b=bnEGfDjA48qeTHm6C9TgKwgSqhW3M3aCrsy4KLPPjaYMw5J69MV297PtphDwkOa6cu /vBevrTvoO2HMr2zaZOrKTNURGUmh1DECjuKro2OQE3/XTMMf+C9PznPdDN7APO5Fu5x fvSWROHK3HwJibQwg8SbXd7lp1imkc7DCNqpAOSI49nq/R7FanANXHpmwUIweEIX6FBk NTriiVRhjmZNoo3gGDemCkkIyd2THQ/4L2Q+l0knbMfg8DX1La+eTYKVqiLXTOoASTIb +fTgG+5LNc8O69yHIM/q38OxGpKaj+yglVlavnzDGEog/77Gdd8Ypvapw/ynFMxOCL6F /UaA== X-Gm-Message-State: AOJu0YxPSAieSlPGLQVwjvpDbYHMWdwXW9oWI9SZ7Ymh16Qt7QH9BtwZ JkGaROYliaH6inZJu0cwTqVWRzg/PXkJ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:829:6e77:9093:f39b]) (user=irogers job=sendgmr) by 2002:a05:690c:811:b0:5ca:f8cb:181d with SMTP id bx17-20020a05690c081100b005caf8cb181dmr425176ywb.3.1701123019001; Mon, 27 Nov 2023 14:10:19 -0800 (PST) Date: Mon, 27 Nov 2023 14:08:36 -0800 In-Reply-To: <20231127220902.1315692-1-irogers@google.com> Message-Id: <20231127220902.1315692-25-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 24/50] perf maps: Fix up overlaps during fixup_end 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 27 Nov 2023 14:12:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783756896524446346 X-GMAIL-MSGID: 1783756896524446346 |
Series |
Improvements to memory use
|
|
Commit Message
Ian Rogers
Nov. 27, 2023, 10:08 p.m. UTC
Maps are sometimes made overlapping, in particular kernel maps. If the
end of a map overlaps the start of the next, shorten the overlapping
map. This should remove potential non-determinism in maps__find, ie
finding maps by address.
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/maps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/maps.c b/tools/perf/util/maps.c index 01c15d0b300a..fba95a00ecdf 100644 --- a/tools/perf/util/maps.c +++ b/tools/perf/util/maps.c @@ -700,7 +700,7 @@ void maps__fixup_end(struct maps *maps) down_write(maps__lock(maps)); maps__for_each_entry(maps, curr) { - if (prev != NULL && !map__end(prev->map)) + if (prev && (!map__end(prev->map) || map__end(prev->map) > map__start(curr->map))) map__set_end(prev->map, map__start(curr->map)); prev = curr;