This is an archive of the discontinued LLVM Phabricator instance.

Remove hardcoded page size when compiling on android
Needs ReviewPublic

Authored by zhangxp1998 on May 26 2023, 1:27 PM.

Details

Reviewers
cferris
enh
Summary

Android bionic is no longer using hardcoded page sizes, so remove the
shortcut code path

Diff Detail

Event Timeline

zhangxp1998 created this revision.May 26 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 1:27 PM
zhangxp1998 requested review of this revision.May 26 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 1:27 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

We are worried that this might cause some secondary performance issues, going from hard-coded to a memory access. We don't think this will be a problem, but want a little more time to verify.

We also considered that it could be a config parameter to the allocator if we want to keep this as constant lookup without a memory access. But there is a change incoming to the config code.

So once that other change is in, we can look at this again. It shouldn't be too long though, probably by the end of the week.

Friendly ping : ) Any update on this?

kalesh added a subscriber: kalesh.Aug 3 2023, 1:54 PM

Sorry, I've been trying multiple ways of incorporating the value into the config and none of them work easily. They require changes to just about every file in the tree. I have a back up but that simply uses a #define instead of specialized on SCUDO_ANDROID. I think that might be the best way to go since it's not easy to use a config variable for this particular call.

enh added a comment.Aug 16 2023, 2:19 PM

Sorry, I've been trying multiple ways of incorporating the value into the config and none of them work easily. They require changes to just about every file in the tree. I have a back up but that simply uses a #define instead of specialized on SCUDO_ANDROID. I think that might be the best way to go since it's not easy to use a config variable for this particular call.

this:

#if defined(PAGE_SIZE)
  if (SCUDO_ANDROID) return PAGE_SIZE;
#endif

would work well with what's in AOSP atm. (the "page size agnostic" builds don't define PAGE_SIZE.)