Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1325104rdb; Fri, 9 Feb 2024 19:18:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9VMqBW0R9E/7GHAmOpMMLJPvnsuNHOpgPEbl9o/IXRTkWSeyOKXkMYU3qPrLlzrVKDUeqcIZMPS3eNTiek0WjKj2Y7RxgEumItXN0YQ== X-Google-Smtp-Source: AGHT+IGCH5bUgmRV0zu2Gewxy8VTiUKaU5CFhqvNB7A7WoQzo5DEV1uqeSqfqrL2aplT7kp6o/+E X-Received: by 2002:a62:8491:0:b0:6e0:3cce:f70c with SMTP id k139-20020a628491000000b006e03ccef70cmr1365034pfd.31.1707535090762; Fri, 09 Feb 2024 19:18:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707535090; cv=pass; d=google.com; s=arc-20160816; b=e2/J+4EjvZQOTxWwuzTFqenVkh4KuxLlhVmvoA0FVZfFPJg1WI2/HyuHhdWaooLZW0 xlTPxKx7RaA8Ck/vQaiR1Z6fexVqha4xwkquwZpAuCvu1ZivX76WexQ6S5TzBBDH4XWR xeCJMLI3NA50HDBtnT6dF1KowTF21dbiPfsrpUmpPxbVoKInJ3QsZtGwaDM50iSNxMyg 3CFiWPRV7TqJ4sTpPdODWiiQNSz3wRrgQ8CSDUwBdHzD3raZgoovaP23OdgFtd5MVmT/ 6i2sSuHD1YgncNqJuwYTCa9nr/NrJoNVCS48BrDL3DVKKRUNfR46H+acQ64ktMCG4H/n jy3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=cyyhzZNS8ki5ynML3KytcROjeKIHNvTXQuDKrxr/+s8=; fh=7cS8PMRLmTQQsSGSEpLHCg7KMWT8kr9lAk8PfwwMrJM=; b=JQJuVJZsO0OdXSRjHj2DrwY9+svWw2Pf6q4TrLaym5ho6a4L9QYFiVzzG1F0AUgGS1 0UboGxJQzKTGfc3BSDlcyuyzKFE4cJWgu1FbkTGRp2SFZwxdf8gHuDwXWjgM+P1eCHGr FZJU2lnWbCQt9C1JkirRaozvL+H8c3tn6jVrO0F1bspgBoHlFJKHNRLoXdLNnhkmgT5U TYhcCxeyoqObvT+EttMEOhRHyO8MXtrGQ+uGvW+G2eKLqkGY7QxyIC3AwAvUN2FMdnBw 14oAPJnJdlH74aKblF6HBiFdLFwhr0Y+6Fq6PzT0PSK1LA42K452A9v87kcnslrK34ii 1xxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rkkOBcXa; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVb+9AhnufnoytrSh2nXhx7zEe7KaM+0bNqmIUI1FDZhmPu+hlV/qHMSQQmecouK2cufFKm4FfxF8QZaJYEV80lpu8I6aD0q6d0ozk3MQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y126-20020a62ce84000000b006e040ec2b59si1384322pfg.225.2024.02.09.19.18.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 19:18:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rkkOBcXa; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 614E7288B68 for ; Sat, 10 Feb 2024 03:18:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B068566B; Sat, 10 Feb 2024 03:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rkkOBcXa" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA98C33C0 for ; Sat, 10 Feb 2024 03:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707535078; cv=none; b=JT6TKnrr5dyByGp/kXekkLRaEN5E5KGzNW0YGiePnBmx8/uSch/Q9NIufmwiL/LcOjVNuCqYeq6wMWv/Ovj4puujSrl8RPNuPIuhETS2Ljuqeh7V5dhlm9KNHIcJyzcEORXVVArn+Aqpvz/dLsFqd4Qgj5fThKVOWLNSxFYUKRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707535078; c=relaxed/simple; bh=YAb4FlNOlAfLeMVXc4h45YX0N5LZt0PmJHt3lr+GdM8=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=nfd975ceoTXAqHN9lv0BOv906IhzVEgCPGHJ0KzlWGkDtgAtp6J/LoPZz2BhlB18MxJ5xOaDvdrNiU31za/ZReHtFa11hVRAIF4Fl3Jv2gErSavGrKBlhnjWrzl0GDqxNYVpCnn1goA1EID6saL7fJLB4rx9/VjjpSPsSKVUopU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rkkOBcXa; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc748365ba9so2565348276.2 for ; Fri, 09 Feb 2024 19:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707535076; x=1708139876; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=cyyhzZNS8ki5ynML3KytcROjeKIHNvTXQuDKrxr/+s8=; b=rkkOBcXaCHIJwlM/NBMSaArU/iKtllJxFbcFW8N4r95XaP38e2jJsJCHl7sAsOyIXH zuyfXB3feNtzpwyBY1ulfjoA/O/LCXJPJwhElD6vqnf72UimHIric2MzuhE88zquvSrT s1kCJ3GL5+hp+Nw5pi9TtPOVyluCaC990S26E47D27gzhl2svLH6rc3dtpFPhPKRepRK GtJFsJvkn+x6565a9pNfcbzYCExEa1WlWyXDZoVesY0BOcdDRT+jSgaKvX2jgpM3WjyH GBoL2jPRjAp5uD5hjs7ov0CSe3gDJ5XGFM8Jzs9YsjOaPq1NexUCTGWDOHx6iRayDfes Dj7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707535076; x=1708139876; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cyyhzZNS8ki5ynML3KytcROjeKIHNvTXQuDKrxr/+s8=; b=nnuETVBfl9NzHMO78E5gUhscqx1JmtzEpG+Gon12Gr/xfhJdn3nq2CfWyMmLYbs8Bn 5haVAOYNDESV6RbAvb+bbSGFfECnEoJaUCMt39yNSsH2Hew8v20wLDHqntHfitWpT/Fr L7AxX5c9QQpFhzvLyMz6g6ghIsgTfOxV3G9YrDBv8K9oCf6N9EOpJr9e5YksRlPulROd klXoSaijRr+CFqn+uyLd9hetoCZkYWGp6fe4lWPP4krY3moLkzhy6c6tnXElrstV6TV6 HpmxNEasdsL4gZAAbkhPsSJI8losVBIeLQClFUO1GYbQlWdeq5mOwrmFSBueRVbmUzef TwQw== X-Forwarded-Encrypted: i=1; AJvYcCV5+hiP3/PHra1vr7LsUmSrhwjSkbO7lEoMEfyCZklQoFchTeDe4gUIykeim8afyKw169i2E/oUF645CvsUrawwthZECGPsEe3rc17Z X-Gm-Message-State: AOJu0YxPg7Z+hg7jdE0wi39kev8RSi+hC2PaRH2KKi21rdgv1Sfo/VFN SMvhNfE84T3qhl9GzmfIjElUQvJNPE7fBW9D+NZMPVhbUt4UISwo9p1rqPUoofPhHWFCLTicX/y GJ4ut1w== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:877:241d:8c35:1c5b]) (user=irogers job=sendgmr) by 2002:a05:6902:1207:b0:dc6:dd76:34cc with SMTP id s7-20020a056902120700b00dc6dd7634ccmr31801ybu.1.1707535075759; Fri, 09 Feb 2024 19:17:55 -0800 (PST) Date: Fri, 9 Feb 2024 19:17:40 -0800 Message-Id: <20240210031746.4057262-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Subject: [PATCH v3 0/6] maps memory improvements and fixes From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Song Liu , Colin Ian King , Liam Howlett , K Prateek Nayak , Artem Savkov , Changbin Du , Masami Hiramatsu , Athira Rajeev , Alexey Dobriyan , James Clark , Vincent Whitchurch , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" First 6 patches from: https://lore.kernel.org/lkml/20240202061532.1939474-1-irogers@google.com/ v3. Fix latent concurrent modification bug in maps__for_each_map. v2. Fix NO_LIBUNWIND=1 build issue. Ian Rogers (6): perf maps: Switch from rbtree to lazily sorted array for addresses perf maps: Get map before returning in maps__find perf maps: Get map before returning in maps__find_by_name perf maps: Get map before returning in maps__find_next_entry perf maps: Hide maps internals perf maps: Locking tidy up of nr_maps tools/perf/arch/x86/tests/dwarf-unwind.c | 1 + tools/perf/tests/maps.c | 3 + tools/perf/tests/thread-maps-share.c | 8 +- tools/perf/tests/vmlinux-kallsyms.c | 10 +- tools/perf/util/bpf-event.c | 1 + tools/perf/util/callchain.c | 2 +- tools/perf/util/event.c | 4 +- tools/perf/util/machine.c | 34 +- tools/perf/util/map.c | 1 + tools/perf/util/maps.c | 1302 ++++++++++++++-------- tools/perf/util/maps.h | 65 +- tools/perf/util/probe-event.c | 1 + tools/perf/util/symbol-elf.c | 4 +- tools/perf/util/symbol.c | 31 +- tools/perf/util/thread.c | 2 +- tools/perf/util/unwind-libdw.c | 2 +- tools/perf/util/unwind-libunwind-local.c | 2 +- tools/perf/util/unwind-libunwind.c | 7 +- 18 files changed, 906 insertions(+), 574 deletions(-) -- 2.43.0.687.g38aa6559b0-goog