* [PATCH 19/25]: Remove unused fields in packet history structure
@ 2007-03-21 18:45 Gerrit Renker
2007-03-26 3:20 ` Ian McDonald
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gerrit Renker @ 2007-03-21 18:45 UTC (permalink / raw)
To: dccp
[CCID 3]: Remove unused fields in packet history structure
This removes two fields of the TX packet history structure which
are not referenced by the CCID 3 code and are not needed:
* dccphtx_sent - is redundant since the fact that an entry is
present in the TX history in itself is an indication that the
packet has been sent (cf. dccp_write_xmit and ccid3_hc_tx_packet_sent);
* dccphtx_rtt - is nowhere referenced and is not even required:
the `Preventing Oscillations' mechanism in [RFC 3448, 4.5] uses a
moving-average, but does not require to memorize past RTTs;
the history field has no further use;
As a further benefit, the history entry size is reduced.
NB : Adding the newly created entry is now at the end of packet_sent - if it is
in the history before being fully filled in, list corruption is possible.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/dccp/ccids/ccid3.c | 4 +---
net/dccp/ccids/lib/packet_history.h | 12 ++----------
2 files changed, 3 insertions(+), 13 deletions(-)
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -408,13 +408,11 @@ static void ccid3_hc_tx_packet_sent(stru
DCCP_CRIT("packet history - out of memory!");
return;
}
- dccp_tx_hist_add_entry(&hctx->ccid3hctx_hist, packet);
do_gettimeofday(&now);
packet->dccphtx_tstamp = now;
packet->dccphtx_seqno = dccp_sk(sk)->dccps_gss;
- packet->dccphtx_rtt = hctx->ccid3hctx_rtt;
- packet->dccphtx_sent = 1;
+ dccp_tx_hist_add_entry(&hctx->ccid3hctx_hist, packet);
}
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -54,9 +54,7 @@
*/
struct dccp_tx_hist_entry {
struct list_head dccphtx_node;
- u64 dccphtx_seqno:48,
- dccphtx_sent:1;
- u32 dccphtx_rtt;
+ u64 dccphtx_seqno;
struct timeval dccphtx_tstamp;
};
@@ -71,13 +69,7 @@ static inline struct dccp_tx_hist_entry
dccp_tx_hist_entry_new(struct dccp_tx_hist *hist,
const gfp_t prio)
{
- struct dccp_tx_hist_entry *entry = kmem_cache_alloc(hist->dccptxh_slab,
- prio);
-
- if (entry != NULL)
- entry->dccphtx_sent = 0;
-
- return entry;
+ return kmem_cache_alloc(hist->dccptxh_slab, prio);
}
extern int dccp_tx_hist_get_send_time(struct dccp_tx_hist *, struct list_head *,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 19/25]: Remove unused fields in packet history structure
2007-03-21 18:45 [PATCH 19/25]: Remove unused fields in packet history structure Gerrit Renker
@ 2007-03-26 3:20 ` Ian McDonald
2007-04-12 15:36 ` Arnaldo Carvalho de Melo
2007-04-13 18:48 ` Gerrit Renker
2 siblings, 0 replies; 4+ messages in thread
From: Ian McDonald @ 2007-03-26 3:20 UTC (permalink / raw)
To: dccp
On 3/22/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [CCID 3]: Remove unused fields in packet history structure
>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
--
Web: http://wand.net.nz/~iam4
Blog: http://iansblog.jandi.co.nz
WAND Network Research Group
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 19/25]: Remove unused fields in packet history structure
2007-03-21 18:45 [PATCH 19/25]: Remove unused fields in packet history structure Gerrit Renker
2007-03-26 3:20 ` Ian McDonald
@ 2007-04-12 15:36 ` Arnaldo Carvalho de Melo
2007-04-13 18:48 ` Gerrit Renker
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-04-12 15:36 UTC (permalink / raw)
To: dccp
On 3/26/07, Ian McDonald <ian.mcdonald@jandi.co.nz> wrote:
> On 3/22/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> > [CCID 3]: Remove unused fields in packet history structure
> >
> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Indeed it reduced the size:
[acme@mica net-2.6.22]$ cat /tmp/before
/* <eb7c> /home/acme/git/net-2.6.22/net/dccp/ccids/lib/packet_history.h:55 */
struct dccp_tx_hist_entry {
struct list_head dccphtx_node; /* 0 16 */
u64 dccphtx_seqno:48; /* 16 8 */
u64 dccphtx_sent:1; /* 16 8 */
/* XXX 15 bits hole, try to pack */
u32 dccphtx_rtt; /* 24 4 */
/* XXX 4 bytes hole, try to pack */
struct timeval dccphtx_tstamp; /* 32 16 */
}; /* size: 48, cachelines: 1 */
/* sum members: 44, holes: 1, sum holes: 4 */
/* bit holes: 1, sum bit holes: 15 bits */
/* last cacheline: 48 bytes */
[acme@mica net-2.6.22]$ pahole -e
../build/mica/net-2.6.22/net/dccp/ccids/ccid3.o dccp_tx_hist_entry /*
<eb7c> /home/acme/git/net-2.6.22/net/dccp/ccids/lib/packet_history.h:55
*/
struct dccp_tx_hist_entry {
struct list_head dccphtx_node; /* 0 16 */
u64 dccphtx_seqno; /* 16 8 */
struct timeval dccphtx_tstamp; /* 24 16 */
}; /* size: 40, cachelines: 1 */
/* last cacheline: 40 bytes */
[acme@mica net-2.6.22]$
I wonder if we could make this a single linked list, lemme see.. I
think so, and by doing that we get the struct down to 32 bytes, making
it cacheline friendly, and also simplify the operations, i.e. that
opencoded list operation would just go away, will leave this for
later, in a TODO file.
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 19/25]: Remove unused fields in packet history structure
2007-03-21 18:45 [PATCH 19/25]: Remove unused fields in packet history structure Gerrit Renker
2007-03-26 3:20 ` Ian McDonald
2007-04-12 15:36 ` Arnaldo Carvalho de Melo
@ 2007-04-13 18:48 ` Gerrit Renker
2 siblings, 0 replies; 4+ messages in thread
From: Gerrit Renker @ 2007-04-13 18:48 UTC (permalink / raw)
To: dccp
Quoting Arnaldo Carvalho de Melo:
| struct dccp_tx_hist_entry {
| struct list_head dccphtx_node; /* 0 16 */
| u64 dccphtx_seqno; /* 16 8 */
| struct timeval dccphtx_tstamp; /* 24 16 */
| }; /* size: 40, cachelines: 1 */
| /* last cacheline: 40 bytes */
| [acme@mica net-2.6.22]$
|
| I wonder if we could make this a single linked list, lemme see.. I
| think so, and by doing that we get the struct down to 32 bytes, making
| it cacheline friendly, and also simplify the operations, i.e. that
| opencoded list operation would just go away, will leave this for
| later, in a TODO file.
This is an excellent idea - I have just checked. It works, there is no sorting
and just LIFO order.
Will you be working on this or would you like me to update this in terms of
struct hlist_head?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-13 18:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 18:45 [PATCH 19/25]: Remove unused fields in packet history structure Gerrit Renker
2007-03-26 3:20 ` Ian McDonald
2007-04-12 15:36 ` Arnaldo Carvalho de Melo
2007-04-13 18:48 ` Gerrit Renker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox