linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC]get_swap_page():delay update swap_list.next
@ 2009-10-19  6:38 Bo Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Bo Liu @ 2009-10-19  6:38 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, hugh.dickins


If scan_swap_map() successed in current si, there is no
need to update swap_list.next.So get_swap_page next time 
called can start search from the last swap_info(which still
have free slots).
 
 
Signed-off-by: Bo Liu <bo-liu@hotmail.com>
---
 
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63ce10f..b3ba2c5 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -480,13 +480,13 @@ swp_entry_t get_swap_page(void)
   if (!(si->flags & SWP_WRITEOK))
    continue;
 
-  swap_list.next = next;
   /* This is called for allocating swap entry for cache */
   offset = scan_swap_map(si, SWAP_CACHE);
   if (offset) {
    spin_unlock(&swap_lock);
    return swp_entry(type, offset);
   }
+  swap_list.next = next;
   next = swap_list.next;
  }
  		 	   		  
_________________________________________________________________
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC]get_swap_page():delay update swap_list.next
@ 2009-10-19 16:16 hugh.dickins
  0 siblings, 0 replies; 2+ messages in thread
From: hugh.dickins @ 2009-10-19 16:16 UTC (permalink / raw)
  To: Bo Liu; +Cc: akpm, linux-mm

On Mon, 19 Oct 2009 you wrote:

> If scan_swap_map() successed in current si, there is no
> need to update swap_list.next.So get_swap_page next time
> called can start search from the last swap_info(which still
> have free slots).

No, I think you'll find that's mistaken.  It is intended behaviour that
allocating from two swap areas of the same priority will alternate
between them page by page (or cycle around three or more of
the same priority) - a kind of poor man's striping.

You may think that's silly, and not want that behaviour: in which
case assign different priorities to those swap areas, and it will
then behave like you were changing the same priority case to
behave.  So there is no reason to make your change.

Hugh

[I apologize for breaking the threading on your mail: I've been
caught by surprise to find myself unable to reply in the usual way.]




Get 50% off Norton Security- http://www.tiscali.co.uk/securepc

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-19 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 16:16 [RFC]get_swap_page():delay update swap_list.next hugh.dickins
  -- strict thread matches above, loose matches on Subject: below --
2009-10-19  6:38 Bo Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).