Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp549986lqh; Sat, 4 May 2024 11:28:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqocBs+YYljnX1Csz0hTLF0LgjNb3/pOJ0E6Ig0iynHUAgXFmtsx7DykK7F9EfcIizncsjT+0y3GDqBfORMaFFJGe+QxViDbRQPnEKdQ== X-Google-Smtp-Source: AGHT+IHzUIC9Ef7q2HvjC9ib4T2JSR23/XxcARhBzJdoa8XUSLP60msoHcEYp5qFp6sQdeDJ4V8n X-Received: by 2002:a17:902:ac98:b0:1ea:274:756e with SMTP id h24-20020a170902ac9800b001ea0274756emr6245607plr.21.1714847327423; Sat, 04 May 2024 11:28:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714847327; cv=pass; d=google.com; s=arc-20160816; b=ZrCQ0R4qh0+Zb5T5PIq/WxC42xVzVkfB6oaOhEaN/fAlFrV2MDE6qvFuzcebXvD/+W VuRvfWAMCBeNfil32dr6TZ6Umyfffb8ScGmGCf/Xq2bSGw9l0k2InFlYY6D7cSwE4/7H tBJhfJ8GJ/P5sNS2YpclR2UDdv+A25DF+YTGO5Bt+YfS52H1MDRFELcZKAAC5mc+c+v0 C8LB7GZFkp8FoQR6+I0fFWS/jVksz79yTAiRaWkeapMIFWhhVrFEeHujQMDED65ECsYP e2l12rI0jG34iC8vOQsByRcfGJK+knQXtdqbQJFaU/kntr6gUoeVPR7A68wIxhdCEllC 1BAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mu8djlpjhOr3+Bkp+RECRUgl0c8DHDiC3lU628vFBik=; fh=UCU3EhESkP2SshmIZBEne0f1uJdGn7sFilx7Bvi0IZI=; b=qxW+j3ppHMPeTpM+vV0ldU98MiQmd5hyF8zjquGPmD6P67QbljOqI5mVQCbay2GRWu S6yPBLDyz0+/V8jGfsNWv+3Y3418ia5Y1mpbFxmzYMAfK9/CJxJwPLevS3RhN3u5jtkg L9dozr5omTdIS5nNDZmIXcr4LWcyAeSaRknaNIS5MH/iB6+US8HgkyRV12ItsHmkSfpE qbuXUdud00c1tDde4QyoHW/adjOtYlG4oVvBdNEIsjsVoXnKqJQF4tjLaa1OltPsloGe cjg+K2rvLmOi/I7zfyWdLe3aLzJHTZIMGH5AmjT7I2D8r52i1BOF3ps/cKDFJJhhBbhF noVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=icYxfyOv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p11-20020a170902e74b00b001ec9b4f7ab4si5384940plf.30.2024.05.04.11.28.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 11:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168785-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=@kernel.org header.s=k20201202 header.b=icYxfyOv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 D82B9281C31 for ; Sat, 4 May 2024 18:28:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF5E874432; Sat, 4 May 2024 18:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="icYxfyOv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 024855A0F9; Sat, 4 May 2024 18:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714847320; cv=none; b=i5BFwm3z43TeqIT/KTFcZsp0jEiSdeHNK5f6pYw8+LfNAxgVrFkt598jPFhn5IVhqgrSDFbZYj62vkryqmqe8sjBLf5WZiKGGv+4Y/aJGBF9Cgq76prgo3p3tAt/reWZioZsAyy5UYm+T4cLrwUulERLYd7N13pNsFKueSpn3Uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714847320; c=relaxed/simple; bh=hYXK12g+YXp0eom7ZGnE3hBz1pg4fXoYGSAa74G/OX4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PTB2BBy1sjfJ3hqwxUbT+mPLzEk4UmiV59mrnVePHteSg56mrzYBzG/iqeVXzQtu3yvbNPfidFVA31UDH/dIpCGVkLLpUQjwBEN/WV/jPgd2yZwaImVr0zfD9DG8uo4njifJRTOagNS2VwlssXyjwF92f5GJerlWNZ2fzhDFZkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=icYxfyOv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EB41C072AA; Sat, 4 May 2024 18:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714847319; bh=hYXK12g+YXp0eom7ZGnE3hBz1pg4fXoYGSAa74G/OX4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=icYxfyOvdKDIfgLpmhna3a0Ie3WKU3VqPYqMKrMD1CSQUtIjTKwAXcJ9isKwL05xa 54MtGgLbephJUVDNHNFctzGVovj+EO9BT3hXHsYy9vcm5/dA23QAesfdgTqIdQCTqR D4SnhDCtHNLx83wqKqXNarZcX3seLDjVD4OyHHVfCs90R18qrtAaCVJw89oYssVfi6 A3t1HQvT6vRHB/RnRNd0pz/UrmZ7PvgO51lTX+2SRbGrfHr5XhtkjjSwBH1lce+BVT u81iGRSCQ8mxSv5zTVLi2daeDK5JTo/UU7FvQjgfbyD+Wj5GYcxMGI1LKWagU1TKhu xyOgw6Hp1y8vg== Date: Sat, 4 May 2024 15:28:36 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , James Clark , Athira Rajeev , Colin Ian King , nabijaczleweli@nabijaczleweli.xyz, Leo Yan , Song Liu , Ilkka Koskinen , Ben Gainey , K Prateek Nayak , Yanteng Si , Sun Haiyong , Changbin Du , Andi Kleen , Thomas Richter , Masami Hiramatsu , Dima Kogan , zhaimingbing , Paran Lee , Li Dong , Tiezhu Yang , Yang Jihong , Chengen Du , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/7] perf dsos: Switch backing storage to array from rbtree/list Message-ID: References: <20240429184614.1224041-1-irogers@google.com> <20240429184614.1224041-2-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, May 04, 2024 at 11:14:52AM -0700, Ian Rogers wrote: > On Fri, May 3, 2024 at 1:21 PM Arnaldo Carvalho de Melo wrote: > > On Mon, Apr 29, 2024 at 11:46:08AM -0700, Ian Rogers wrote: > > > DSOs were held on a list for fast iteration and in an rbtree for fast > > > finds. Switch to using a lazily sorted array where iteration is just > > > iterating through the array and binary searches are the same > > > complexity as searching the rbtree. The find may need to sort the > > > array first which does increase the complexity, but add operations > > > have lower complexity and overall the complexity should remain about > > > the same. > > With just this first one applied: > > ⬢[acme@toolbox perf-tools-next]$ git log --oneline -10 > > 325557715f1d8593 (HEAD) perf dsos: Switch backing storage to array from rbtree/list > > 7b6dd7a923281a7c perf pmu: Assume sysfs events are always the same case > > 6debc5aa326fa2ee perf test pmu: Test all sysfs PMU event names are the same case > > 18eb2ca8c18f0612 perf test pmu: Add an eagerly loaded event test > > aa1551f299ba414c perf test pmu: Refactor format test and exposed test APIs > > 785623ee855e893d perf Document: Sysfs event names must be lower or upper case > > 97c48ea8ff1cd70f perf test pmu-events: Make it clearer that pmu-events tests JSON events > > 3cdd98b42d212160 (x1/perf-tools-next) perf maps: Remove check_invariants() from maps__lock() > > e3123079b906dc2e perf cs-etm: Improve version detection and error reporting > > bc5e0e1b93565e37 perf cs-etm: Remove repeated fetches of the ETM PMU > > ⬢[acme@toolbox perf-tools-next]$ > > root@number:~# perf -v > > perf version 6.9.rc5.g325557715f1d > > root@number:~# perf probe -l > > DSO [kernel.kallsyms] is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/drivers/hid/hid-sensor-hub.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/drivers/hid/uhid.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/drivers/net/tun.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/fs/overlayfs/overlay.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/net/bluetooth/rfcomm/rfcomm.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/drivers/input/misc/uinput.ko.xz is still in rbtree when being deleted! > > DSO /lib/modules/6.8.7-200.fc39.x86_64/kernel/sound/core/seq/snd-seq-dummy.ko.xz is still in rbtree when being deleted! > > > Right, we don't have a test on this and this motivates the addition of > reference count checking on DSO in the later patches. With the series > applied, fixing the rebase issue, I see: > $ git log --oneline > eabe5dd91331 (HEAD) perf dso: Use container_of to avoid a pointer in dso_data > fd47ec98a05c perf dso: Reference counting related fixes > 962af2d2b092 perf dso: Add reference count checking and accessor functions > 48664a9a6ca4 perf dsos: Switch hand code to bsearch > ae7a9854dabd perf dsos: Remove __dsos__findnew_link_by_longname_id > e616a6b3739d perf dsos: Remove __dsos__addnew > e789368716dd perf dsos: Switch backing storage to array from rbtree/list > 7b6dd7a92328 (ptn/tmp.perf-tools-next, ptn/perf-tools-next) perf pmu: > Assume sysfs events are always the same case > ... > $ sudo /tmp/perf/perf -v > perf version 6.9.rc5.geabe5dd91331 > $ sudo /tmp/perf/perf probe -l > $ > I'll see if I can find a fix to backport before sending a new series > to work around the 2 line rebase conflict. Thanks a lot for doing that! - Arnaldo