Skip to content

od: rs90: Set page size to 4k#91

Open
glebm wants to merge 1 commit into
OpenDingux:opendinguxfrom
glebm:page-size-4k
Open

od: rs90: Set page size to 4k#91
glebm wants to merge 1 commit into
OpenDingux:opendinguxfrom
glebm:page-size-4k

Conversation

@glebm

@glebm glebm commented Nov 11, 2022

Copy link
Copy Markdown

This makes the OS and applications a lot more RAM efficient:

  1. Reduces OS overhead by 3.5 MiB.
  2. Reduces RAM usage of applications (amount varies).

This comes at small performance cost,
<1 FPS in the emulators and ports that I've tested.

Measuring MemAvailable and Slab with just "Terminal" running:

Before:

MemAvailable:       9760 kB
Slab:               6816 kB

After:

MemAvailable:      13812 kB
Slab:               5904 kB

Makes more games playable:

  1. DevilutionX now loads the dungeon (without audio) and the FPS is unchanged 🎉
  2. Discword on ScummVM now runs well (previously: ~0.1 FPS)

Performance on ReGBA is identical (no frameskip, measured from particular stable-FPS scenes):

            4 KiB    16 KiB
Golden Sun: 55 FPS   55 FPS
      FFVI: 26 FPS   26 FPS

/proc/meminfo with 4k page size: https://gist.github.com/glebm/5aa5ad09ebfa62feb7b695d298f95ed7

@pcercuei

Copy link
Copy Markdown
Member

I want to do more tests before deciding whether or not it's a good idea to revert back to 4 KiB pages.

@glebm

glebm commented Nov 21, 2022

Copy link
Copy Markdown
Author

Makes sense. I've rebased the PR and added some details to the commit message and PR description.

@pcercuei

Copy link
Copy Markdown
Member

If #81 compensates for the performance loss of switching back to 4 KiB then I think it is OK. I just need to find some time to test things.

@pcercuei

Copy link
Copy Markdown
Member

I see differences as big as a 4 FPS difference in ReGBA though (48 vs. 44 FPS), that's about a 8% performance drop...
IMG_20221128_133309

This makes the OS and applications a lot more RAM efficient:

1. Reduces OS overhead by 3.5 MiB.
2. Reduces RAM usage of applications (amount varies).

This comes at small performance cost,
<1 FPS in the emulators and ports that I've tested.

Measuring `MemAvailable` and `Slab` with just "Terminal" running:

Before:

    MemAvailable:       9760 kB
    Slab:               6816 kB

After:

    MemAvailable:      13812 kB
    Slab:               5904 kB

DevilutionX now loads the dungeon (without audio)
and the FPS is unchanged.

Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
@glebm

glebm commented Nov 29, 2022

Copy link
Copy Markdown
Author
  1. Which build of ReGBA did you use? Both at 360 MHz?
  2. How do you get to the screen you're testing at? I'm trying the Final Fantasy V Advance USA version and the starting screen looks different.

@pcercuei

Copy link
Copy Markdown
Member

@glebm latest (pcercuei/ReGBA.git), both at 360 MHz yes.

Just leave the title screen run, you will eventually arrive to this point.

Note that FPS won't be very different when there are not many memory accesses or these memory accesses are contained into a small memory area (that fits in 128 KiB, aka. 32 pages).

When the emulator or app needs to access a broader area of memory, for instance when a dynarec is recompiling code, or when accessing various parts of the ROM, then you can see the real difference.

@glebm

glebm commented Nov 29, 2022

Copy link
Copy Markdown
Author

I'm going to measure various versions but the latest release of pcercuei/ReGBA doesn't launch on RG99 at all (https://github.com/pcercuei/ReGBA/releases/tag/regba-2021.03.24)

@glebm

glebm commented Nov 30, 2022

Copy link
Copy Markdown
Author

I wonder if it'd work better with 1 hugepage anyway? If that's the case, perhaps we can have both better performance and more memory

@pcercuei

pcercuei commented Dec 2, 2022

Copy link
Copy Markdown
Member

@glebm reserving one huge page means having 2 MiB reserved at all times, I'm not sure that helps you much.

@SnDream

SnDream commented Feb 12, 2023

Copy link
Copy Markdown

I have tested this on RetroMini some time ago.

  • Advantages
    • more free memory
    • f2fs available (why add f2fs in 16k?)
  • Disadvantages
    • feels lower performance in ReGBA
    • creating and mounting f2fs is annoying and seems unnecessary

@pcercuei

Copy link
Copy Markdown
Member

@SnDream F2FS doesn't work with 16 KiB pages?

@SnDream

SnDream commented Feb 25, 2023

Copy link
Copy Markdown

@SnDream F2FS doesn't work with 16 KiB pages?

yes, see: torvalds/linux@5c9b469295fb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants