lkml.org 
[lkml]   [2001]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/memory.c locking comments fix
Date

Some of the comments in and before handle_pte_fault() are obsolete or
misleading:

- page_table_lock has been pushed up into handle_mm_fault() and down
into the various do_xxx_page() handlers.

- mmap_sem protects the adding of vma structures to the vmlist, not
pages to the page tables.

Paul

--- linux/mm/memory.c Fri Apr 27 14:23:25 2001
+++ linux.new/mm/memory.c Wed Jun 27 20:57:48 2001
@@ -1280,14 +1280,10 @@
* with external mmu caches can use to update those (ie the Sparc or
* PowerPC hashed page tables that act as extended TLBs).
*
- * Note the "page_table_lock". It is to protect against kswapd removing
- * pages from under us. Note that kswapd only ever _removes_ pages, never
- * adds them. As such, once we have noticed that the page is not present,
- * we can drop the lock early.
- *
- * The adding of pages is protected by the MM semaphore (which we hold),
- * so we don't need to worry about a page being suddenly been added into
- * our VM.
+ * The addition and removal of vma structures is protected by the MM
+ * semaphore (which we hold), so we don't need to worry about a vma
+ * being suddenly been added into our VM, or the vma that we hold
+ * becoming invalid.
*/
static inline int handle_pte_fault(struct mm_struct *mm,
struct vm_area_struct * vma, unsigned long address,
@@ -1297,11 +1293,6 @@

entry = *pte;
if (!pte_present(entry)) {
- /*
- * If it truly wasn't present, we know that kswapd
- * and the PTE updates will not touch it later. So
- * drop the lock.
- */
if (pte_none(entry))
return do_no_page(mm, vma, address, write_access, pte);
return do_swap_page(mm, vma, address, pte, pte_to_swp_entry(entry), write_access);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.080 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site