Message ID | 20231102175735.2272696-28-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp536470vqu; Thu, 2 Nov 2023 11:02:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgbk9++dAowySeyxw4/DdzSWwpaYenq9MWv/nhlOkpPfFptOirspEeSF4necJce8qYTEWw X-Received: by 2002:a05:6358:2917:b0:168:dd37:172d with SMTP id y23-20020a056358291700b00168dd37172dmr25039984rwb.20.1698948157379; Thu, 02 Nov 2023 11:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698948157; cv=none; d=google.com; s=arc-20160816; b=Brpx5iGJsKWAdMrw1HanPGTeknHK+2RemGSKLAw1RM9YBdGj6vYGqVZKW9CWAfZ7IA QEEqQzi2W2YxqBE1EqDbhjkvNNLGV9eEMTWsPlW58CFK06fUlB4GzHjIOeIH+uRhakdE a5SgE4oKGjiJn3VFSeBDP55mFwJC/uBKBnN2oOtWOeJOrnQz26pwG6mHt8L3mpFxka/e fIGnmA4nDV1AmGI0hHoUUQl2NxLxn3MukobO6wm7Oc5w52jB6MgRB5skxr/gcTLD+KXI 8dbAs64vDbkVhI/bnGzzSOfmwUWX5Swn2l4DtC1xW3ecsWKqyqg5G2QHQ+LjuV0l3Ib+ nbDA== 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; fh=z1KcSqUpYQ9oC4uLSeIkhAYTnJ2bvP0QbNW2xqV5NqA=; b=UQ+5iO7/0I8UmjYcUsqPLrSY6HVh8s9aneoOl6ZA54P+Aau3+YAgIOyHJ5RQHLYMqf WUX1U4LJ7UIQgqZ17xZBI367BgcfEYkFmMWEcG7J17WqI/3UmlvaqxapikMqpkp8a4fE W95yBY83iXCgm7FkKx1muPkUpFR1J6d9RMo6ou2avOQf5iFlMGxPxWNir9ih48fev5Ax 8f0J6hea84ujmM1+X3ryq4k4LJ7+TYtYsxil6C6m05kYc4CksVzfkQFOVQ/x71f18IGa kR/Ho8fC83KbGEriYXtx82TlCvqhEeUFVeXEVfO/6iNrnT5MSYTJcPEm4FZVIM9nRghz RK2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnWi1pUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x5-20020a654145000000b00588fa0def1fsi51523pgp.774.2023.11.02.11.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 11:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnWi1pUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 510AA8211437; Thu, 2 Nov 2023 11:02:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345278AbjKBSAe (ORCPT <rfc822;heyuhang3455@gmail.com> + 35 others); Thu, 2 Nov 2023 14:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345059AbjKBR7u (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Nov 2023 13:59:50 -0400 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 DEC53D77 for <linux-kernel@vger.kernel.org>; Thu, 2 Nov 2023 10:58:58 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5a7af69a4baso17193977b3.0 for <linux-kernel@vger.kernel.org>; Thu, 02 Nov 2023 10:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698947938; x=1699552738; 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; b=CnWi1pUOApOSGz7yPQQN2/n66MaHAO7Hjl2ZVWURDfA5rrkBZPFC1ahMouJimPDjaU AxO37SZ/AXfly5TXSnzvXhQJgcbmM0mqVIY+Rvt37lWITKM0bJp4di7KWDcSB1xnnKYr xvJBjsiHNJGS+/KlnxG7SsQVZcZTUHtXi5bjm4Pw/NB4BtZMUrq+ypP1jrumyV9modXO 3sQgVJq1ji87YThnejgrDysCajgLCD3J8ObCbu2rPXOuBxGUjBN6Rmxt5YTwOhkBW/DQ j8XjmsqRn/2r7Nktof5dpjCoSv97OP7WvcWloP/Ik4VL+i9e9dOt1oDi1Yohm72JiGUs ihBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698947938; x=1699552738; 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; b=crYhmgTtaxzoW+AbN/LN6NMh/ByMxQeVaT+6s+3Z87bZXjZZn++Y5hjRY/WkDJYqlA 4GZFc1LFXCMPTKb2PpP49gTnUdNQnpYMDQ2QLWhjhWMJQ5OIUbd05hJIAVlKSDkFQ9sy A/Opywz4jo+UzXpyUjgjsZb+mJQoPDSyHZzugMEWrbtZZqyPPKE9R76GdJu/jCZca4I/ omnxU678+IO2DSM32c0u4hq2y2K5qmi3qYwxLe83AhioGfktPBquOVFqrMmPy0OJ2LDB NrxWo0oJLsLK8jJSPJW2Z8BwTB5OlhGrlx1lVT4BESisqbviCxAdz6/F8wlI0MdhmBD3 15RQ== X-Gm-Message-State: AOJu0YyeRSe7f7sU5IsAidNbKNwYYf5ELnTxs+OrMqtSpL8Rk8NPKiro XYXfADzGGyCsG1AEquhc+87t3FsP3RHF X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:bb34:df9c:836c:afca]) (user=irogers job=sendgmr) by 2002:a05:6902:1083:b0:d9a:c3b8:4274 with SMTP id v3-20020a056902108300b00d9ac3b84274mr460470ybu.7.1698947937955; Thu, 02 Nov 2023 10:58:57 -0700 (PDT) Date: Thu, 2 Nov 2023 10:57:09 -0700 In-Reply-To: <20231102175735.2272696-1-irogers@google.com> Message-Id: <20231102175735.2272696-28-irogers@google.com> Mime-Version: 1.0 References: <20231102175735.2272696-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog Subject: [PATCH v4 27/53] 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 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 11:02:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781476262856917412 X-GMAIL-MSGID: 1781476262856917412 |
Series |
Improvements to memory use
|
|
Commit Message
Ian Rogers
Nov. 2, 2023, 5:57 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;