From 3071469d57e8737e93d8248906b96c6889377dcc Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Mon, 30 Jan 2017 03:07:32 +0000 Subject: [PATCH] fd: sprinkle __read_mostly and __exclusive_cache_line --- sys/kern/kern_descrip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index fd6c796da14d..87f99248bea0 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -97,8 +97,8 @@ MALLOC_DEFINE(M_FILECAPS, "filecaps", "descriptor capabilities"); MALLOC_DECLARE(M_FADVISE); -static uma_zone_t file_zone; -static uma_zone_t filedesc0_zone; +static __read_mostly uma_zone_t file_zone; +static __read_mostly uma_zone_t filedesc0_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -168,9 +168,9 @@ struct filedesc0 { /* * Descriptor management. */ -volatile int openfiles; /* actual number of open files */ +volatile int __exclusive_cache_line openfiles; /* actual number of open files */ struct mtx sigio_lock; /* mtx to protect pointers to sigio */ -void (*mq_fdclose)(struct thread *td, int fd, struct file *fp); +void __read_mostly (*mq_fdclose)(struct thread *td, int fd, struct file *fp); /* * If low >= size, just return low. Otherwise find the first zero bit in the