Setting physical CPU for a task

Lluís Vilanova vilanova at ac.upc.edu
Mon Aug 5 20:50:55 CEST 2013


Hi,

I've been looking for a way to run some sort of ping-pong example where each
task runs on either the same or different CPUs.

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
  migrate | Migrated Thread02 -> CPU00
  migrate | Migrated Thread03 -> CPU00
  migrate | Migrated Thread04 -> CPU00
  migrate | Migrated Thread05 -> CPU00
  migrate | Migrated Thread06 -> CPU00
  migrate | Migrated Thread07 -> CPU00
  migrate | Migrated Thread08 -> CPU00
  migrate | Migrated Thread09 -> CPU00
  migrate | Migrated Thread10 -> CPU00
  migrate | Migrated Thread11 -> CPU00
  migrate | Migrated Thread00 -> CPU00
  migrate | Migrated Thread01 -> CPU00
  migrate | Migrated Thread02 -> CPU00
  migrate | Migrated Thread03 -> CPU00
  migrate | Migrated Thread04 -> CPU00
  migrate | Migrated Thread05 -> CPU00
  migrate | Migrated Thread06 -> CPU00
  migrate | Migrated Thread07 -> CPU00
  migrate | Migrated Thread08 -> CPU00
  migrate | Migrated Thread09 -> CPU00
  migrate | Migrated Thread10 -> CPU00
  migrate | Migrated Thread11 -> CPU00
  [... same output forever ...]

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).

Am I missing some step to set all CPUs online? Is it possible to have MOE start
tasks pinned to a specific CPU?


Thanks a lot,
  Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth




More information about the l4-hackers mailing list