Goal : Avoid some locking/unlocking 'struct files_struct'->file_lock for mono threaded processes. We define files_multithreaded() function . static inline int files_multithreaded(const struct files_struct *files) { return sizeof(files->file_lock) > 0 && atomic_read(&files->count) > 1; } On plain UP kernel (not preemptable nor spinlock debug), this function is a const 0, so that gcc can wipe out some code. On preemptible or SMP, or spinlock debug kernels, the result is true only if the ref count is greater than 1 (multi threaded process or /proc/{pid}/fd is under investigation by another task) This patch increases kernel size but pros are worth the cons, as said Linus himself, we should increase performance of mono-threaded tasks.... Signed-off-by: Eric Dumazet