Skip to content
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

[LibOS] Replace linked list of allowed_files with something more performant #1983

Open
dimakuv opened this issue Aug 29, 2024 · 0 comments
Open
Labels
enhancement New feature or request P: 3

Comments

@dimakuv
Copy link
Contributor

dimakuv commented Aug 29, 2024

Description of the feature

(Extracted during review of #1812)

@mwkmwkmwk wrote:

I am a little concerned about stuffing all created files in the allowed_files list — the list has quadratic behavior and if an application creates a fair amount of files, this is going to hurt. should we think about alternatives?

@dimakuv wrote:

I can imagine the following optimization:

  • Split "allowed files" internally into a linked list of allowed dirs and a hash table of allowed files
  • On open-file checks, first traverse the list of allowed dirs -- this is fast because the list is typically minimal, 10-20 items max
  • Then check the hash table of allowed files
  • On creating files, add the file to the hash table of allowed files (i.e. never to the list of allowed dirs)

Why Gramine should implement it?

Improve performance of allowed files checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P: 3
Projects
None yet
Development

No branches or pull requests

1 participant