Monday, December 18

Geek

Just The Thing

32-bit signed int measured in microseconds?

Just the thing for timing a long-running benchmark.

Sigh.

Posted by: Pixy Misa at 06:51 PM | Comments (7) | Add Comment | Trackbacks (Suck)
Post contains 21 words, total size 1 kb.

1 Hey, two seconds is a really long time!

Posted by: Steven Den Beste at Monday, December 18 2006 10:09 PM (+rSRq)

2 Microseconds. ;)

Posted by: Pixy Misa at Monday, December 18 2006 10:51 PM (xyVrU)

3 As in, it lasts for about 36 minutes before resetting.

The real reason I want to move to 64-bit Linux is not expanded memory capacity or improved performance, it's fixing all these goddamn 32-bit counters.  The bandwidth meter in ifconfig is another particularly irritating one.

Posted by: Pixy Misa at Monday, December 18 2006 11:46 PM (xyVrU)

4 I'm a programmer. I don't need to be able to multiply.

Posted by: Steven Den Beste at Tuesday, December 19 2006 01:07 AM (+rSRq)

5 All 64-bit UNIXen adhere to the LP64 model (and not ILP64), therefore all ints are 32-bit. If counters are ints, they will continue to overflow. By the way... I just ran ip(8) and ifconfig(8) on an FC-5 box under strace and it appears that they obtain the stats with netlink. It's hard to imagine that overflowing, although it's possible. But it's even harder to imagine netlink messages changing basic data size.

Posted by: Pete Zaitcev at Tuesday, December 19 2006 01:31 AM (9imyF)

6 Right, but a long is 32 bits under 32-bit Linux isn't it?  So moving to 64 bits won't help if the programmer used an int, but will help if they used a long. (Remember that I program mostly in languages starting in "P", so I may use the term "int" generically without warning.)

Anyways, my single 64-bit box currently says:

RX bytes:343896482019 (320.2 GiB)  TX bytes:137480366196 (128.0 GiB)

All my 32-bit boxes wrap around at 4GB.

Posted by: Pixy Misa at Tuesday, December 19 2006 01:43 AM (xyVrU)

7 OK, maybe the wrap is inside the ifconfig and not on the kernel boundary. Please check if ip(8) wraps too. The syntax is "ip -s link show dev eth0" (thank ANK's sadistic tendencies).

Posted by: Pete Zaitcev at Tuesday, December 19 2006 05:16 PM (+M8MH)

Hide Comments | Add Comment

Comments are disabled. Post is locked.
47kb generated in CPU 0.0305, elapsed 0.1237 seconds.
56 queries taking 0.1158 seconds, 345 records returned.
Powered by Minx 1.1.6c-pink.