Re: pagevecs of more than PAGEVEC_SIZE pages

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Steve French <smfrench@...>
Cc: Andrew Morton <akpm@...>, linux-fsdevel <linux-fsdevel@...>, lkml <linux-kernel@...>
Date: Saturday, May 24, 2008 - 6:38 am

On Fri, May 23, 2008 at 12:13:58PM -0500, Steve French (smfrench@gmail.com) wrote:

It depends. In usual life with not that big requests and 64bit arch (or
low mem pages on 32 bit x86) difference is marginal, but with high-pages
and huge requests it was additional 10 MB/s for bulk writing in POHMELFS.


kernel_sendpage() has only single page argument, but that should not be
a problem, since stack will combine multiple pages into single skb if
needed (if it can, especially for stuff like TSO/GSO), so just loop for
whatever you fetched pages via find_get_pages_tag() and send them
one-by-one, network stack will coalesce them by itself.

But note that return of kernel_sendpage() does not guarantee that page
has been sent, one can free it (drop refcnt, page will not be freed,
since network stack increases counter), but can not write there until
reply from the server is returned, so just lock page and mark it is
being under writeback and then unlock and end_page_writeback() after
CIFSSMBWrite2() just like it is doen right now.

Btw, should'n end_page_writeback() be called with locked page in CIFS?
Iirc in POHMELFS under huge load I was able to lose writeback clearing
probably because of that, but its subtle and can be not the issue is
CIFS.

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 8636cec..ba23c65 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1391,8 +1391,8 @@ retry:
 				if (rc)
 					SetPageError(page);
 				kunmap(page);
-				unlock_page(page);
 				end_page_writeback(page);
+				unlock_page(page);
 				page_cache_release(page);
 			}
 			if ((wbc->nr_to_write -= n_iov) <= 0)

-- 
	Evgeniy Polyakov
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pagevecs of more than PAGEVEC_SIZE pages, Steve French, (Thu May 22, 3:13 pm)
Re: pagevecs of more than PAGEVEC_SIZE pages, Andrew Morton, (Fri May 23, 1:54 am)
Re: pagevecs of more than PAGEVEC_SIZE pages, Evgeniy Polyakov, (Fri May 23, 5:29 am)
Re: pagevecs of more than PAGEVEC_SIZE pages, Steve French, (Fri May 23, 1:13 pm)
Re: pagevecs of more than PAGEVEC_SIZE pages, Evgeniy Polyakov, (Sat May 24, 6:38 am)