Message ID | 20140521134027.263DDE009B@blue.fi.intel.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Wed, 21 May 2014 16:40:27 +0300 (EEST) "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote: > > Or something. Can we please get some code commentary over > > do_fault_around() describing this design decision and explaining the > > reasoning behind it? > > I'll do this. But if do_fault_around() rework is needed, I want to do that > first. This sort of thing should be at least partially driven by observation and I don't have the data for that. My seat of the pants feel is that after the first fault, accesses at higher addresses are more common/probable than accesses at lower addresses. In which case we should see improvements by centering the window at some higher address than the fault. Much instrumentation and downstream analysis is needed and the returns will be pretty small! But we don't need to do all that right now. Let's get the current implementation wrapped up for 3.15: get the interface finalized (bytes, not pages!) and get the current design decisions appropriately documented.
diff --git a/mm/memory.c b/mm/memory.c index 252b319e8cdf..f76663c31da6 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3460,7 +3460,7 @@ static void do_fault_around(struct vm_area_struct *vma, unsigned long address, /* * max_pgoff is either end of page table or end of vma - * or fault_around_pages() from pgoff, depending what is neast. + * or fault_around_pages() from pgoff, depending what is nearest. */ max_pgoff = pgoff - ((start_addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) + PTRS_PER_PTE - 1;