diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2022-09-20 20:35:23 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2022-10-04 00:21:45 +0300 |
commit | ef1d61781bc6708ccc4a21262cc80a7dad952e04 (patch) | |
tree | 8718e18c0d48dcd197f78ab1924ac7d21cab0ac5 /fs/proc/internal.h | |
parent | da6f79164e98de4ab3f2fdeea4875207fe282014 (diff) | |
download | linux-ef1d61781bc6708ccc4a21262cc80a7dad952e04.tar.xz |
proc: mark more files as permanent
Mark
/proc/devices
/proc/kpagecount
/proc/kpageflags
/proc/kpagecgroup
/proc/loadavg
/proc/meminfo
/proc/softirqs
/proc/uptime
/proc/version
as permanent /proc entries, saving alloc/free and some list/spinlock ops
per use.
These files are never removed by the kernel so it is OK to mark them.
Link: https://lkml.kernel.org/r/Yyn527DzDMa+r0Yj@localhost.localdomain
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r-- | fs/proc/internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 06a80f78433d..af277184b807 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -79,6 +79,11 @@ static inline bool pde_is_permanent(const struct proc_dir_entry *pde) return pde->flags & PROC_ENTRY_PERMANENT; } +static inline void pde_make_permanent(struct proc_dir_entry *pde) +{ + pde->flags |= PROC_ENTRY_PERMANENT; +} + extern struct kmem_cache *proc_dir_entry_cache; void pde_free(struct proc_dir_entry *pde); |