On Mon, Dec 13, 2010 at 5:05 PM, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote: > On Mon, 13 Dec 2010 16:51:40 -0800 > Michel Lespinasse <walken@xxxxxxxxxx> wrote: >> Andrew, should I amend my patches to remove the rwsem_is_contended() code ? >> This would involve: >> - remove rwsem-implement-rwsem_is_contended.patch and >> x86-rwsem-more-precise-rwsem_is_contended-implementation.patch >> - in mlock-do-not-hold-mmap_sem-for-extended-periods-of-time.patch, >> drop the one hunk making use of rwsem_is_contended (rest of the patch >> would still work without it) > > I think I fixed all that up. Thanks! >> - optionally, follow up patch to limit batch size to a constant >> in do_mlock_pages(): [... diff snipped ...] >> I don't really prefer using a constant, but I'm not sure how else to make >> Linus happy :) > > rwsem_is_contended() didn't seem so bad to me. > > Reading 1024 pages can still take a long time. I can't immediately > think of a better approach though. Note that we're only concerned page cache hist here, as __get_user_pages with non-NULL nonblocking argument will release mmap_sem when blocking on disk. So time per page is somewhat constant - we don't need to worry about disk seeks at least. -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href