Open shenada opened 3 years ago
Should be added to wiki, yes
For those reading this issue, edit /etc/security/limits.conf
and set hard / soft memlock limits to either 2 GiB in bytes or unlimited
* hard memlock unlimited
* soft memlock unlimited
Should be added to wiki, yes
For those reading this issue, edit
/etc/security/limits.conf
and set hard / soft memlock limits to either 2 GiB in bytes or unlimited* hard memlock unlimited * soft memlock unlimited
What if we migrate to HugePages which provides much better performance and much lower TLB cache load.
That's up to @Nekotekina
That's up to @Nekotekina
Sure, indeed. But, just make sure he know we had this option. About why HugePage: https://en.wikipedia.org/wiki/Translation_lookaside_buffer
We need to lock small pages for texture cache to work.
I also reserve several 1G pages for my vm, didn't notice performance improvement. Memory is still slower than native.
Configuring is trivial — just edit /etc/security/limits.conf
. 64K is some outdated over-precautious limitation from 1990's era. We have many cheap RAM and locking few GiBs of it can NOT be a problem. Also, we don't lock absolutely everything, those numbers of virtual memory used by RPCS3 are not really used memory, it's just a bunch of almost-empty contiguous mappings.
Also, doing it "like KVM" can't be an optimization for RPCS3, it's only a necessity because of another TLB on top of it (VM's own's one). We don't emulate like this, we use system TLB. How much we thrash it is another question, though...
But I'm not an expert and I'd like to hear more opinions on that. Like if I could somehow get 2GiB worth of hugepages WITHOUT configuring system...
Has there actually been any issues because of that? I am asking because in my case it didn't make any difference between running and not running a game. Had 64KiB and now set it to 3GB. Had to restart the machine instead of just logging out and back in, which might be good to know.
For Archlinux:
Install realtime-privileges and add your own user to the realtime group >
from [https://wiki.archlinux.org/title/PipeWire#Increasing_RLIMIT_MEMLOCK]
Should be added to wiki, yes
For those reading this issue, edit
/etc/security/limits.conf
and set hard / soft memlock limits to either 2 GiB in bytes or unlimited* hard memlock unlimited * soft memlock unlimited
This works on my setup.
Most of Linux distribution won't come with large RLIMIT_MEMLOCK by default. (Linux kernel default is 64KiB) If we need large non-swapped memory by setting ulimit we should provide more useful message and document it. Or try to use HugePages 1Gx2 just like qemu or KVM (Better performance but also not come with default). https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt https://github.com/libhugetlbfs/libhugetlbfs