Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp100747rdh; Mon, 18 Dec 2023 12:53:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEv8Mce0I0lLg87v8TP9v8FI0zi6OEQodI353sq9BvLkFGiybhaArk9gubSJ0R7tSVFmp3v X-Received: by 2002:a17:906:3e92:b0:a1d:1be7:59f with SMTP id a18-20020a1709063e9200b00a1d1be7059fmr15267685ejj.74.1702932829922; Mon, 18 Dec 2023 12:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702932829; cv=none; d=google.com; s=arc-20160816; b=k3mSn8ysR+0s5WgMGwp11FqB0Xet1ArxzftYo58HB4vY+nwRFxx2JQMJhxSLUm9fdv 5hLC7eBcKg9UykLtZqiCNLDGvS8Zio1C+VUVaS4jVZEVh+Jeryyhu+ybMoHyi8dzOx8K sHt/T0gvdUHtg2GY90PcHTmhP/aQZZHzuQyNXum9XEfQA8PWJ1aDSaFbQexTZ4cJPCNc n9RZAoASM2v9+cnz7w52opPjOIpNb4nOvFTERVxCjGR95eVu3fHeR+ZnCemlzrMIJ7Kn 9odBVOUpju0zcy8BGOH4gBDht64EC4+Ufba5A3CX42QncXCGWfUGfCH8xwOMmynBqEla dN3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OOJerp5KgY3RBR3bTPTqxhymKaohdyNLiaFSHtfFjCU=; fh=qIobCfX76lsQY4tPHmFabU/v7o/CpMmoYC6lNgko6fI=; b=Nmw+cx6GIf+hPD/dSPs3AiwYr2TT0msxq+v2AXxf7iO5xs4FLjs+RTpadEHndRzPj+ EIg406seSfb/RqqaPV7FFfblvQ9uH2NLoKNj1j3aoF8IaTu2mn2g6pNUYrpnMlTCIqZT sdNKWaMXjfiH0a3NathaKtJ1J3hcX66H/ahuJfbnzjlgPzkpGrghfNjiDyB1zIDYtLUf ESLF+i6dn1UG5d1OzsNBif6zvJcCzkHkf1im5r/yGtuBtIDSxEIYF8g/BoDv0EXdYThC r/3VVx5rby8Ic2HwO/GxWKkgEPrXlVpPDA/QnaNpqboG/hsDybGuZJW11camlf5e7K/Z 3FhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OdDlprp6; spf=pass (google.com: domain of linux-kernel+bounces-4381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bm6-20020a170906c04600b009d464ba0b23si10301351ejb.111.2023.12.18.12.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OdDlprp6; spf=pass (google.com: domain of linux-kernel+bounces-4381-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4381-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 am.mirrors.kernel.org (Postfix) with ESMTPS id ACE931F247AE for ; Mon, 18 Dec 2023 20:53:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 573E04C3B2; Mon, 18 Dec 2023 20:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OdDlprp6" X-Original-To: linux-kernel@vger.kernel.org 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 7C0397346E; Mon, 18 Dec 2023 20:53:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA7DFC433C7; Mon, 18 Dec 2023 20:53:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702932820; bh=BMfh3lrcxmGPTr7GYpN8kaTYHMaxLq7SFzjSMIVtKgU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OdDlprp6u9LFydvgU37KF+hloZJ9RPnAoosCsP9NKtcH/Yzr9nL4GtZ/mrde8tZqG Gll8UaEkd2QLWFYOF7bIo32EAMuJtuTmyn+wrR8RRoJNqlTl6/Dd8zTHgdKxTIh1UH LN+U+khyDHIe65lhqdt/4SUHtE9HaWG8YO9RaGydx3ZiTUh4BAVWZX/v04qUrhLdYD iqpCOFC2cq7b6qcmcnf5gsfqQwWlB2cHM2DhfryZF4/piQcD82rqR1VhCQeKWieF6z gvrQoG04eHvoqo71PqPlf55NUa1HbgD9haydYU+2MSF7mZs63fGJ+eCixrZBqdxd4q O6BB4DgiYvbOQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id CBE29403EF; Mon, 18 Dec 2023 17:53:37 -0300 (-03) Date: Mon, 18 Dec 2023 17:53:37 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Guilherme Amadio Subject: Re: [PATCH v6 00/47] maps/threads/dsos memory improvements and fixes Message-ID: References: <20231207011722.1220634-1-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=us-ascii Content-Disposition: inline In-Reply-To: <20231207011722.1220634-1-irogers@google.com> X-Url: http://acmel.wordpress.com Em Wed, Dec 06, 2023 at 05:16:34PM -0800, Ian Rogers escreveu: > Modify the implementation of maps to not use an rbtree as the > container for maps, instead use a sorted array. Improve locking and > reference counting issues. > > Similar to maps separate out and reimplement threads to use a hashmap > for lower memory consumption and faster look up. The fixes a > regression in memory usage where reference count checking switched to > using non-invasive tree nodes. Reduce its default size by 32 times > and improve locking discipline. Also, fix regressions where tids had > become unordered to make `perf report --tasks` and > `perf trace --summary` output easier to read. > > Better encapsulate the dsos abstraction. Remove the linked list and > rbtree used for faster iteration and log(n) lookup to a sorted array > for similar performance but half the memory usage per dso. Improve > reference counting and locking discipline, adding reference count > checking to dso. > > v6: > - Patch 1 is a parameter name fix requested by Namhyung. > - Patches 2 to 13 split apart a macro to function callback refactor > requested by Arnaldo. > - Add fixes and acked-by to later patches from Namhyung. Applied 1-10, 11 is failing, I'll try to resolve if you don't do it first. This should be in tmp.perf-tools-next soon - Arnaldo