WANG Cheng D
2014-Dec-22 08:40 UTC
[libvirt-users] why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application
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. How can I solve this problem? Any replies are highly appreciated. Cheng
Martin Kletzander
2014-Dec-22 10:12 UTC
Re: [libvirt-users] why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application
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@redhat.com >https://www.redhat.com/mailman/listinfo/libvirt-users
WANG Cheng D
2014-Dec-23 01:52 UTC
Re: [libvirt-users] why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application
Dear Martin, Thank you for your suggestion. I have submitted a bug report on this ( libvirt version 1.2.5). For your reference, the report No. is 1176584. Just like you said, I set the affinity of my process to temporarily solve this problem. With my warmest regards Cheng -----Original Message----- From: Martin Kletzander [mailto:mkletzan@redhat.com] Sent: 2014年12月22日 18:13 To: WANG Cheng D Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application 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@redhat.com >https://www.redhat.com/mailman/listinfo/libvirt-users
Reasonably Related Threads
- Re: why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application
- lxc-enter-namespace not supportted with python?
- Re: oddity with lxc-enter-namespace
- Does libvirt lxc driver support "cpuset" attribute?
- Problem about lxc-enter-namespace interface