[Oisf-devel] CPU affinity in PF_RING

Chris Wakelin c.d.wakelin at reading.ac.uk
Fri Jan 13 15:47:38 UTC 2012


On 13/01/12 15:28, Victor Julien wrote:
> On 01/13/2012 04:13 PM, Chris Wakelin wrote:
>> Hi,
>>
>> I've been using the "workers" runmode in PF_RING (with cluster_flow) for
>> weeks and have just noticed it doesn't seem to pay attention to the
>> set_cpu_affinity setting. Is there a good reason for this? I quite like
>> the idea of tying a single receive-detect-log path to a particular CPU,
>> which is one of the reasons I liked Will Metcalf's "single" runmode.
> 
> No reason, just one missing line of code :) Update to git master please!
> The worker threads use the "detect" affinity settings now.
> 
>> The reason I'm asking is my Suricata (1.2rc1 equivalent) is getting
>> "busy" at times where one thread is consuming 100% of its CPU core and
>> then dropping packets. Restarting Suricata fixes it for a while. It
>> doesn't appear to be load-related (well, not number of packets or bytes,
>> anyway) but might be getting triggered by particular network events.
>> Having CPU affinity set might help keep track of one particular thread.
> 
> If you detect it when it happens, a bt of the running process (or rather
> a couple of bt's) would be much appreciated!
> 


I've got loads of bts :) which I'll send privately. The one that just
happened has

>   10 Thread 0x7fbff7858700 (LWP 12334)  SigGetThresholdTypeIter (sig=0x44ce980, p=0x2814090, psm=0x7fbff7856b68) at detect-engine-threshold.c:102
>   9 Thread 0x7fbff7057700 (LWP 12335)  0x00007fbff8aacf93 in poll () from /lib/libc.so.6
>   8 Thread 0x7fbff6856700 (LWP 12336)  0x00007fbff8aacf93 in poll () from /lib/libc.so.6
>   7 Thread 0x7fbff6055700 (LWP 12337)  0x00007fbff8aacf93 in poll () from /lib/libc.so.6
>   6 Thread 0x7fbff5854700 (LWP 12338)  0x00007fbff91d73f5 in pthread_mutex_lock () from /lib/libpthread.so.0
>   5 Thread 0x7fbfef7ff700 (LWP 12339)  0x00007fbff8aacf93 in poll () from /lib/libc.so.6
>   4 Thread 0x7fbfedffe700 (LWP 12340)  0x00007fbff91d9bc9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
>   3 Thread 0x7fbfecffd700 (LWP 12345)  0x00007fbff91d9bc9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
>   2 Thread 0x7fbfe3fff700 (LWP 12346)  0x00007fbff91d9bc9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
> * 1 Thread 0x7fbffa2ad720 (LWP 12333)  0x00007fbff8a7d39d in nanosleep () from /lib/libc.so.6

with LWP 12334 using 99% of its core.

Best Wishes,
Chris

-- 
--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
Christopher Wakelin,                           c.d.wakelin at reading.ac.uk
IT Services Centre, The University of Reading,  Tel: +44 (0)118 378 2908
Whiteknights, Reading, RG6 6AF, UK              Fax: +44 (0)118 975 3094



More information about the Oisf-devel mailing list