public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Davide Libenzi <davidel@xmailserver.org>,
	Avi Kivity <avi@argo.co.il>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [patch] epoll use a single inode ...
Date: Wed, 07 Mar 2007 08:16:14 +0100	[thread overview]
Message-ID: <45EE66BE.8020003@cosmosbay.com> (raw)
In-Reply-To: <45EE6125.3010702@cosmosbay.com>

Eric Dumazet a écrit :
> 
> 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 ?

Crazy ideas : (some readers are going to kill me)

1) Use the low order bit of f_path.dentry to say : this pointer is not a 
pointer to a dentry but the inode pointer (with the low order bit set to 1)

OR

2) file->f_path.dentry set to NULL for this special files (so that we dont 
need to dput() and cache line ping pong the common dentry each time we 
__fput() a pipe/socket.

Same trick could be used for file->f_path.mnt, because there is a big SMP 
cache line ping/pong to maintain a mnt_count on pipe/sockets mountpoint while 
these file systems cannot be un-mounted)

If dentry is NULL, we get the inode pointer from an overlay of struct 
file_ra_state    f_ra; (because for this special files readahead is unused)

This adds some conditional branches of course, but being able to save ram and 
better use cpu caches might be worth them.



  parent reply	other threads:[~2007-03-07  7:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45ED1A3C.6030707@argo.co.il>
2007-03-07  0:37 ` [patch] epoll use a single inode Davide Libenzi
2007-03-07  0:51   ` Linus Torvalds
2007-03-07  1:01     ` Davide Libenzi
2007-03-07  1:27       ` Linus Torvalds
2007-03-07  1:47         ` Davide Libenzi
2007-03-07  6:52     ` Eric Dumazet
2007-03-07  7:15       ` Davide Libenzi
2007-03-07  7:16       ` Eric Dumazet [this message]
2007-03-07  8:56         ` Christoph Hellwig
2007-03-07 17:21         ` Linus Torvalds
2007-03-07 17:02       ` Linus Torvalds
2007-03-07 17:31         ` Eric Dumazet
2007-03-07 17:36           ` Eric Dumazet
2007-03-07 17:45           ` Linus Torvalds
2007-03-07 18:06             ` Eric Dumazet
2007-03-07 18:30               ` Linus Torvalds
2007-03-07 18:52                 ` Eric Dumazet
2007-03-07 19:07                   ` Linus Torvalds
2007-03-07 22:14                   ` Anton Blanchard
2007-03-07 22:57                     ` Linus Torvalds
2007-03-08  1:25                       ` Michael K. Edwards
2007-03-08  2:48                         ` Kyle Moffett
2007-03-08  7:24                           ` Eric Dumazet
2007-03-08 16:57                             ` Valdis.Kletnieks
2007-03-09  1:34                             ` Kyle Moffett
2007-03-09  2:52                               ` Anton Blanchard
2007-03-09  2:51                             ` Anton Blanchard
2007-03-08  3:20                         ` Linus Torvalds
2007-03-08  8:37                           ` Michael K. Edwards
2007-03-09  2:46                       ` Anton Blanchard
2007-03-08  8:56           ` Christoph Hellwig
2007-03-08  9:42             ` Eric Dumazet
2007-03-08 10:21               ` Christoph Hellwig
2007-03-08 11:11                 ` Eric Dumazet
2007-03-08 11:18                   ` Christoph Hellwig
2007-03-08 15:52                   ` Linus Torvalds
2007-03-08 16:58                     ` [PATCH] VFS : Delay the dentry name generation on sockets and pipes Eric Dumazet
2007-03-08 18:29                       ` Eric Dumazet
2007-03-09 10:18                         ` [PATCH, take2] " Eric Dumazet
2007-03-09 18:22                           ` Linus Torvalds
2007-03-10  1:21                           ` [PATCH, take3] " Eric Dumazet
2007-03-08 20:00                   ` [patch] epoll use a single inode Bob Copeland
     [not found] <45ED046A.5010508@argo.co.il>
2007-03-06  7:27 ` Davide Libenzi
2007-03-05 21:25 Davide Libenzi
2007-03-05 21:52 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45EE66BE.8020003@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@argo.co.il \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox