gettimeofday() in hping

Stefan Lambrev stefan.lambrev at moneybookers.com
Sat Jan 26 02:40:52 PST 2008


Greetings,

Kris Kennaway wrote:
> Joseph Koshy wrote:
>>>  OK, this is the famous problem with modern CPUs that jkoshy has 
>>> declined
>>>  to work around :(  There are patches for this in perforce, see
>>>
>>>  http://perforce.freebsd.org/changeView.cgi?CH=126189
>>
>> "Famous problem" indeed :).   I declined the patch because it
>> is incorrect and incomplete.
>
>> I will accept a patch that demonstrates clue about the
>> workings of the overall system---the changes in the patch
>> should be safe, complete, should demonstrate that the submitter
>> has read and understood vendor documentation, should preserve
>> user experience for naming events, and each supported PMC event
>> needs to be documented in pmc.3.
>
> I am aware of these issues but repeat my statement that the lack of 
> working pmc on modern CPUs is causing serious difficulties for our 
> developer and user base, as witnessed again in this thread.
>
> Kris
Kris do you think the information, that I send you (private email) is 
useful ? :)
Also using hwpmc with your patch shows a serious problem with pf and 
dynamic rules.
I have desktop PC at home where hwpmc work out of the box, but I'm 
running 6.3 on it.
If the information that I send you is not useful, I can spend my weekend 
upgrading my desktop PC to RELENG_7_0
and providing new pmc stats, but I have to be sure that developers are 
interested in fixing those issues.
I'm willing to invest my time in this, but my skills are not enough to 
solve the issues alone, and without help I'll just waste my time.
How hping works is not my biggest problem - for me as I said on few 
other mail list the real showstopper is pf and it's keep-state feature.
The interesting part is that both problems point to kernel spending most 
of it's time in _mtx_lock_sleep():

pmcstat - pf - during syn flood:
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 24.0  268416.00 268416.00        0  100.00%           _mtx_lock_sleep [1]
  6.7  343572.50 75156.50        0  100.00%           
pf_state_compare_ext_gwy [2]
  6.7  418405.50 74833.00        0  100.00%           pf_src_compare [3]
  3.9  462298.50 43893.00        0  100.00%           
pf_state_compare_lan_ext [4]
  3.6  503019.50 40721.00        0  100.00%           pf_test [5]

pmcstat - hping:

  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
  8.6  116120.00 116120.00        0  100.00%           _mtx_lock_sleep [1]
  5.5  190764.00 74644.00        0  100.00%           syscall [2]
  3.0  231390.00 40626.00        0  100.00%           bpf_mtap [3]
  2.9  270334.00 38944.00        0  100.00%           Xfast_syscall [4]
  2.5  304458.00 34124.00        0  100.00%           
bus_dmamap_load_mbuf_sg [5]
  2.3  335825.00 31367.00        0  100.00%           uma_zalloc_arg [6]

P.S. my desktop PC i single core, but I think I'll find old server with 
2x intel p4 CPUs.

-- 

Best Wishes,
Stefan Lambrev
ICQ# 24134177



More information about the freebsd-hackers mailing list