diff options
author | Brent Casavant <bcasavan@sgi.com> | 2006-01-27 00:55:52 +0100 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-01-27 00:55:52 +0100 |
commit | e08e6c521355cd33e647b2f739885bc3050eead6 (patch) | |
tree | 251dd80647bd3a0140f5f31c35c125094c035f9c /include/asm-ia64/system.h | |
parent | [SPARC64]: Use compat_sys_futimesat in 32-bit syscall table. (diff) | |
download | linux-e08e6c521355cd33e647b2f739885bc3050eead6.tar.xz linux-e08e6c521355cd33e647b2f739885bc3050eead6.zip |
[IA64] hooks to wait for mmio writes to drain when migrating processes
On SN2, MMIO writes which are issued from separate processors are not
guaranteed to arrive in any particular order at the IO hardware. When
performing such writes from the kernel this is not a problem, as a
kernel thread will not migrate to another CPU during execution, and
mmiowb() calls can guarantee write ordering when control of the IO
resource is allowed to move between threads.
However, when MMIO writes can be performed from user space (e.g. DRM)
there are no such guarantees and mechanisms, as the process may
context-switch at any time, and may migrate to a different CPU as part
of the switch. For such programs/hardware to operate correctly, it is
required that the MMIO writes from the old CPU be accepted by the IO
hardware before subsequent writes from the new CPU can be issued.
The following patch implements this behavior on SN2 by waiting for a
Shub register to indicate that these writes have been accepted. This
is placed in the context switch-in path, and only performs the wait
when the newly scheduled task changes CPUs.
Signed-off-by: Prarit Bhargava <prarit@sgi.com>
Signed-off-by: Brent Casavant <bcasavan@sgi.com>
Diffstat (limited to 'include/asm-ia64/system.h')
-rw-r--r-- | include/asm-ia64/system.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 80c5a234e259..99b6f307e94b 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -244,6 +244,13 @@ extern void ia64_load_extra (struct task_struct *task); __ia64_save_fpu((prev)->thread.fph); \ } \ __switch_to(prev, next, last); \ + /* "next" in old context is "current" in new context */ \ + if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \ + (task_cpu(current) != \ + task_thread_info(current)->last_cpu))) { \ + platform_migrate(current); \ + task_thread_info(current)->last_cpu = task_cpu(current); \ + } \ } while (0) #else # define switch_to(prev,next,last) __switch_to(prev, next, last) |