From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org, Fenghua Yu <fenghua.yu@intel.com>,
Reinette Chatre <reinette.chatre@intel.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
Peter Newman <peternewman@google.com>,
James Morse <james.morse@arm.com>,
Babu Moger <babu.moger@amd.com>,
Drew Fustini <dfustini@baylibre.com>,
Dave Martin <Dave.Martin@arm.com>,
linux-kernel@vger.kernel.org, patches@lists.linux.dev
Subject: Re: [PATCH v2 1/3] cacheinfo: Add function to get cacheinfo for a given (cpu, cachelevel)
Date: Thu, 6 Jun 2024 12:31:01 +0200 [thread overview]
Message-ID: <20240606103101.GAZmGP5Y6389EvCb8S@fat_crate.local> (raw)
In-Reply-To: <20240605161427.312994-2-tony.luck@intel.com>
On Wed, Jun 05, 2024 at 09:14:25AM -0700, Tony Luck wrote:
> /*
> - * Get the id of the cache associated with @cpu at level @level.
> + * Get the cacheinfo structure for the cache associated with @cpu at
> + * level @level.
> * cpuhp lock must be held.
> */
> -static inline int get_cpu_cacheinfo_id(int cpu, int level)
> +static inline struct cacheinfo *get_cpu_cacheinfo_level(int cpu, int level)
> {
> struct cpu_cacheinfo *ci = get_cpu_cacheinfo(cpu);
> int i;
> @@ -124,12 +125,23 @@ static inline int get_cpu_cacheinfo_id(int cpu, int level)
So:
lockdep_assert_cpus_held()
?
> for (i = 0; i < ci->num_leaves; i++) {
> if (ci->info_list[i].level == level) {
> if (ci->info_list[i].attributes & CACHE_ID)
> - return ci->info_list[i].id;
> - return -1;
> + return &ci->info_list[i];
> + return NULL;
> }
> }
>
> - return -1;
> + return NULL;
> +}
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2024-06-06 10:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 16:14 [PATCH v2 0/3] Add and use get_cpu_cacheinfo_level() Tony Luck
2024-06-05 16:14 ` [PATCH v2 1/3] cacheinfo: Add function to get cacheinfo for a given (cpu, cachelevel) Tony Luck
2024-06-06 10:31 ` Borislav Petkov [this message]
2024-06-05 16:14 ` [PATCH v2 2/3] x86/resctrl: Replace open code cacheinfo search in pseudo_lock_region_init() Tony Luck
2024-06-05 16:14 ` [PATCH v2 3/3] x86/resctrl: Replace open code cacheinfo search in rdtgroup_cbm_to_size() Tony Luck
2024-06-06 12:43 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240606103101.GAZmGP5Y6389EvCb8S@fat_crate.local \
--to=bp@alien8.de \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=dfustini@baylibre.com \
--cc=fenghua.yu@intel.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.wieczor-retman@intel.com \
--cc=patches@lists.linux.dev \
--cc=peternewman@google.com \
--cc=reinette.chatre@intel.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®