Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp8494lqn; Thu, 11 Apr 2024 12:01:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwgu2J/6p1rCjREnviXdys1vXDeKJZeFWE+rH4/Pn2UXN6bU1dQaDf8YEo4a0xt9vcVNAWKYRCjobgPtJ+xYWDKnpDIBYyJtnBMtRMjw== X-Google-Smtp-Source: AGHT+IEskrPPU4gdA43Vb4agZ8lu1ucwz/JEtM+PuvuAX82p6OOKEDxoN4LxxU05Q0FgQAje9LAr X-Received: by 2002:a17:906:80c7:b0:a52:2e54:7022 with SMTP id a7-20020a17090680c700b00a522e547022mr358717ejx.10.1712862095204; Thu, 11 Apr 2024 12:01:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712862095; cv=pass; d=google.com; s=arc-20160816; b=QOArmdspeBWw8xg4UL9ZhE6yurwX5liylZguEtQ0iq6XqyVVd3H32loPER+JgbdjJ8 gPrb39j4DGDjWl6lOqwb91YvrI+KMGcc6Yp2sVQylTGtg9Z7H44EmcO29ryn/h8InvCU 0cEtT/KzS5AYsEG1uHF01KyRFabX10f974nJOHEjBztkbExYg/H/oXPUQiHrc2jDhwDI MM82t4RHOlTkpZQfdptfysRatO8Oye3qQ8mOusAoB46BSqO7N28xWkAVTol9tTokPFsp d67mzrZ0sz9/YtUanq8744jEA0h4ES15lFtkNuyIy5BD1Hf75fiOiCbpLNAQOFDwxf+P KgZg== ARC-Message-Signature: i=2; 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=dJHp7dWjWxBQqluP2nfD+JrDDZAiNq4FVSuQTgFsfC0=; fh=AO6Uv0PngYn5ks7fI8scLrHkKY0NaNoxX4oDTEr2pCE=; b=yv48OTsh7pH43SDRvqqoxGudwDSfRP8BLqBA1MdrCg++t2SrdoO9MWUr2ADI/apY9k D2NSG2WkQcwFrtSX8IMIQFQp3Pboei1FOiUOrYyrAOnY8rVk4IflvCVCsX30aXJsawN9 9bYBOOXAB0q8IqCzPYOy4r751GkI1rni+s0L8vdttXIf0EVCc3iDPNRLmGgiCcsbY8D6 RXv0N6OeKzRpFXv7uCgKr6JtJ3k1lWu+bZ9lrrycgsQIFGhZE7CBqE/XtwVTgujgDS2G cS6EectFiMmcX3OEYsTdHw3P0mc5SW0laISzJKi/OM4pGnQUZJM5y/Klg3LYUjr/a487 DM5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AgYbnuYC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141485-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 do9-20020a170906c10900b00a4e148f0297si986908ejc.497.2024.04.11.12.01.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 12:01:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141485-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=AgYbnuYC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141485-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 E5B131F2B235 for ; Thu, 11 Apr 2024 18:45:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0372915E8C; Thu, 11 Apr 2024 18:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AgYbnuYC" 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 1D7DE1863B; Thu, 11 Apr 2024 18:42:30 +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=1712860951; cv=none; b=Y6hdvK/IiZ/MLbSWLGOKyUFjs3msHT6kBiRLZyS9F+gqpgUrpnhKVKUZ8x5gMwpmsOxMlw+qUC6v0PzFHBzPQzV8ffB3J7MPv17l19zd7iAiGyCrReKoGO3KoZO0j0xVMAKydYsQ6svM/pR3U+cWpOrjF9Y9fedr05aSdR84r94= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712860951; c=relaxed/simple; bh=cNhplYhRegzLVfwCwfg5gMJlYQSZzSjONHOCJSpflbw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SIlWiJwQvBr4CK0c42f84kI5LYt+er0L0nFpZx6TxgFcO1FZfgQbTlGte1A3hPqapYtv6yz6LpzRlGxFAgmfUql7Ek/aBOTY8aK9VH5B30D0Q1Ncr0qasu6yXIrmPmUmw+8eIQ5uvvgXGPchOIxu88/DDDHuj7iWWc1xQvXCRRg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AgYbnuYC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B40C072AA; Thu, 11 Apr 2024 18:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712860950; bh=cNhplYhRegzLVfwCwfg5gMJlYQSZzSjONHOCJSpflbw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AgYbnuYCc0JMHo7uYHO+6QPnfpboeaRS0PaGEwuP82rrgxX2VbGPLTYXeG5Jl5Gno tmAz1OwNaUIuEdInYEtmBWThstsKGyxKqxx/KbgxT/KfJW6PGEdOyg6el7+67T/6eB 8Z32NOBritWtHec9WmFwsUhI+v4YDXC4kp9D4BlioNjU2AC6nMXxgaYgR8zylEaLRN wfxeg52DgHDYuRu7HzlJ4WVbK4MEkI8uGENf4Gij0UomdzlxHXoIvCS370y1MWJxUA R07NGa+iIMaswbN5Psz9l+ymZIfH0ycLV9ylYfUPraTKffS+ULtuv45bwZqlBTNnv7 hrYeHRm2ptkgg== Date: Thu, 11 Apr 2024 15:42:27 -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 , Leo Yan , Song Liu , Ilkka Koskinen , Ben Gainey , K Prateek Nayak , Yanteng Si , Yicong Yang , Sun Haiyong , Ravi Bangoria , Anne Macedo , Changbin Du , Andi Kleen , Thomas Richter , Masami Hiramatsu , zhaimingbing , Li Dong , Paran Lee , elfring@users.sourceforge.net, Markus Elfring , Yang Jihong , Chengen Du , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v3 00/12] dso/dsos memory savings and clean up Message-ID: References: <20240410064214.2755936-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: <20240410064214.2755936-1-irogers@google.com> On Tue, Apr 09, 2024 at 11:42:02PM -0700, Ian Rogers wrote: > 12 more patches from: > https://lore.kernel.org/lkml/20240202061532.1939474-1-irogers@google.com/ > a near half year old adventure in trying to lower perf's dynamic > memory use. Bits like the memory overhead of opendir are on the > sidelines for now, too much fighting over how > distributions/C-libraries present getdents. These changes are more > good old fashioned replace an rb-tree with a sorted array and add > reference count tracking. > > The changes migrate dsos code, the collection of dso structs, more > into the dsos.c/dsos.h files. As with maps and threads, this is done > so the internals can be changed - replacing a linked list (for fast > iteration) and an rb-tree (for fast finds) with a lazily sorted > array. The complexity of operations remain roughly the same, although > iterating an array is likely faster than iterating a linked list, the > memory usage is at least reduce by half. Got the first 5 patches, would be nice if more people could review it, I'll try and get back to is soon. - Arnaldo