[libvirt-users] why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application

Martin Kletzander mkletzan at redhat.com
Mon Dec 22 10:12:39 UTC 2014


On Mon, Dec 22, 2014 at 08:40:03AM +0000, WANG Cheng D wrote:
>Dear all,
>
>I want my container to run on the third CPU core and I define this by the following xml scrpits:
><vcpu placement="static" cpuset="3">1</vcpu>
>
>When I run my application in a container terminal, I can see the application runs on the third core as expected.
>When I run my application using lxc-enter-namespace, the CPU pinning doesn't take effect, i.e., the application runs on a core which isn't the third one.
>

I'm not expert on lxc namespaces, but looking at the code I think that
virDomainLxcEnterNamespace() just doesn't care about such settings.
It does not put the PID created into the cgroup of that container nor
does it put anywhere else.

>How can I solve this problem?
>

I'm thinking of patching this part, but unsure what the right approach
should be it feels like guessing.  Could you create a bug for this
issue, so we can track, please?

In the meantime, I think it would work if you set the affinity of your
process which is calling virDomainLxcEnterNamespace() before and
restore it afterwards.

Martin

>Any replies are highly appreciated.
>
>Cheng

>_______________________________________________
>libvirt-users mailing list
>libvirt-users at redhat.com
>https://www.redhat.com/mailman/listinfo/libvirt-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20141222/183eabdf/attachment.sig>


More information about the libvirt-users mailing list