[Patch 0/2] SGI Altix and ia64 special memory support.

Skip to first unread message

Robin Holt

Oct 12, 2005, 3:50:26 PM10/12/05

SGI hardware supports a special type of memory called fetchop or atomic
memory. This memory does atomic operations at the memory controller
instead of using the processor.

This patch set introduces a driver so user land can map the devices and
fault pages of the appropriate type. Pages are inserted on first touch.
The reason for that was hashed out earlier on the lists, but can be
distilled to node locality, node resource limitation, and application

Since a typical ia64 uncached page does not have a page struct backing it,
we first modify do_no_page to handle a new return type of NOPAGE_FAULTED.
This indicates to the nopage handler that the desired operation is
complete and should be treated as a minor fault. This is a result of a
discussion which Jes Sorenson started on the the ia64 mailing list and
Christoph Hellwig carried over to the linux-mm mailing list.

The second patch introduces the mspec driver.

I am reposting these today. The last version went out in a rush last
night and I did not take the time to notify the people that were part
of the earlier discussion.

Additionally, the version which Jes posted last April was using
remap_pfn_range(). This version uses set_pte(). I realize that is
probably the wrong thing to do. Unfortunately, we need this to be
thread-safe. With remap_pfn_range() there is a BUG_ON(!pte_none(*pte));
in remap_pte_range() which would trip if there were multiple threads
faulting at the same time. To work around that, I started looking at
breaking remap_pfn_range() into an _remap_pfn_range() which assumed
the locks were already held. At that point, it became apparent I
was stretching the use of remap_pfn_range beyond its original intent.
For this driver, we are inserting a single pte, the page tables have
already been put in place by the caller's chain, why not just insert
the pte directly. That is what I finally did.

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

Robin Holt

Oct 12, 2005, 3:50:29 PM10/12/05

Introduce a NOPAGE_FAULTED flag. This flag is returned from a drivers
nopage handler to indicate the desired pte has been inserted and should
be handled as a minor fault.

Signed-off-by: ho...@sgi.com

Index: linux-2.6/include/linux/mm.h
--- linux-2.6.orig/include/linux/mm.h 2005-10-11 21:15:45.147011169 -0500
+++ linux-2.6/include/linux/mm.h 2005-10-11 21:17:15.814561844 -0500
@@ -619,6 +619,7 @@ static inline int page_mapped(struct pag
#define NOPAGE_OOM ((struct page *) (-1))
+#define NOPAGE_FAULTED ((struct page *) (-2))

* Different kinds of faults, as returned by handle_mm_fault().
Index: linux-2.6/mm/memory.c
--- linux-2.6.orig/mm/memory.c 2005-10-11 21:15:45.162634582 -0500
+++ linux-2.6/mm/memory.c 2005-10-11 21:17:15.849714525 -0500
@@ -1862,6 +1862,14 @@ retry:
if (new_page == NOPAGE_OOM)
return VM_FAULT_OOM;
+ if (new_page == NOPAGE_FAULTED) {
+ spin_lock(&mm->page_table_lock);
+ page_table = pte_offset_map(pmd, address);
+ pte_unmap(page_table);
+ spin_unlock(&mm->page_table_lock);
+ return VM_FAULT_MINOR;
+ }

* Should we do an early C-O-W break?

Robin Holt

Oct 14, 2005, 3:30:14 PM10/14/05

Robin Holt

Oct 14, 2005, 3:30:19 PM10/14/05

Robin Holt

Reply all
Reply to author
0 new messages