261c261 < /* we need pagemap_lru_lock for list_del() ... subtle code below */ --- > /* we need pagemap_lru_lock for lru_cache head movement... subtle code below */ 263c263,268 < while (count > 0 && (page_lru = lru_cache.prev) != &lru_cache) { --- > page_lru = &lru_cache; > while (count > 0) { > page_lru = page_lru->prev; > if (page_lru == &lru_cache) > break; /* one whole run */ > 265d269 < list_del(page_lru); 270,271c274,275 < page->age = 0; < goto dispose_continue; --- > page->age = 10; > continue; 277c281 < goto dispose_continue; --- > continue; 285c289 < goto dispose_continue; --- > continue; 288c292,302 < goto dispose_continue; --- > continue; > > /* move header before unlock... > * NOTE: the page to scan might move on while having > * pagemap_lru unlocked. Avoid rescanning same pages > * by moving head and set page_lru to NULL to avoid > * misuses! > */ > list_del(&lru_cache); > list_add_tail(&lru_cache, page_lru); > page_lru = NULL; 324a339,341 > if (page_count(page) < 2) > BUG(); > 348c365 < goto async_swap; --- > goto async_swap_continue; 371c388 < async_swap: --- > async_swap_continue: 375a393 > /* no lock held here? SMP? is page_cache_get enough? */ 379c397 < list_add(page_lru, &lru_cache); --- > page_lru = &lru_cache; 386,388d403 < UnlockPage(page); < page_cache_release(page); < ret = 1; 389a405 > list_del(&page->lru); /* page_lru is NULL... */ 391a408,410 > UnlockPage(page); > page_cache_release(page); > ret = 1;