Wireshark mailing list archives

Re: [tcpdump-workers] mmap consumes more CPU


From: "David Laight" <David.Laight () ACULAB COM>
Date: Mon, 12 Nov 2012 14:01:47 -0000

hi,
  I just checked the two mechanism :
(1) Using mmap to fetch packets from kernel to userspace
(2) Using recvfrom() call to fetch packets

I see top reports
(1) 34% memory 20% cpu usage
(2) 21% memory 7% cpu usage !

It is worth remembering that the cpu usage reported by top isn't
worth the paper it is printed on for many workloads.
IIRC it is based on the cpu state when the timer interrupt fires.
processes that are scheduled very often, and run for short periods
tend to get mis-counted.

Since the Linux scheduler doesn't get a high-res timestamp everytime
it does a process switch, about the only way to measure idle time
is to put a very low priority process into a counting loop.
Unfortunately the scheduler might make it difficult to make the
processes priority low enough.

        David




___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: