Re: [patch]readahead: fault retry breaks mmap file read random detection
From: Shaohua Li <shli@kernel.org>
Date: 2012-08-23 01:10:11
On Wed, Aug 22, 2012 at 11:40:33AM -0400, Rik van Riel wrote:
On 08/21/2012 11:40 PM, Shaohua Li wrote:quoted
.fault now can retry. The retry can break state machine of .fault. In filemap_fault, if page is miss, ra->mmap_miss is increased. In the second try, since the page is in page cache now, ra->mmap_miss is decreased. And these are done in one fault, so we can't detect random mmap file access. Add a new flag to indicate .fault is tried once. In the second try, skip ra->mmap_miss decreasing. The filemap_fault state machine is ok with it.quoted
Index: linux/arch/avr32/mm/fault.c ===================================================================--- linux.orig/arch/avr32/mm/fault.c 2012-08-22 09:51:23.035526683 +0800 +++ linux/arch/avr32/mm/fault.c 2012-08-22 09:52:22.822775020 +0800@@ -152,6 +152,7 @@ good_area: tsk->min_flt++; if (fault & VM_FAULT_RETRY) { flags &= ~FAULT_FLAG_ALLOW_RETRY; + flags |= FAULT_FLAG_TRIED;Is there any place where you set FAULT_FLAG_TRIED where FAULT_FLAG_ALLOW_RETRY is not cleared? In other words, could we use the absence of the FAULT_FLAG_ALLOW_RETRY as the test, avoiding the need for a new bit flag?
There are still several archs (~7) don't enable fault retry yet. For such archs, FAULT_FLAG_ALLOW_RETRY isn't set in the first try. If all archs support fault retry, the new flag is unnecessary. Thanks, Shaohua -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>