sched_child_runs_first doesn't work

valdis.kletnieks at vt.edu valdis.kletnieks at vt.edu
Sat Dec 9 03:19:03 EST 2017


On Sat, 09 Dec 2017 11:04:09 +0330, alireza sanaee said:

> I think if it works in that way, it doesn't make sense at all!!!! Parent
> and child ordering rules should preserve even on different cores!

Find where in kernel/sched.c there's specific code to guarantee that
if the child/parent is started on one core, the other isn't scheduled again
until after the first one runs, rather than run immediately because it's
able to run on an otherwise idle core, so you don't get a 'first' or
'last', but 'at the same time'.

And if they run concurrently, the printf output will have a race
condition.  At that point, the order of output is probably determined
by something other than which one scheduled first (the I/O stack
or exit() processing being the primary suspects).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20171209/8d57b26b/attachment-0001.bin 


More information about the Kernelnewbies mailing list