]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] mm: powerpc ptlock comments
authorHugh Dickins <hugh@veritas.com>
Wed, 23 Nov 2005 21:37:39 +0000 (13:37 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 24 Nov 2005 00:08:38 +0000 (16:08 -0800)
Update comments (only) on page_table_lock and mmap_sem in arch/powerpc.
Removed the comment on page_table_lock from hash_huge_page: since it's no
longer taking page_table_lock itself, it's irrelevant whether others are; but
how it is safe (even against huge file truncation?) I can't say.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/tlb_32.c
arch/powerpc/mm/tlb_64.c

index 426c269e552eec77bbee18cb086f900716cffb4a..9250f14be8efcc9e8c1001f63208b90e9707ecc0 100644 (file)
@@ -754,9 +754,7 @@ repeat:
        }
 
        /*
-        * No need to use ldarx/stdcx here because all who
-        * might be updating the pte will hold the
-        * page_table_lock
+        * No need to use ldarx/stdcx here
         */
        *ptep = __pte(new_pte & ~_PAGE_BUSY);
 
index 4bd7b0a70996a6e569790ef8652241d61edb37ba..ed6ed2e30daccaf09ff4967468fff97a312f5a02 100644 (file)
@@ -495,7 +495,7 @@ EXPORT_SYMBOL(flush_icache_user_range);
  * We use it to preload an HPTE into the hash table corresponding to
  * the updated linux PTE.
  * 
- * This must always be called with the mm->page_table_lock held
+ * This must always be called with the pte lock held.
  */
 void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
                      pte_t pte)
index 6c3dc3c44c86da012cafde5b0ddc54b93ebef019..ad580f3742e5cf187bfe65cf6f7c1f948d3ff558 100644 (file)
@@ -149,6 +149,12 @@ void flush_tlb_mm(struct mm_struct *mm)
                return;
        }
 
+       /*
+        * It is safe to go down the mm's list of vmas when called
+        * from dup_mmap, holding mmap_sem.  It would also be safe from
+        * unmap_region or exit_mmap, but not from vmtruncate on SMP -
+        * but it seems dup_mmap is the only SMP case which gets here.
+        */
        for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
                flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
        FINISH_FLUSH;
index 53e31b834ace00f75dbc686321d9ddbeeab8eff7..859d29a0cac5c58c53752efd0df59477c14ea2ef 100644 (file)
@@ -95,7 +95,7 @@ static void pte_free_submit(struct pte_freelist_batch *batch)
 
 void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
 {
-       /* This is safe as we are holding page_table_lock */
+       /* This is safe since tlb_gather_mmu has disabled preemption */
         cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
        struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
 
@@ -206,7 +206,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
 
 void pte_free_finish(void)
 {
-       /* This is safe as we are holding page_table_lock */
+       /* This is safe since tlb_gather_mmu has disabled preemption */
        struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
 
        if (*batchp == NULL)