Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221025
b: refs/heads/master
c: 4e54d93
h: refs/heads/master
i:
  221023: 0bf9438
v: v3
  • Loading branch information
Mika Westerberg authored and Russell King committed Oct 28, 2010
1 parent e88d061 commit 52179dc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e929d2bcf13eeaa9636448c55690b383a910391
refs/heads/master: 4e54d93d3c9846ba1c2644ad06463dafa690d1b7
28 changes: 26 additions & 2 deletions trunk/arch/arm/mm/fault-armv.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
return ret;
}

#if USE_SPLIT_PTLOCKS
/*
* If we are using split PTE locks, then we need to take the page
* lock here. Otherwise we are using shared mm->page_table_lock
* which is already locked, thus cannot take it.
*/
static inline void do_pte_lock(spinlock_t *ptl)
{
/*
* Use nested version here to indicate that we are already
* holding one similar spinlock.
*/
spin_lock_nested(ptl, SINGLE_DEPTH_NESTING);
}

static inline void do_pte_unlock(spinlock_t *ptl)
{
spin_unlock(ptl);
}
#else /* !USE_SPLIT_PTLOCKS */
static inline void do_pte_lock(spinlock_t *ptl) {}
static inline void do_pte_unlock(spinlock_t *ptl) {}
#endif /* USE_SPLIT_PTLOCKS */

static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
unsigned long pfn)
{
Expand All @@ -90,11 +114,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
*/
ptl = pte_lockptr(vma->vm_mm, pmd);
pte = pte_offset_map(pmd, address);
spin_lock(ptl);
do_pte_lock(ptl);

ret = do_adjust_pte(vma, address, pfn, pte);

spin_unlock(ptl);
do_pte_unlock(ptl);
pte_unmap(pte);

return ret;
Expand Down

0 comments on commit 52179dc

Please sign in to comment.