mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[LINUX] Eliminates a deadlock and reduce (sometimes significantly) the time
interrupts are off during context switch. Signed-off-by: Jan Beulich <jbeulich@novell.com>
This commit is contained in:
1 parent
9d43a190b1
commit
1d0986e6b4
7 files changed
+1653
-9
No files matched your search
@@ -614,6 +614,12 @@ void mm_pin_all(void)
|
||||
}
|
||||
}
|
||||
|
||||
void _arch_dup_mmap(struct mm_struct *mm)
|
||||
{
|
||||
if (!test_bit(PG_pinned, &virt_to_page(mm->pgd)->flags))
|
||||
mm_pin(mm);
|
||||
}
|
||||
|
||||
void _arch_exit_mmap(struct mm_struct *mm)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
|
||||
@@ -130,6 +130,12 @@ void mm_pin_all(void)
|
||||
context.unpinned));
|
||||
}
|
||||
|
||||
void _arch_dup_mmap(struct mm_struct *mm)
|
||||
{
|
||||
if (!mm->context.pinned)
|
||||
mm_pin(mm);
|
||||
}
|
||||
|
||||
void _arch_exit_mmap(struct mm_struct *mm)
|
||||
{
|
||||
struct task_struct *tsk = current;
|
||||
|
||||
@@ -18,4 +18,8 @@ typedef struct {
|
||||
extern void _arch_exit_mmap(struct mm_struct *mm);
|
||||
#define arch_exit_mmap(_mm) _arch_exit_mmap(_mm)
|
||||
|
||||
/* kernel/fork.c:dup_mmap hook */
|
||||
extern void _arch_dup_mmap(struct mm_struct *mm);
|
||||
#define arch_dup_mmap(mm, oldmm) ((void)(oldmm), _arch_dup_mmap(mm))
|
||||
|
||||
#endif
|
||||
@@ -51,8 +51,7 @@ static inline void switch_mm(struct mm_struct *prev,
|
||||
struct mmuext_op _op[2], *op = _op;
|
||||
|
||||
if (likely(prev != next)) {
|
||||
if (!test_bit(PG_pinned, &virt_to_page(next->pgd)->flags))
|
||||
mm_pin(next);
|
||||
BUG_ON(!test_bit(PG_pinned, &virt_to_page(next->pgd)->flags));
|
||||
|
||||
/* stop flush ipis for the previous mm */
|
||||
cpu_clear(cpu, prev->cpu_vm_mask);
|
||||
@@ -99,7 +98,11 @@ static inline void switch_mm(struct mm_struct *prev,
|
||||
#define deactivate_mm(tsk, mm) \
|
||||
asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
|
||||
|
||||
#define activate_mm(prev, next) \
|
||||
switch_mm((prev),(next),NULL)
|
||||
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
|
||||
{
|
||||
if (!test_bit(PG_pinned, &virt_to_page(next->pgd)->flags))
|
||||
mm_pin(next);
|
||||
switch_mm(prev, next, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,6 +28,10 @@ extern spinlock_t mm_unpinned_lock;
|
||||
/* mm/memory.c:exit_mmap hook */
|
||||
extern void _arch_exit_mmap(struct mm_struct *mm);
|
||||
#define arch_exit_mmap(_mm) _arch_exit_mmap(_mm)
|
||||
|
||||
/* kernel/fork.c:dup_mmap hook */
|
||||
extern void _arch_dup_mmap(struct mm_struct *mm);
|
||||
#define arch_dup_mmap(mm, oldmm) ((void)(oldmm), _arch_dup_mmap(mm))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -73,8 +73,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
||||
struct mmuext_op _op[3], *op = _op;
|
||||
|
||||
if (likely(prev != next)) {
|
||||
if (!next->context.pinned)
|
||||
mm_pin(next);
|
||||
BUG_ON(!next->context.pinned);
|
||||
|
||||
/* stop flush ipis for the previous mm */
|
||||
clear_bit(cpu, &prev->cpu_vm_mask);
|
||||
@@ -127,8 +126,11 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
||||
asm volatile("movl %0,%%fs"::"r"(0)); \
|
||||
} while(0)
|
||||
|
||||
#define activate_mm(prev, next) do { \
|
||||
switch_mm((prev),(next),NULL); \
|
||||
} while (0)
|
||||
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
|
||||
{
|
||||
if (!next->context.pinned)
|
||||
mm_pin(next);
|
||||
switch_mm(prev, next, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff