mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, Huacai Chen <chenhc@lemote.com>,
	Vladimir Kondratiev <vladimir.kondratiev@intel.com>,
	Paul Burton <paulburton@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 1/2] MIPS: cacheinfo: Add missing VCache
Date: Tue, 3 Nov 2020 13:40:16 +0800	[thread overview]
Message-ID: <79476b22-04ef-968b-584a-10aa4357ee6b@flygoat.com> (raw)
In-Reply-To: <20200821165539.GA15948@alpha.franken.de>



在 2020/8/22 0:55, Thomas Bogendoerfer 写道:
> On Thu, Aug 20, 2020 at 08:42:49AM +0800, Jiaxun Yang wrote:
>> Victim Cache is defined by Loongson as per-core unified
>> private Cache.
>> Add this into cacheinfo and make cache levels selfincrement
>> instead of hardcode levels.
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>>   arch/mips/kernel/cacheinfo.c | 34 ++++++++++++++++++++++++++--------
>>   1 file changed, 26 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
>> index 47312c529410..83548331ee94 100644
>> --- a/arch/mips/kernel/cacheinfo.c
>> +++ b/arch/mips/kernel/cacheinfo.c
>> @@ -35,6 +35,11 @@ static int __init_cache_level(unsigned int cpu)
>>   
>>   	leaves += (c->icache.waysize) ? 2 : 1;
>>   
>> +	if (c->vcache.waysize) {
>> +		levels++;
>> +		leaves++;
>> +	}
>> +
>>   	if (c->scache.waysize) {
>>   		levels++;
>>   		leaves++;
>> @@ -74,25 +79,38 @@ static int __populate_cache_leaves(unsigned int cpu)
>>   	struct cpuinfo_mips *c = &current_cpu_data;
>>   	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
>>   	struct cacheinfo *this_leaf = this_cpu_ci->info_list;
>> +	int level = 1;
>>   
>>   	if (c->icache.waysize) {
>> -		/* L1 caches are per core */
>> +		/* D/I caches are per core */
>>   		fill_cpumask_siblings(cpu, &this_leaf->shared_cpu_map);
>> -		populate_cache(dcache, this_leaf, 1, CACHE_TYPE_DATA);
>> +		populate_cache(dcache, this_leaf, level, CACHE_TYPE_DATA);
>>   		fill_cpumask_siblings(cpu, &this_leaf->shared_cpu_map);
>> -		populate_cache(icache, this_leaf, 1, CACHE_TYPE_INST);
>> +		populate_cache(icache, this_leaf, level, CACHE_TYPE_INST);
>> +		level++;
>>   	} else {
>> -		populate_cache(dcache, this_leaf, 1, CACHE_TYPE_UNIFIED);
>> +		populate_cache(dcache, this_leaf, level, CACHE_TYPE_UNIFIED);
>> +		level++;
>> +	}
>> +
>> +	if (c->vcache.waysize) {
> why can't we insert vcache as level 4 and leave the rest of the file
> alone ?

Hi Thomas,

Oops I forgot this patch.

Because  VCache is physicaly placed between Scache and I/D Cache as per
core chahe, it will confuse userspace program otherwise.

Also I do think the level should be continues.

Thanks

- Jiaxun

>
> Thomas.
>

  reply	other threads:[~2020-11-03  5:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  0:42 [PATCH RESEND 0/2] Fix cacheinfo Jiaxun Yang
2020-08-20  0:42 ` [PATCH RESEND 1/2] MIPS: cacheinfo: Add missing VCache Jiaxun Yang
2020-08-21 16:55   ` Thomas Bogendoerfer
2020-11-03  5:40     ` Jiaxun Yang [this message]
2020-11-25  8:15       ` Tiezhu Yang
2020-08-21 16:57 ` [PATCH RESEND 0/2] Fix cacheinfo Thomas Bogendoerfer
2020-12-30  3:39 [PATCH RESEND 1/2] MIPS: cacheinfo: Add missing VCache Jiaxun Yang
2020-12-31  0:25 ` Huacai Chen
2021-01-04 10:42 ` Thomas Bogendoerfer

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=79476b22-04ef-968b-584a-10aa4357ee6b@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=vladimir.kondratiev@intel.com \
    /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®