Use list_head-s in inetpeer.c
Subsystems (3)
PATCH 1/1 Use list_head-s in inetpeer.c
The inetpeer.c tracks the LRU list of inet_perr-s, but makes it by hands. Use the list_head-s for this.
---
include/net/inetpeer.h +1 -1
@@ -22,7 +22,7 @@ struct inet_peer__be32 v4daddr;/* peer's address */ __u16 avl_height;__u16 ip_id_count;/* IP ID for the next packet */ -struct inet_peer *unused_next, **unused_prevp; +struct list_head unused;__u32 dtime;/* the time of last use of not * referenced entries */ atomic_t refcnt;
net/ipv4/inetpeer.c +15 -27
86 lines not on this page · raw message
Signature · 1 line
1.5.3.4
David Miller
maintainerFrom: Pavel Emelyanov <[email protected]>
Date: Sat, 10 Nov 2007 17:32:58 +0300
Quoted 4 lines
The
inetpeer.ctracks the LRU list of inet_perr-s, but makes it by hands. Use the list_head-s for this.Signed-off-by Pavel Emelyanov <[email protected]>
This makes every inetpeer struct consume 8 more bytes, and on some systems we have can have many of these objects active. That space savings is why this was done the way it was.
It would be nice to have "tailq" like interfaces in linux/list.h for situations like this.
Please do not submit a patch implementing that until the 2.6.25 merge window, however, thanks.
Quoted 11 lines · David Miller
From: Pavel Emelyanov <[email protected]>
Date: Sat, 10 Nov 2007 17:32:58 +0300Quoted 4 lines
The
inetpeer.ctracks the LRU list of inet_perr-s, but makes it by hands. Use the list_head-s for this.Signed-off-by Pavel Emelyanov <[email protected]>This makes every inetpeer struct consume 8 more bytes, and on some systems we have can have many of these objects active. That space savings is why this was done the way it was.
No. I remove _two_ pointers unused_next and unused_prevp, and add the list_head, which is _two_ pointers as well. I've even checked the compilation on both i386 and x86_64 - the sizeof(struct inet_peer) is not changed.
You must have overlooked the unused_prevp member, because it is declared in the same line as the unused_next. Or I miss something else?
Quoted 5 lines
It would be nice to have "tailq" like interfaces in
linux/list.hfor situations like this.Please do not submit a patch implementing that until the 2.6.25 merge window, however, thanks.
If my explanation above is correct, should I delay this patch until the 2.6.25 anyway?
Thanks,
Pavel
David Miller
maintainerFrom: Pavel Emelyanov <[email protected]>
Date: Mon, 12 Nov 2007 11:57:23 +0300
Quoted 7 lines
No. I remove _two_ pointers
unused_nextandunused_prevp, and add thelist_head, which is _two_ pointers as well. I've even checked the compilation on both i386 andx86_64- thesizeof(struct inet_peer)is not changed.You must have overlooked the
unused_prevpmember, because it is declared in the same line as theunused_next. Or I miss something else?
I missed that, please resubmit your patch.
Thanks.