PlatformLab / HomaModule

A Linux kernel module that implements the Homa transport protocol.
175 stars 43 forks source link

Manuals and code inconsistent about throttle_min_bytes? #52

Closed amjal closed 8 months ago

amjal commented 8 months ago

I was looking at the throttle queue implementation and reading up about it, when I noticed that the Homa manual mentions this about the _throttle_minbytes configuration parameter:

An integer value specifying the smallest packet size subject to output queue throttling. Packets smaller than this will be immediately added to the NIC queue without considering the queue length...

But how it is used in the code here seems to be the remaining bytes left of the message determine if the message is added to the throttled queue as opposed to the packet sizes. So the packets could be uniform in size during message transmission and they might as well be all smaller than the _throttle_minbytes value, but if the remaining bytes of a message are greater than the _throttle_minbytes parameter value, the message will still be added to the throttle queue. I hope someone can correct me if I am misunderstanding.

johnousterhout commented 8 months ago

What you are saying is technically true, but in practice all of the packets of a message will be full-size packets except for the last one. Also, homa_xmit_data transmits the packets of a message in order, so checking the remaining bytes of the message is equivalent to (a) checking that we've reached the last packet and (b) checking to see if the size of that packet is less than throttle_min_bytes. This also assumes that throttle_min_bytes is smaller than a full-size packet.