[lkml]   [2007]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] epoll use a single inode ...
Linus Torvalds a écrit :
> I assume that the *only* reason for having multiple dentries is really
> just the output in /proc/<pid>/fd/, right? Or is there any other reason to
> have separate dentries for these pseudo-files?
> It's a bit sad to waste that much memory (and time) on something like
> that. I bet that the dentry setup is a noticeable part of the whole
> sigfd()/timerfd() setup. It's likely also a big part of any memory
> footprint if you have lots of them.
> So how about just doing:
> - do a single dentry
> - make a "struct file_operations" member function that prints out the
> name of the thing in /proc/<pid>/fd/, and which *defaults* to just
> doing the d_path() on the dentry, but special filesystems like this
> could do something else (like print out a fake inode number from the
> "file->f_private_data" information)
> There seems to really be no downsides to that approach. No existing
> filesystem will even notice (they'll all have NULL in the new f_op
> member), and it would allow pipes etc to be sped up and use less memory.

I would definitly *love* saving dentries for pipes (and sockets too), but how
are you going to get the inode ?

pipes()/sockets() can use read()/write()/rw_verify_area() and thus need
file->f_path.dentry->d_inode (so each pipe needs a separate dentry)

Are you suggesting adding a new "struct file_operations" member to get the inode ?
Or re-intoducing an inode pointer in struct file ?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-03-07 07:55    [W:0.080 / U:1.132 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site