-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mem: Improve memory issue when page size is not 4KiB #2843
base: master
Are you sure you want to change the base?
Conversation
I think it would be better to make the whole allocator use blocks which are the host page size instead of trying to use workaround like that. |
I don't understand what you mean. Would you describe it a bit more? |
Ah, I kind of see, so the issue is that some games are trying to allocate two contiguous memory segment with the second one not being 8KB-aligned, right? |
For example, on Uncharted
On 4KiB page size, seg0 and seg1 are allocated in different page. |
Yes, I see. This issue is kind of annoying to tackle. Your approach looks kind of fine but there are some issues:
|
Given that your fix only affects aarch64 mac, which for the time being does not work because of the underlying problem, I am fine with it. |
On devices that have larger page size than 4KiB(such as aarch64 macOS), sometimes page is overlapped when allocating at specific page(
alloc_at
) and caused memory issue because overlapped page's memory is zero-fiiled. So if region contains already allocated page then it will only allocate remain parts and update allocation table's info to largest one.If there is better way then I'll close this PR.