netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 18/21] Filesystem: Socket inode defragmentation
       [not found] <20080510030831.796641881@sgi.com>
@ 2008-05-10  3:08 ` Christoph Lameter
  2008-05-13 13:28   ` Evgeniy Polyakov
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Lameter @ 2008-05-10  3:08 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, netdev, linux-fsdevel, Mel Gorman, andi,
	Rik van Riel, Pekka Enberg, mpm

[-- Attachment #1: 0030-FS-Socket-inode-defragmentation.patch --]
[-- Type: text/plain, Size: 978 bytes --]

Support inode defragmentation for sockets

Cc: netdev@vger.kernel.org
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
 net/socket.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 9d3fbfb..205f450 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -269,6 +269,12 @@ static void init_once(struct kmem_cache *cachep, void *foo)
 	inode_init_once(&ei->vfs_inode);
 }
 
+static void *sock_get_inodes(struct kmem_cache *s, int nr, void **v)
+{
+	return fs_get_inodes(s, nr, v,
+		offsetof(struct socket_alloc, vfs_inode));
+}
+
 static int init_inodecache(void)
 {
 	sock_inode_cachep = kmem_cache_create("sock_inode_cache",
@@ -280,6 +286,8 @@ static int init_inodecache(void)
 					      init_once);
 	if (sock_inode_cachep == NULL)
 		return -ENOMEM;
+	kmem_cache_setup_defrag(sock_inode_cachep,
+			sock_get_inodes, kick_inodes);
 	return 0;
 }
 
-- 
1.5.4.4

-- 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch 18/21] Filesystem: Socket inode defragmentation
  2008-05-10  3:08 ` [patch 18/21] Filesystem: Socket inode defragmentation Christoph Lameter
@ 2008-05-13 13:28   ` Evgeniy Polyakov
  2008-05-15 17:40     ` Christoph Lameter
  0 siblings, 1 reply; 4+ messages in thread
From: Evgeniy Polyakov @ 2008-05-13 13:28 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: akpm, linux-kernel, netdev, linux-fsdevel, Mel Gorman, andi,
	Rik van Riel, Pekka Enberg, mpm

Hi Christoph.

On Fri, May 09, 2008 at 08:08:49PM -0700, Christoph Lameter (clameter@sgi.com) wrote:
> Support inode defragmentation for sockets

Out of curiosity, how can you drop socket inode, since it is always
attached to socket which is removed automatically when connection is
closed. Any force of dropping socket inode can only result in connection
drop, i.e. there are no inodes, which are placed in cache and are not
yet freed, if there are no attached sockets.

So question is how does it work for sockets?

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 18/21] Filesystem: Socket inode defragmentation
  2008-05-13 13:28   ` Evgeniy Polyakov
@ 2008-05-15 17:40     ` Christoph Lameter
  2008-05-15 18:23       ` Evgeniy Polyakov
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Lameter @ 2008-05-15 17:40 UTC (permalink / raw)
  To: Evgeniy Polyakov
  Cc: akpm, linux-kernel, netdev, linux-fsdevel, Mel Gorman, andi,
	Rik van Riel, Pekka Enberg, mpm

On Tue, 13 May 2008, Evgeniy Polyakov wrote:

> Out of curiosity, how can you drop socket inode, since it is always
> attached to socket which is removed automatically when connection is
> closed. Any force of dropping socket inode can only result in connection
> drop, i.e. there are no inodes, which are placed in cache and are not
> yet freed, if there are no attached sockets.
> 
> So question is how does it work for sockets?

All inodes are inactivated and put on a lru before they are freed. Those 
could be reclaimed by inode defrag. Socket inode defrag is not that 
important. Just shows that this can be applied in a general way.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 18/21] Filesystem: Socket inode defragmentation
  2008-05-15 17:40     ` Christoph Lameter
@ 2008-05-15 18:23       ` Evgeniy Polyakov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeniy Polyakov @ 2008-05-15 18:23 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: akpm, linux-kernel, netdev, linux-fsdevel, Mel Gorman, andi,
	Rik van Riel, Pekka Enberg, mpm

On Thu, May 15, 2008 at 10:40:11AM -0700, Christoph Lameter (clameter@sgi.com) wrote:
> All inodes are inactivated and put on a lru before they are freed. Those 

I have to check my memory, but iput()->destroy_inode() highlights first for sockets...

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-15 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080510030831.796641881@sgi.com>
2008-05-10  3:08 ` [patch 18/21] Filesystem: Socket inode defragmentation Christoph Lameter
2008-05-13 13:28   ` Evgeniy Polyakov
2008-05-15 17:40     ` Christoph Lameter
2008-05-15 18:23       ` Evgeniy Polyakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).