Thread (3 messages) 3 messages, 2 authors, 2004-12-08

Re: PATCH: mark_page_accessed() for read()s on non-page boundaries

From: Andrew Morton <hidden>
Date: 2004-12-07 22:28:05

Miquel van Smoorenburg [off-list ref] wrote:
quoted
--- 25/mm/readahead.c~a	Tue Dec  7 13:50:04 2004
+++ 25-akpm/mm/readahead.c	Tue Dec  7 13:50:58 2004
@@ -369,8 +369,10 @@ page_cache_readahead(struct address_spac
 		goto out;	/* Maximally shrunk */
 
 	max = get_max_readahead(ra);
-	if (max == 0)
+	if (max == 0) {
+		ra->prev_page = offset;	/* For do_generic_mapping_read() */
 		goto out;	/* No readahead */
+	}
 
 	orig_next_size = ra->next_size;
OK, got it. Will go and play with that and posix_fadvise(POSIX_FADV_RANDOM)
some more.
It'll probably need to handle the "Maximally shrunk" case too.  But I've
locally merged some readahead rework from Steve Pratt and Ram Pai, and it
looks like the changes will be simpler in that case:

page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
		     struct file *filp, unsigned long offset,
		     unsigned long req_size)
{
	unsigned long max, min;
	unsigned long newsize = req_size;
	unsigned long block;

	/*
	 * Here we detect the case where the application is performing
	 * sub-page sized reads.  We avoid doing extra work and bogusly
	 * perturbing the readahead window expansion logic.
	 * If size is zero, there is no read ahead window so we need one
	 */
	if (offset == ra->prev_page && req_size == 1 && ra->size != 0)
		goto out;


Still.  Work against -rc3 and I can fix stuff up.
--
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:"aart@kvack.org"> aart@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help