-
Notifications
You must be signed in to change notification settings - Fork 23
WIP / Experiment: reference counting directory FDs to keep them alive longer #169
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
base: main
Are you sure you want to change the base?
Conversation
Done, it now reserves |
7a5421b
to
9f354d3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
==========================================
- Coverage 91.08% 90.96% -0.13%
==========================================
Files 57 57
Lines 8394 8454 +60
Branches 1114 1124 +10
==========================================
+ Hits 7646 7690 +44
- Misses 467 477 +10
- Partials 281 287 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9f354d3
to
9e6086c
Compare
3378a3d
to
8111a08
Compare
// fprintf(stderr, "Warning: system may not allow enough open files for the number of requested threads.\n"); | ||
// fprintf(stderr, "Max number of open files: %llu; Number of threads requested: %llu\n", rl.rlim_cur, nthreads); |
Check notice
Code scanning / CodeQL
Commented-out code Note
b85370b
to
1985be7
Compare
struct rlimit rl; | ||
int res = getrlimit(RLIMIT_NOFILE, &rl); | ||
if (res) { | ||
fprintf(stderr, "Warning: could not get open file limit: %s\n", strerror(errno)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store errno
first
fd865c3
to
5ab578d
Compare
this is needed when the queues hold items that need additional work to free above just calling free(). so that they can clean up everything on exit properly.
Since keeping directory FDs alive in order to open child directories with relative paths incurs the risk of exhausting available file descriptors, this tracks the maximum number of FDs that should be allocated to long-living directory handles. When that maximum is reached, directory handles will no longer have their lifetime extended, until the limit goes back down again.
1985be7
to
cd2700f
Compare
This is a work-in-progress, experimental branch that tests refcounting dir FDs with the goal of keeping them alive while there are still children waiting to be processed.
The idea is to see if this helps the cache behavior on Lustre with the Lustre inode cache disabled.
This also enables using openat() in the processdir() functions in order to reduce pathname resolution overhead.