[PATCH] reduce sizeof(struct file)
Now that RCU applied on 'struct file' seems stable, we can place f_rcuhead in a memory location that is not anymore used at call_rcu(&f->f_rcuhead, file_free_rcu) time, to reduce the size of this critical kernel object. The trick I used is to move f_rcuhead and f_list in an union called f_u The callers are changed so that f_rcuhead becomes f_u.fu_rcuhead and f_list becomes f_u.f_list Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
503af334ec
commit
2f51201662
@@ -1609,7 +1609,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
|
||||
|
||||
if (tty) {
|
||||
file_list_lock();
|
||||
file = list_entry(tty->tty_files.next, typeof(*file), f_list);
|
||||
file = list_entry(tty->tty_files.next, typeof(*file), f_u.fu_list);
|
||||
if (file) {
|
||||
/* Revalidate access to controlling tty.
|
||||
Use inode_has_perm on the tty inode directly rather
|
||||
|
Reference in New Issue
Block a user