FUSE sessions reserve ~158 KiB of fixed tables each, mostly unused
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 55/100
- Type d'issue
- Refactorisation
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- c
- Domaine
- backend, performance
Piste de recherche
Start with src/syscall/fuse.c, especially fuse_session_t, fuse_proc_open, and the node-ref path functions named in the issue; trace how requests and node references are allocated and released. Compare the two proposed approaches and check existing limits such as FUSE_MAX_OPEN_FILES and FUSE_MAX_SESSIONS. Done means reducing per-session storage and initialization cost while preserving FUSE request and node-reference behavior; the issue names no tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Each fuse_session_t in src/syscall/fuse.c carries four fixed arrays:
| Field | Size |
|---|---|
| requests[FUSE_MAX_PENDING] (128) | 14,336 B |
| node_refs[FUSE_MAX_NODE_REFS] (4096) | 98,304 B |
| node_ref_hash[8192] | 32,768 B |
| node_ref_free[4096] | 16,384 B |
One session is 162,016 bytes, and fuse_sessions[8] is 1.24 MiB of static storage. fuse_proc_open memsets the whole slot and fills both index tables, so every open("/dev/fuse") makes about 158 KiB resident. The slot stays resident until the /dev/fuse fd and every FUSE file fd are closed, which is usually the daemon's whole lifetime.
Linux keeps the same information but allocates it on demand (torvalds/linux master, fs/fuse):
- Requests are allocated per request:
fuse_request_alloc→kmem_cache_zalloc(fuse_req_cachep, ...)(dev.c). Only background requests are capped, atFUSE_DEFAULT_MAX_BACKGROUND(12). - The lookup count is a field of the inode,
u64 nlookupinstruct fuse_inode(fuse_i.h). It is incremented infuse_iget, and FORGET is sent fromfuse_evict_inode, so there is no per-connection nodeid table.
The node-ref tables are also far larger than elfuse can fill. fuse_walk_path_locked drops each component's lookup as soon as it steps past it. Only fuse_open_path (an open file) and fuse_materialize_path (an exec copy) keep the final lookup. The live count is therefore bounded by FUSE_MAX_OPEN_FILES (128, shared by all sessions) plus the walks in flight, against 4096 entries per session. The comment that sizes the table for ls -R style walks no longer matches the walk.
Possible directions:
- Size
node_refsfromFUSE_MAX_OPEN_FILESinstead of 4096. - Or allocate the node-ref tables and request slots on demand, as Linux does.
Either change also makes it cheaper to raise FUSE_MAX_SESSIONS above 8.
- Langage dominant
- C
- Étoiles
- 287
- Forks
- 33
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 18
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de sysprog21/elfuse
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de sysprog21/elfuse
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
libreswan/libreswan#3185 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
[SDL3pp] update to 0.12.0Ouvertecategory:port-update
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
[InstCombine] 23.x folds 0.0 * (0.0 / x) to 0.0 when x may be zero (fixed on main by #202482)Ouvertellvm:instcombine
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
llvm/llvm-project#246503 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour