Skip to contentSkip to conversation

The impact to change page size to 16k for cache alias

DISCUSSION 林建安 3 participants 7 messages Mar 30, 2009 – Mar 31, 2009 MIPS

lore
Share & tools
lore

林建安

author
#0 lore raw

Hi all,
We are willing to use 16k page size to avoid cache alias problem.
The Linux version we use is 2.6.12. If we just upgrade mm system to support 16k page size, what else problems will happen? There is already one thing we know that applications of ELF format applications should be transformed to be 16k alignment. Another one, we think, highly suspected to be problematic is that many drivers will be ok for 4k page size but fails for 16k. That is because 4k page size had been seemed to be natural for a very long long time.
Any other problem that shall happen for 16k page size?

Regards,
Colin

#1 lore raw
Quoted 12 lines · 林建安

Hi all,
We are willing to use 16k page size to avoid cache alias problem. The Linux version we use is 2.6.12. If we just upgrade mm system to support 16k page size, what else problems will happen? There is already one thing we know that applications of ELF format applications should be transformed to be 16k alignment. Another one, we think, highly suspected to be problematic is that many drivers will be ok for 4k page size but fails for 16k.
That is because 4k page size had been seemed to be natural for a very long long time.
Any other problem that shall happen for 16k page size?

Linux on Loongson 2E and 2F uses 16k page size to avoid cache alias problem, too. However, I haven't encountered any problem on Linux kernel itself due to 16k page size.

Anyway, I am not 100% familiar with Loongson patches, so I am not sure whether the page size problem is already been taken care of in the patch. If you are interested to find out yourself, you can get the whole source here:
http://repo.or.cz/w/linux-2.6/linux-loongson.git

Zhang, Le
http://zhangle.is-a-geek.org

#2 lore raw
Quoted 12 lines · Zhang Le
Quoted 11 lines

Hi all,
We are willing to use 16k page size to avoid cache alias problem. The Linux version we use is 2.6.12. If we just upgrade mm system to support 16k page size, what else problems will happen? There is already one thing we know that applications of ELF format applications should be transformed to be 16k alignment. Another one, we think, highly suspected to be problematic is that many drivers will be ok for 4k page size but fails for 16k.
That is because 4k page size had been seemed to be natural for a very long long time.
Any other problem that shall happen for 16k page size?

Quoted 8 lines

Linux on Loongson 2E and 2F uses 16k page size to avoid cache alias problem, too. However, I haven't encountered any problem on Linux kernel itself due to 16k page size.

Anyway, I am not 100% familiar with Loongson patches, so I am not sure whether the page size problem is already been taken care of in the patch. If you are interested to find out yourself, you can get the whole source here:
http://repo.or.cz/w/linux-2.6/linux-loongson.git

I've got a report that Fulong is currently only working with 16k pages. So 4k is no longer the bullet proof choice for all cases :)

Ralf

#3 lore raw
Quoted 18 lines · Ralf Baechle
Quoted 16 lines · Zhang Le
Quoted 11 lines

Hi all,
We are willing to use 16k page size to avoid cache alias problem. The Linux version we use is 2.6.12. If we just upgrade mm system to support 16k page size, what else problems will happen? There is already one thing we know that applications of ELF format applications should be transformed to be 16k alignment. Another one, we think, highly suspected to be problematic is that many drivers will be ok for 4k page size but fails for 16k.
That is because 4k page size had been seemed to be natural for a very long long time.
Any other problem that shall happen for 16k page size?

Linux on Loongson 2E and 2F uses 16k page size to avoid cache alias problem, too. However, I haven't encountered any problem on Linux kernel itself due to 16k page size.

Quoted 7 lines
Quoted 4 lines

Anyway, I am not 100% familiar with Loongson patches, so I am not sure whether the page size problem is already been taken care of in the patch. If you are interested to find out yourself, you can get the whole source here:
http://repo.or.cz/w/linux-2.6/linux-loongson.git

I've got a report that Fulong is currently only working with 16k pages. So 4k is no longer the bullet proof choice for all cases :)

Yes, at least from what I can tell.
I have tried 4k before, because I heard someone told me the aliasing problem already can be taken care by software, namely Linux. But as it turned out, 16k is still necessary for the Loongson boxes to function properly.

And btw, lemote intended to call the box fuloong, as can be seen here:
http://www.lemote.com/english/fuloong.html

Zhang, Le
http://zhangle.is-a-geek.org

#4 lore raw
Quoted 9 lines · Zhang Le
Quoted 9 lines
Quoted 8 lines

Linux on Loongson 2E and 2F uses 16k page size to avoid cache alias problem, too. However, I haven't encountered any problem on Linux kernel itself due to 16k page size.

Anyway, I am not 100% familiar with Loongson patches, so I am not sure whether the page size problem is already been taken care of in the patch. If you are interested to find out yourself, you can get the whole source here:
http://repo.or.cz/w/linux-2.6/linux-loongson.git

Quoted 7 lines
Quoted 2 lines

I've got a report that Fulong is currently only working with 16k pages. So 4k is no longer the bullet proof choice for all cases :)

Yes, at least from what I can tell.
I have tried 4k before, because I heard someone told me the aliasing problem already can be taken care by software, namely Linux. But as it turned out, 16k is still necessary for the Loongson boxes to function properly.

Linux knows how to handle aliasing caches - the vast majority of MIPS systems have aliasing caches and are running at 4k page size. So the issue is Loongson-specific. This might be due to processor detection not detecting the cache size, cache line size, number of ways correctly or because loongson's caches has some unusual cache properties which the Linux kernel is not designed to handle yet.

Btw, I just noticed that there is no arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h which is going to impact code size and performance.

Ralf

#5 lore raw
Quoted 26 lines · Ralf Baechle
Quoted 9 lines · Zhang Le
Quoted 9 lines
Quoted 8 lines

Linux on Loongson 2E and 2F uses 16k page size to avoid cache alias problem, too. However, I haven't encountered any problem on Linux kernel itself due to 16k page size.

Anyway, I am not 100% familiar with Loongson patches, so I am not sure whether the page size problem is already been taken care of in the patch. If you are interested to find out yourself, you can get the whole source here:
http://repo.or.cz/w/linux-2.6/linux-loongson.git

Quoted 7 lines
Quoted 2 lines

I've got a report that Fulong is currently only working with 16k pages. So 4k is no longer the bullet proof choice for all cases :)

Yes, at least from what I can tell.
I have tried 4k before, because I heard someone told me the aliasing problem already can be taken care by software, namely Linux. But as it turned out, 16k is still necessary for the Loongson boxes to function properly.

Linux knows how to handle aliasing caches - the vast majority of MIPS systems have aliasing caches and are running at 4k page size. So the issue is Loongson-specific. This might be due to processor detection not detecting the cache size, cache line size, number of ways correctly or because loongson's caches has some unusual cache properties which the Linux kernel is not designed to handle yet.

Quoted 3 lines

Btw, I just noticed that there is no arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h which is going to impact code size and performance.

Thanks for the reminder. I didn't know it before. I am gonna take a look.

Zhang, Le
http://zhangle.is-a-geek.org

#6 lore raw
In reply to 林建安
Quoted 11 lines · 林建安

Hi all,
We are willing to use 16k page size to avoid cache alias problem. The Linux version we use is 2.6.12. If we just upgrade mm system to support 16k page size, what else problems will happen? There is already one thing we know that applications of ELF format applications should be transformed to be 16k alignment. Another one, we think, highly suspected to be problematic is that many drivers will be ok for 4k page size but fails for 16k.
That is because 4k page size had been seemed to be natural for a very long long time.
Any other problem that shall happen for 16k page size?

Most drivers are agnostic of the page size so no problems due to increased page size are to be expected.

You will have to upgrade your kernel though. There were some important fixes for larger page size applied to later kernels.

Ralf