All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vm_operation to avoid pagefault/inval race
@ 2003-05-30 23:34 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2003-05-30 23:34 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: akpm, hch

Rediffed to 2.5.70-mm2.

This patch provides one way for a distributed filesystem to avoid
the pagefault/cross-node-invalidation race described in:

	http://marc.theaimsgroup.com/?l=linux-kernel&m=105286345316249&w=2

The advantage of this patch is that it is quite small and quite well
tested.  A different approach follows in a separate message.

						Thanx, Paul

diff -urN -X dontdiff linux-2.5.70-mm2/include/linux/mm.h linux-2.5.70-mm2.nopagedone/include/linux/mm.h
--- linux-2.5.70-mm2/include/linux/mm.h	Fri May 30 14:51:05 2003
+++ linux-2.5.70-mm2.nopagedone/include/linux/mm.h	Fri May 30 15:11:24 2003
@@ -143,6 +143,7 @@
 	void (*open)(struct vm_area_struct * area);
 	void (*close)(struct vm_area_struct * area);
 	struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int unused);
+	void (*nopagedone)(struct vm_area_struct * area, unsigned long address, int status);
 	int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
 };
 
diff -urN -X dontdiff linux-2.5.70-mm2/mm/memory.c linux-2.5.70-mm2.nopagedone/mm/memory.c
--- linux-2.5.70-mm2/mm/memory.c	Fri May 30 14:51:06 2003
+++ linux-2.5.70-mm2.nopagedone/mm/memory.c	Fri May 30 15:11:24 2003
@@ -1468,6 +1468,9 @@
 	ret = VM_FAULT_OOM;
 out:
 	pte_chain_free(pte_chain);
+	if (vma->vm_ops && vma->vm_ops->nopagedone) {
+		vma->vm_ops->nopagedone(vma, address & PAGE_MASK, ret);
+	}
 	return ret;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-31  0:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-30 23:34 [PATCH] vm_operation to avoid pagefault/inval race Paul E. McKenney
2003-05-30 23:34 ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.