Re: [9fans] LPAE patch for ARM

2022-06-04 Thread adr

On Sat, 4 Jun 2022, Richard Miller wrote:

There's a new patch bcm-lpae which uses the 64-bit page table format to
allow 32-bit ARM kernels to support more than 4GB of physical memory. At
present this is mainly of interest for the 8GB Raspberry Pi 4, but there's
nothing Pi-specific in the MMU code so it may have future application for
bigger ARM systems.


Thanks a lot Richard!

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T2b3e951db9f7c17f-Mc302193000a78af072a244de
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] little pipe speedtest

2022-06-04 Thread ori
inspired by:

https://mazzo.li/posts/fast-pipes.html

I was curious to see how things stacked up on plan 9.

The machines are apples to oranges (my 9front box
is a 2015-ish era Zbox with a Intel Core i5-7300HQ
processor, and my work machine is a Linux with a
12 core Ryzen 9 3900X).

Transferring 128 gigs instead of the 10 in the initial
benchmark, here are the results:

# 9front 595684fd8a2f08e12d5df48152d93fb8ab800fe3 amd64
% time rc -c '6.write | 6.read'
0.33u 23.28s 11.64r  rc -c 6.write | 6.read 

# Linux 5.13.0-40-generic #45~20.04.1-Ubuntu SMP
$ time sh -c './write | ./read'
real0m32.039s
user0m0.231s
sys 0m34.576s

here's the plan 9 version of the program:

write.c:
#include 
#include 

void
main(void)
{
usize sz;
char* buf;

sz = 1 << 18;
buf = malloc(sz);
memset((void*)buf, 'X', sz);
while(1){
n = write(1, buf, sz) != sz)
break;
exits(nil);
}

read.c:
#include 
#include 

enum {
KiB = 1024ULL,
MiB = 1024*KiB,
GiB = 1024*MiB,
};

void
main(void)
{
vlong sz, r, n;
char* buf;

r = 0;
sz = 1 << 18;
buf = malloc(sz);
while(r <= 128ULL*GiB){
n = read(0, buf, sz);
if(n <= 0)
break;
r += n;
}
exits(nil);
}

And the linux version:

write.c:
#include 
#include 
#include 

int
main(int argc, char **argv)
{
size_t sz;
char* buf;

sz = 1 << 18;
buf = malloc(sz);
memset(buf, 'X', sz);
while(1)
if(write(1, buf, sz) != sz)
break;

return 0;
}
read.c:
#include 
#include 

enum {
KiB = 1024ULL,
MiB = 1024*KiB,
GiB = 1024*MiB,
};

int
main(int argc, char **argv)
{
ssize_t sz, r, n;
char* buf;

r = 0;
sz = 1 << 18;
buf = malloc(sz);
while(r <= 128ULL*GiB){
n = read(0, buf, sz);
if(n <= 0)
break;
r += n;
}
return 0;
}


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Td13d120eca9d5ee7-M40cecbefc1f455f5c2c25358
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] LPAE patch for ARM

2022-06-04 Thread Richard Miller
There's a new patch bcm-lpae which uses the 64-bit page table format to
allow 32-bit ARM kernels to support more than 4GB of physical memory. At
present this is mainly of interest for the 8GB Raspberry Pi 4, but there's
nothing Pi-specific in the MMU code so it may have future application for
bigger ARM systems.

The LPAE page table format works on the Pi 2 and Pi 3 as well, where it
may provide a wee performance improvement from simpler page fault handling.
When building a bcm kernel, the choice of page descriptor format is determined
by putting either 'mmu' or 'mmu64' in the 'misc' section of the config file.

The patch has been applied in the current 9legacy SD card image for Raspberry Pi
on http://9legacy.org/download.html, and also in the 9pi SD card image on
http://9p.io/sources/contrib/miller (though nowadays for all practical purposes
I recommend 9legacy as a better choice). If you just want to update the kernel,
source is in http://9p.io/sources/contrib/miller/9/bcm as usual.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T2b3e951db9f7c17f-Mbacd4cfcb29eca6dadc2a77a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription