[lc-checkins] CVS: linux/mm/comp_cache swapout.c,1.56,1.57
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2002-07-09 13:15:28
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory usw-pr-cvs1:/tmp/cvs-serv8282/mm/comp_cache Modified Files: swapout.c Log Message: Other o Change the number of reserved pages for swap buffer from 128 to 32. That improves performance since a huge number of swap buffer pages is unneeded and we end up freeing some memory that can be used more efficiently. o Removed the gfp_mask_buffer idea in refill_swp_buffer(). That variable was introduced because we wanted to first free the swap buffers that had its IO completely finished. Only in the case that doesn't happen that we used to try to free the buffers which needed to be synced. Unfortunally that turned out to be a bad idea since it could change the LRU order when freeing the fragments. Index: swapout.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -r1.56 -r1.57 *** swapout.c 1 Jul 2002 21:36:50 -0000 1.56 --- swapout.c 9 Jul 2002 13:15:24 -0000 1.57 *************** *** 2,6 **** * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-07-01 18:13:35 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-07-09 10:03:02 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 30,37 **** struct swp_buffer * swp_buffer; struct comp_cache_fragment * fragment; - unsigned int gfp_mask_buffer; int wait, maxscan; - gfp_mask_buffer = gfp_mask & ~__GFP_IO; maxscan = max(NUM_SWP_BUFFERS/priority, (int) (nrpages * 1.5)); wait = 0; --- 30,35 ---- *************** *** 60,64 **** if (buffer_page->buffers) { list_del_init(swp_buffer_lh); ! if (!try_to_free_buffers(buffer_page, gfp_mask_buffer)) { list_add(swp_buffer_lh, &swp_used_buffer_head); --- 58,62 ---- if (buffer_page->buffers) { list_del_init(swp_buffer_lh); ! if (!try_to_free_buffers(buffer_page, gfp_mask)) { list_add(swp_buffer_lh, &swp_used_buffer_head); *************** *** 103,112 **** } ! /* couldn't free any swap buffer? so let's perform IO, if ! * gfp_mask allows, to free the page buffers */ if (!wait && nrpages > 0) { wait = 1; maxscan = max(NUM_SWP_BUFFERS >> 4, (int) (nrpages * 4)); - gfp_mask_buffer = gfp_mask; if (unlikely(current->need_resched)) { __set_current_state(TASK_RUNNING); --- 101,109 ---- } ! /* couldn't free any swap buffer? so let's start waiting for ! * the lock from the locked pages */ if (!wait && nrpages > 0) { wait = 1; maxscan = max(NUM_SWP_BUFFERS >> 4, (int) (nrpages * 4)); if (unlikely(current->need_resched)) { __set_current_state(TASK_RUNNING); |