Setting physical CPU for a task

Adam Lackorzynski adam at os.inf.tu-dresden.de
Tue Aug 6 21:46:36 CEST 2013


On Tue Aug 06, 2013 at 14:55:33 +0300, Lluís Vilanova wrote:
> Adam Lackorzynski writes:
> 
> > On Mon Aug 05, 2013 at 21:50:55 +0300, Lluís Vilanova wrote:
> >> I've been unable to see if moe's config files allow to start tasks pinned to a
> >> specific CPU, and after running the "thread_migrate" example, looks like only
> >> one CPU (CPU00) is always used:
> >> 
> >> $ make -C obj/l4/amd64/ qemu E=thread_migrate QEMU_OPTIONS="-serial stdio -vnc ::59000 -smp 2"
> >> [...]
> >> Not using serial hack in slow timer handler.
> >> CPU[0]: AuthenticAMD (6:2:3:0)[00000623] Model: QEMU Virtual CPU version 1.5.1 at 3092MHz
> >> 
> >> 255/512 Entry I TLB (4K pages)    255 Entry I TLB (4M pages)
> >> 255/512 Entry D TLB (4K pages)    255 Entry D TLB (4M pages)
> >> 64 KB L1 I Cache (2-way associative, 64 bytes per line)
> >> 64 KB L1 D Cache (2-way associative, 64 bytes per line)
> >> 512 KB L2 U Cache (8-way associative, 64 bytes per line)
> >> 
> >> Freeing init code/data: 20480 bytes (5 pages)
> >> [...]
> >> Ned says: Hi World!
> >> Ned: loading file: 'rom/thread_migrate.cfg'
> >> migrate | Found 4 CPUs.
> >> migrate | Created 12 threads.
> >> migrate | Migrated Thread00 -> CPU00
> >> migrate | Migrated Thread01 -> CPU00
> >> 
> >> I've modified "src/l4/conf/modules.list" to add the "thread_migrate" test, and
> >> I'm using l4re-snapshot-2013060718, with multiprocessing (with a maximum of 4)
> >> enabled on fiasco.
> >> 
> >> Looks like the benchmark always detects (L4::Scheduler::info) the number of
> >> maximum CPUs configured in fiasco, but not the number of CPUs provided by QEMU
> >> (only CPU 0 is online).
> 
> > That it finds 4 is on purpose because more CPUs could come up.
> > Does it work giving Qemu '-cpu core2duo'?
> 
> Yes, looks like making QEMU look like a somewhat more realistic CPU does no
> choke Fiasco's ability to detect the number of CPUs.

The problem is some unfortunate handling of the startup sequence in Qemu
when using the AMD model (can't remember details right now).

> Still, L4::Scheduler::info says there's as many CPUs as the maximum number
> configured into Fiasco (not the number offered by QEMU). I'm just not sure if
> this should be considered a bug or a feature.

Fiasco does not know what the maximum number of CPUs on that particular
machine will ever be, so it just says what it can support. Also, one has
to wait a bit until all CPUs are up because Fiasco does not wait to
start sigma0+moe until all CPUs are up (e.g. see migrate example).



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list