WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Possible VCPU hotplug bug

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Possible VCPU hotplug bug
From: "Gabriel Southern" <gsouther@xxxxxxx>
Date: Sun, 10 Feb 2008 00:08:53 -0500
Delivery-date: Sat, 09 Feb 2008 21:09:27 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=XpZJdB4hp/YyFi3hGBinby9CPA5C8cTJUCh+i56Mun8=; b=T1O4qbjdd53UsRaRlwlX37kOPhYZtTEAP5NahOU0AAQVl3eHODYLI1FdqBJb/x9Ra1h/DFb77tYPQ5/zCQsBr+D9z08lJZw+gVP/7Zf1L4lym/q7pTbTznD+evwklt3TaV2jHUrNe+wnsHbY/RhdYj3ZqZD6SSM8DCOrJm/0kRc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=tm2EwAL9Aay5bz2c1d4hpI1EHmHz1CpJalMJlZru10yuKy8wdroaQ0pRVbUq7l7FTDJo4UKiFpAgWlWphDAo7fSo9F6BXRB+Cqo9E/mpVX9KgUQwd+QY510yuLTfxaCmJ2QdQolZ6FIrkOqK1S0ljA2lUHVpMKNf8DWj3Fxb9eg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
I am working on a project that uses OpenMP along with Xen's VCPU
hotplug feature.  The OpenMP libraries are used for writing
multi-threaded applications, and they have a function named
omp_get_num_procs() that is used to determine the number of processors
available on the system.  I noticed that when using the xm vcpu-set
command in Xen to change the number of vcpus assigned to a domU that
that omp_get_num_procs() still returns the original value.

In trying to determine the cause of this problem, I found that the
implementation of omp_get_num_procs() is simply calling the
sysconf(_SC_NPROCESSORS_ONLN) function, which is in <unistd.h>.  I
looked at the implementation of sysconf and it appears that it is
parsing the /proc/stat file to count the number of cpus that are
online.  However, the /proc/stat file is not being updated correctly,
which I think is a bug.

To test this I executed the following program:
---------------------------
#include <stdio.h>
#include <unistd.h>

int main()
{
        int num_procs_onln = 0;
        num_procs_onln = sysconf(_SC_NPROCESSORS_ONLN);
        printf("Number of online processors is: %d\n",num_procs_onln);
        return 0;
}
-----------------------------

This program always reported the number of vcpus that the system was
booted with rather than its current configuration.  For example if I
booted my system with vcpus = '6', and then executed xm vcpu-set
xen-vm 4 , to change the number of vcpus to 4 the program still
reported 6 processors.  I also saw that /proc/cpuinfo would only show
4 processors, but that /proc/stat would still list 6.  I think that
/proc/stat should be updated to 4, but I could not figure out why this
was not happening.

If anyone else can test this for me and confirm if they experience the
same problem it would be helpful. Also please let me know if this
should be filed as a bug.  I am using Ubuntu 7.10 with Xen 3.2, I am
not sure if this would be a Linux kernel bug or a Xen bug.

Thanks,

-Gabriel

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] Possible VCPU hotplug bug, Gabriel Southern <=