Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp667312lqp; Wed, 12 Jun 2024 12:25:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWJfCOgbITlCEDcUonwQh4fS0dsw74QlsVcpwJhqwXiwldZMclKirvsgEYTqIZUtMVCJnP1rHx73HebsPMmpW/qxQa2GUqnxjtlT/rXg== X-Google-Smtp-Source: AGHT+IEnb6dg1Jdp4eGAiFecAll1NkImHF7Jn0GVRq1k/VayjUiEgQdFkdz2xhcmmzUvwpy3a7pU X-Received: by 2002:a50:c19a:0:b0:57c:6b62:9c12 with SMTP id 4fb4d7f45d1cf-57caaac73edmr1761975a12.41.1718220311988; Wed, 12 Jun 2024 12:25:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718220311; cv=pass; d=google.com; s=arc-20160816; b=SBr9tj4YHx4WhUCgs1DmLG8jum65sLk4xd2gLXS53VGTNMjdu6I3dZDwuvU6yRPyQ4 TuVQtP+xr7h16z1zcAa66qaY3eAH5AyDZPCX4Hm0F8Ocb6L2UKx5LMSriEw+Kwq2B5jX tBdk2kXVaDHhSm7jP5Oi3w3Jdz+MWY42XbXFUbTRcRUBLP17qR3Y4g9gddXAhPbNZghD lKwCHE4MaGLZ/rFE38jvmkZ8f7DNPxH+xYypZn6k+iF/GNZH0qRa4LF46b2G1zqQQLZO kRvVMnYaWEmaZNLnyczcNcJqklvfUUb39zu2qsa50Bs0ZPYvc1iK8AZ5XUlDrk79rjR9 hQDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=jWCmmX4rZoxksdXiin2pRxT+7umwNDkXcLdMzcQzHbg=; fh=GRsVZ3LbbkI/gVBXWQndRAZ7VewXgUfmjHRy+KzzrfU=; b=Ale1yL7NdsVRSyn35tD3R2MGDTZSEGLYD205E/BhtBWwDw5IQBo1NDZlS+iQf/hZAn LZY4iSWpK+f9WS7XdbM9S8x0nvjM4enii1l7bfPMtGrQOCHBA+j5odXW9cEITNUhMDJ3 ohizJvyLRxhFG7iSqpbAIm6jGMCtHo7m+h9EGkqJt21meHWv1HTr+rALVix62m5W2OAE E38E2FBTE3KDrGtpVu+OuVNcDC0CX6/DtHbo56KqHTr4RXm3TPltr4Uc9/VYcDREsad3 7rW9xetp8BDINJQOvGQzzxlwByQyB4O/2SuP0cQxWNSqCIdRLJXpjB2GRTNFpHXrRSq/ 0/BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XxHFU93b; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-212152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c9c08cb03si1933640a12.257.2024.06.12.12.25.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212152-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=@intel.com header.s=Intel header.b=XxHFU93b; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-212152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id B24901F2174F for ; Wed, 12 Jun 2024 19:25:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A06082D7C; Wed, 12 Jun 2024 19:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XxHFU93b" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 77D09374D3 for ; Wed, 12 Jun 2024 19:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220304; cv=none; b=abJyy26NnltvpXA7JjC7Tb/POIB07hZtzRhxuhlp+Kqg3ptWurZlt54PSQv60gWbNXfP9+Ft8oEFTRcSuTCgiVrYHfhz3uNdXxIp7oLkDdKWI1cArVtLsKF6fBAUgXipZ/g0uULpNC5vEQBp0OMSGl2q1vGuL0JkDPVV+rm8ueE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220304; c=relaxed/simple; bh=41SN8wSL+X2t9A9vIBcjZFbmHv4FF5tpD1VJTgb0HSI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=p1W0ejnQoa8iT0ItIdvyHdnb/ZFt8wMsyN0+cNzYrzhLvoBACZtoEJutzA9D/4o8e4L+HVOP6GiGOSvz7NojJIN89dI8WqwYJ2gqhe0bGwZLT1/8eiDnIYWuXvV7GfNDqpqpF49Lx5MV4zEYPW7kNUM5TifGN1aP/dxAOeeJJOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XxHFU93b; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718220303; x=1749756303; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=41SN8wSL+X2t9A9vIBcjZFbmHv4FF5tpD1VJTgb0HSI=; b=XxHFU93b66BCkVpu//UP/eG33VDVhCUnlrtinz851eoZGzidvV8hfEql ieFFuaFAr7ESybruyjuwfAI+IGtpXKOr+imdc5RE6j5ijp3ShcJH+C9P+ rsR8QOnQ7MKgSI2wl2ryb+oYFXMK7oAPNzQYGX5ExbMAMMurHPelIFsmp D0sTwUjEwXBy7SykhRr14m9fTF9PSHrG5qj94ns4gMv0PgKpQpUajSUPH f9q/XgPWkkiqIxsKo6kXhyuq9/CQdUg7ItXOsIblvQQqFKHpyFdavajnj +6UxttNalU1oPczNDViE4nfZYBK0y18jAMrcaRBR9YfYjPnDIUb892fZx w==; X-CSE-ConnectionGUID: 49c0n7VzS+eu9nwvglXlgA== X-CSE-MsgGUID: BBZG9dEkQvCOz71L7uC83A== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="14808352" X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="14808352" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 12:25:03 -0700 X-CSE-ConnectionGUID: Hf7lEjKRSQO/8ACZ7OTJzQ== X-CSE-MsgGUID: DS/EaCFbRbi00biEsCDEGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,234,1712646000"; d="scan'208";a="44280121" Received: from linux.intel.com ([10.54.29.200]) by fmviesa003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 12:25:02 -0700 Received: from [10.212.90.179] (kliang2-mobl1.ccr.corp.intel.com [10.212.90.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 4C89220B5703; Wed, 12 Jun 2024 12:25:01 -0700 (PDT) Message-ID: Date: Wed, 12 Jun 2024 15:25:00 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/8] perf/x86/uncore: Save the unit control address of all units To: Tim Chen , peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: acme@kernel.org, namhyung@kernel.org, irogers@google.com, eranian@google.com, ak@linux.intel.com, yunying.sun@intel.com References: <20240610201619.884021-1-kan.liang@linux.intel.com> <20240610201619.884021-2-kan.liang@linux.intel.com> <0f1ba5d8ecc62f774590077b2f88f5b64dd98452.camel@linux.intel.com> <47fad008a152957c87e9846fdbf40746b6e2871a.camel@linux.intel.com> Content-Language: en-US From: "Liang, Kan" In-Reply-To: <47fad008a152957c87e9846fdbf40746b6e2871a.camel@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2024-06-12 1:33 p.m., Tim Chen wrote: > On Wed, 2024-06-12 at 10:49 -0400, Liang, Kan wrote: >> >> >> The id and pmu_idx+die can all be used as a key to search the RB tree in >> different places. >> >> The id is the physical ID of a unit. The search via id is invoked when >> adding a new unit. Perf needs to make sure that the same PMU idx >> (logical id) is assigned to the unit with the same physical ID. Because >> the units with the same physical ID in different dies share the same PMU. > > This info about having same physical ID implies the same PMU > is worth mentioning in a comment and will be quite helpful in > understanding the rb-tree organization. > Sure I will update the description to explain the choice. Thanks. Thanks, Kan > Thanks. > > Tim >> >> The pmu_idx+die key is used when setting the cpumask. Please see >> intel_uncore_find_discovery_unit_id() in the patch 2. Perf wants to >> understand on which dies the given PMU is available. >> >> Since different keys can be used to search the RB tree, I think one of >> them has to traverse the whole tree. At the stage of adding a new unit, >> the tree is not complete yet. It minimizes the impact of the O(N) >> search. So I choose the pmu_idx+die rather than id. >> >> Also, the driver only does once to build the tree and set the cpumask at >> driver load time. I think the O(N) should be acceptable here. >> >> Thanks, >> Kan >