public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Thread scheduler misbehaviour OR Oprofile bug?
@ 2015-01-16 14:01 Zoltan Kiss
  2015-01-16 15:38 ` William Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: Zoltan Kiss @ 2015-01-16 14:01 UTC (permalink / raw)
  To: oprofile-list, linux-kernel

Hi,

I'm using OProfile to check some suspicious behaviour of dpdk-pktgen, 
and I can see something which troubles me. Either the scheduler lies 
about core affinity or Oprofile accounts some samples wrongly.
This userspace app runs in threads, which are assigned explicitly to one 
single core with pthread_setaffinity_np (I've added some debug lines 
which checks the affinity with pthread_getaffinity_np to make sure that 
the affinity was correctly set indeed)
These threads run infinite loops, calling different functions. In my 
example one of these functions (pktgen_main_rxtx_loop) should only be 
called by the thread on core #1, but in the oprofile results I can see 
samples from all other cores as well. I've added a sched_getcpu() call 
to every iteration of that infinite loop to check if it runs anywhere 
else than core #1, but it seems to be fine.
So my conclusion is that either the scheduler doesn't care about thread 
affinity and even sched_getcpu() can't see that, OR, Oprofile falsely 
accounts samples to the wrong CPU. Or to the wrong symbol, although I've 
added "__attribute__ ((noinline))" to every called function to make sure 
that inlineing doesn't screw up anything.
I'm running my tests on Ubuntu Servers with 14.04 with 3.13.0-32 kernel, 
the CPU is a desktop kind, i5-4570 @ 3.20GHz (no-HT!) with oprofile 0.9.9.
Anyone have a suggestion about what happens?

Regards,

Zoltan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-16 19:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-16 14:01 Thread scheduler misbehaviour OR Oprofile bug? Zoltan Kiss
2015-01-16 15:38 ` William Cohen
2015-01-16 15:50   ` Zoltan Kiss
2015-01-16 18:29   ` Zoltan Kiss
2015-01-16 19:37     ` William Cohen
2015-01-16 19:47       ` Zoltan Kiss
2015-01-16 19:40   ` Zoltan Kiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox