Skip to content

[pkgimg] Split data from code#55591

Draft
vchuravy wants to merge 1 commit intomasterfrom
vc/pkgimg_split
Draft

[pkgimg] Split data from code#55591
vchuravy wants to merge 1 commit intomasterfrom
vc/pkgimg_split

Conversation

@vchuravy
Copy link
Member

The goal is to be able to reuse a single .ji for multiple
code caches. Still work-in-progress currently this doesn't
produces usable code caches.

With this:

-rw-r--r-- 1 vchuravy vchuravy 1.4M Aug 26 14:11 ArgTools/aGHFV_akYLn.ji
-rwxr-xr-x 1 vchuravy vchuravy 221K Aug 26 14:10 ArgTools/aGHFV_akYLn.so*

Making it clear that the biggest cost remains the data.

The goal is to be able to reuse a single `.ji` for multiple
code caches.
@Keno
Copy link
Member

Keno commented Aug 29, 2024

Can we make the split files valid SO's with DT_NEEDED links? Not sure I like the idea of needing a specific side file with a separate lookup mechanism.

@vchuravy
Copy link
Member Author

Can we make the split files valid SO's with DT_NEEDED links? Not sure I like the idea of needing a specific side file with a separate lookup mechanism.

I don't think so.

The idea is:

  • .ji: "Plain old cache files, contains everything necessary to load this package"
  • .so/.o: "Code cache file, only contains the code and some information necessary to load it."

Instead of what we have currently:

  • .ji: "Only contains metadata for vailidty checks"
  • .so Contains data and code, requiring us to re run the whol process just to get at O3

The reason for the split was that otherwise we would need to use an elf/coff/mach-o parser just to figure out if the cache file is valid, since dlclose doesn't work properly...

@Keno
Copy link
Member

Keno commented Aug 29, 2024

We control the layout of the shared objects - e.g. we can make the ji part a separate load command. We don't need a full parser, these data structures should be traversable in like 30-40 lines of code.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants