lkml.org 
[lkml]   [2009]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mm: disable preemption in apply_to_pte_range
commit 79d9c90453a7bc9e7613ae889a97ff6b44ab8380
Author: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Date: Thu Feb 12 13:45:34 2009 -0800

mm: disable preemption in apply_to_pte_range

Lazy mmu mode needs preemption disabled, so if we're apply to
init_mm (which doesn't require any pte locks), then explicitly
disable preemption.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

diff --git a/mm/memory.c b/mm/memory.c
index baa999e..71b3fb8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1710,9 +1710,11 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
pgtable_t token;
spinlock_t *uninitialized_var(ptl);

- pte = (mm == &init_mm) ?
- pte_alloc_kernel(pmd, addr) :
- pte_alloc_map_lock(mm, pmd, addr, &ptl);
+ if (mm == &init_mm) {
+ preempt_disable();
+ pte = pte_alloc_kernel(pmd, addr);
+ } else
+ pte = pte_alloc_map_lock(mm, pmd, addr, &ptl);
if (!pte)
return -ENOMEM;

@@ -1732,6 +1734,9 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,

if (mm != &init_mm)
pte_unmap_unlock(pte-1, ptl);
+ else
+ preempt_enable();
+
return err;
}



\
 
 \ /
  Last update: 2009-02-13 01:23    [W:0.053 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site