[dpdk-dev] [PATCH] eal: fix ctrl thread affinity with --lcores

David Marchand david.marchand at redhat.com
Tue Jul 30 15:47:41 CEST 2019


On Tue, Jul 30, 2019 at 1:38 PM Johan Källström
<johan.kallstrom at ericsson.com> wrote:
> The CPU failsafe is nice to have as you could set the thread affinity to offline cpus.

Created a "dpdk" cpuset and put cpus 4-7 into it (my system is mono
numa with 8 cpus)
# cd /sys/fs/cgroup/cpuset/
# mkdir dpdk
# cd dpdk
# echo 4-7 > cpuset.cpus
# echo 0 > cpuset.mems

Disabled cpu 5.
# echo 0 > /sys/bus/cpu/devices/cpu5/online

Put my shell that starts testpmd in this dpdk cpuset
# echo 4439 > tasks


EAL refuses an offline core when parsing the thread affinities and
this did not change.

$ ./master/app/testpmd --master-lcore 0 --lcores '(0,7)@(7,4,5)'
--log-level *:debug --no-huge  --no-pci -m 512 -- -i
--total-num-mbufs=2048
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 0 on socket 0
EAL: Detected lcore 6 as core 2 on socket 0
EAL: Detected lcore 7 as core 3 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 7 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: core 5 unavailable
EAL: invalid parameter for --lcores

What did I miss?


>
> Maybe also add the example I gave you to trigger the bug? https://bugs.dpdk.org/show_bug.cgi?id=322#c12

I managed to reproduce your error with the setup above (without
relying on the cset tool that is not available on rhel afaics), I can
add it to the commitlog yes.


> This also shows how to set the default_affinity mask and proves that the calculation will result in threads inside the cpuset on Linux.
>
> /Johan
>
> On tis, 2019-07-30 at 11:35 +0200, David Marchand wrote:
> > When using -l/-c options, each lcore is mapped to a physical cpu in a
> > 1:1 fashion.
> > On the contrary, when using --lcores, each lcore has its own cpuset
>
> Use "thread affinity" instead of cpuset when we talk about setting the thread affinity.
>
> I know that the term cpuset is used in the data structure, but it is not a cpuset as described by 'man cpuset' (on Linux). This comment can be seen as cosmetic, but I think that it could be good to have a clear definitions to minimize confusion.

Indeed, using cpuset is inappropriate.
I will update the commitlog and the comment.



-- 
David Marchand


More information about the dev mailing list