On Fri, 2006-09-01 at 20:04 +0200, Martin Schwidefsky wrote: > On Fri, 2006-09-01 at 11:03 -0700, Dave Hansen wrote: > > OK. It comes down to a race between > > > > __remove_from_page_cache()/__delete_from_swap_cache() > > > > and > > > > __page_discard() > > > > running on the same page at the same time. Right? > > Yes. OK, and there's no other workable solution to exclude each other from running at the same time than a bit in page->flags? It seems like that hashed lock (or lock in mem_map[]) we were talking about earlier might be applicable here, too. Do we ever discard pages other than ones that have just recently failed to be made stable? There seems to be a lot of if (!page_make_stable(page) { ... page_discard(page); } Some of these call sites even have mapping->page_lock held when the page_make_stable() occurs, so they would have _already_ excluded __remove_from_page_cache(). At which call sites is it not feasible to acquire mapping->page_lock? -- Dave