[PATCH] make top.c even smaller #3

Denis Vlasenko vda at ilport.com.ua
Fri Feb 17 09:20:05 UTC 2006


On Friday 17 February 2006 11:00, Vladimir N. Oleynik wrote:
> Rob,
> 
> >>Fixed:
> >>
> >>pcpu_scale /= ( (uint16_t)(jif.total-prev_jif.total)*total_pcpu ? : 1);
> >>                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Why uint16_t? Its more slow and bigger. Its not packed structure
> 16-bit member, its a formula...

I want to have upper bound on the value, so that it is >=0
but not large enough for value*total_cpu to overflow an int.
u16 cast is an easy way to achieve it.

> >>jif.total-prev_jif.total will not exceed 64000 even if HZ=1000
> >>(well, unless you also set 64 second update interval).
> >>
> >>I also tested/improved MEM% display for multi gigabyte RAM case.
> >>See code below "MEM% = s->rss/MemTotal" comment.
> >>
> >>A small change for consistency with procps 2.x:
> >>iowait time is considered to be idle time.
> 
> > Vladimir, could you review and commit this change please?
> 
> I always ready for support my applets.
> But, I can`t work if my a questions and comments full ignore.
> And I don`t know - why...

I did not ignore you. As I _already explained on this list_,
I replied to both your letters. However, your SMTP server
is misconfigured:

2006-02-13 05:44:21.85 starting delivery 6042: msg 427233 to remote dzo at simtreas.ru
2006-02-13 05:44:21.85 status: local 0/10 remote 2/10
2006-02-13 05:44:22.64 delivery 6042: deferral: Connected_to_195.9.147.3_but_greeting_failed./Remote_host_said:_554_treas.simtreas.ru_ESMTP_not_accepting_messa

I have a tcpdump capture which shows the nature of the problem:

13:07:32.573480 195.66.192.167.52669 > 195.9.147.3.25: S 2416694310:2416694310(0) win 5840 <mss 1460,sackOK,timestamp 240001076 0,nop,wscale 2> (DF)
0x0000   4500 003c f412 4000 4006 6cb2 c342 c0a7        E..<.. at .@.l..B..
0x0010   c309 9303 cdbd 0019 900b d426 0000 0000        ...........&....
0x0020   a002 16d0 f6b2 0000 0204 05b4 0402 080a        ................
0x0030   0e4e 2034 0000 0000 0103 0302                  .N.4........
13:07:35.486632 195.9.147.3.25 > 195.66.192.167.52669: S 1378034435:1378034435(0) ack 2416694311 win 5792 <mss 1460,sackOK,timestamp 1588928021 240001076,nop,wscale 0> (DF)
0x0000   4500 003c 0000 4000 2c06 74c5 c309 9303        E..<.. at .,.t.....
0x0010   c342 c0a7 0019 cdbd 5223 2303 900b d427        .B......R##....'
0x0020   a012 16a0 04e3 0000 0204 05b4 0402 080a        ................
0x0030   5eb5 1e15 0e4e 2034 0103 0300                  ^....N.4....
13:07:35.486729 195.66.192.167.52669 > 195.9.147.3.25: . ack 1 win 1460 <nop,nop,timestamp 240003990 1588928021> (DF)
0x0000   4500 0034 f414 4000 4006 6cb8 c342 c0a7        E..4.. at .@.l..B..
0x0010   c309 9303 cdbd 0019 900b d427 5223 2304        ...........'R##.
0x0020   8010 05b4 3932 0000 0101 080a 0e4e 2b96        ....92.......N+.
0x0030   5eb5 1e15                                      ^...
13:07:38.344996 195.9.147.3.57917 > 195.66.192.167.113: S 1375386998:1375386998(0) win 5840 <mss 1460,sackOK,timestamp 1588928310 0,nop,wscale 0> (DF)
0x0000   4500 003c a240 4000 2c06 d284 c309 9303        E..<.@@.,.......
0x0010   c342 c0a7 e23d 0071 51fa bd76 0000 0000        .B...=.qQ..v....
0x0020   a002 16d0 e734 0000 0204 05b4 0402 080a        .....4..........
0x0030   5eb5 1f36 0000 0000 0103 0300                  ^..6........
13:07:38.345099 195.66.192.167 > 195.9.147.3: icmp: 195.66.192.167 tcp port 113 unreachable [tos 0xc0]
0x0000   45c0 0058 3741 0000 ff01 a9ac c342 c0a7        E..X7A.......B..
0x0010   c309 9303 0303 d722 0000 0000 4500 003c        ......."....E..<
0x0020   a240 4000 2c06 d284 c309 9303 c342 c0a7        .@@.,........B..
0x0030   e23d 0071 51fa bd76 0000 0000 a002 16d0        .=.qQ..v........
0x0040   e734 0000 0204 05b4 0402 080a 5eb5 1f36        .4..........^..6
0x0050   0000 0000 0103 0300                            ........
13:07:40.500951 195.9.147.3.25 > 195.66.192.167.52669: P 1:53(52) ack 1 win 5792 <nop,nop,timestamp 1588928575 240003990> (DF)
0x0000   4500 0068 3c31 4000 2c06 3868 c309 9303        E..h<1 at .,.8h....
0x0010   c342 c0a7 0019 cdbd 5223 2304 900b d427        .B......R##....'
0x0020   8018 16a0 975d 0000 0101 080a 5eb5 203f        .....]......^..?
0x0030   0e4e 2b96 3535 3420 7472 6561 732e 7369        .N+.554.treas.si
0x0040   6d74 7265 6173 2e72 7520 4553 4d54 5020        mtreas.ru.ESMTP.
0x0050   6e6f 7420 6163 6365 7074 696e 6720 6d65        not.accepting.me
0x0060   7373 6167 6573 0d0a                            ssages..
13:07:40.501106 195.66.192.167.52669 > 195.9.147.3.25: . ack 53 win 1460 <nop,nop,timestamp 240009007 1588928575> (DF)
0x0000   4500 0034 f416 4000 4006 6cb6 c342 c0a7        E..4.. at .@.l..B..
0x0010   c309 9303 cdbd 0019 900b d427 5223 2338        ...........'R##8
0x0020   8010 05b4 233b 0000 0101 080a 0e4e 3f2f        ....#;.......N?/
0x0030   5eb5 203f                                      ^..?
13:07:40.501818 195.66.192.167.52669 > 195.9.147.3.25: P 1:7(6) ack 53 win 1460 <nop,nop,timestamp 240009008 1588928575> (DF)
0x0000   4500 003a f418 4000 4006 6cae c342 c0a7        E..:.. at .@.l..B..
0x0010   c309 9303 cdbd 0019 900b d427 5223 2338        ...........'R##8
0x0020   8018 05b4 7b78 0000 0101 080a 0e4e 3f30        ....{x.......N?0
0x0030   5eb5 203f 5155 4954 0d0a                       ^..?QUIT..
13:07:40.502070 195.66.192.167.52669 > 195.9.147.3.25: F 7:7(0) ack 53 win 1460 <nop,nop,timestamp 240009008 1588928575> (DF)
0x0000   4500 0034 f41a 4000 4006 6cb2 c342 c0a7        E..4.. at .@.l..B..
0x0010   c309 9303 cdbd 0019 900b d42d 5223 2338        ...........-R##8
0x0020   8011 05b4 2333 0000 0101 080a 0e4e 3f30        ....#3.......N?0
0x0030   5eb5 203f                                      ^..?


The key part is:

13:07:38.344996 195.9.147.3.57917 > 195.66.192.167.113: S 1375386998:1375386998(0) win 5840 <mss 1460,sackOK,timestamp 1588928310 0,nop,wscale 0> (DF)
0x0000   4500 003c a240 4000 2c06 d284 c309 9303        E..<.@@.,.......
0x0010   c342 c0a7 e23d 0071 51fa bd76 0000 0000        .B...=.qQ..v....
0x0020   a002 16d0 e734 0000 0204 05b4 0402 080a        .....4..........
0x0030   5eb5 1f36 0000 0000 0103 0300                  ^..6........
13:07:38.345099 195.66.192.167 > 195.9.147.3: icmp: 195.66.192.167 tcp port 113 unreachable [tos 0xc0]
0x0000   45c0 0058 3741 0000 ff01 a9ac c342 c0a7        E..X7A.......B..
0x0010   c309 9303 0303 d722 0000 0000 4500 003c        ......."....E..<
0x0020   a240 4000 2c06 d284 c309 9303 c342 c0a7        .@@.,........B..
0x0030   e23d 0071 51fa bd76 0000 0000 a002 16d0        .=.qQ..v........
0x0040   e734 0000 0204 05b4 0402 080a 5eb5 1f36        .4..........^..6
0x0050   0000 0000 0103 0300                            ........
13:07:40.500951 195.9.147.3.25 > 195.66.192.167.52669: P 1:53(52) ack 1 win 5792 <nop,nop,timestamp 1588928575 240003990> (DF)
0x0000   4500 0068 3c31 4000 2c06 3868 c309 9303        E..h<1 at .,.8h....
0x0010   c342 c0a7 0019 cdbd 5223 2304 900b d427        .B......R##....'
0x0020   8018 16a0 975d 0000 0101 080a 5eb5 203f        .....]......^..?
0x0030   0e4e 2b96 3535 3420 7472 6561 732e 7369        .N+.554.treas.si
0x0040   6d74 7265 6173 2e72 7520 4553 4d54 5020        mtreas.ru.ESMTP.
0x0050   6e6f 7420 6163 6365 7074 696e 6720 6d65        not.accepting.me
0x0060   7373 6167 6573 0d0a                            ssages..

Your SMTP server wants to ask something on tcp port 113
of my SMTP server. I have nothing there, and I don't have to.

So please stop complaining about it.
--
vda



More information about the busybox mailing list