From: Bo Liu <bo-liu@hotmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, hugh.dickins@tiscali.co.uk
Subject: [RFC]get_swap_page():delay update swap_list.next
Date: Mon, 19 Oct 2009 14:38:43 +0800 [thread overview]
Message-ID: <COL115-W2FC39E504A4388BDEC8E99FC10@phx.gbl> (raw)
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>
next reply other threads:[~2009-10-19 6:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-19 6:38 Bo Liu [this message]
2009-10-19 16:16 hugh.dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=COL115-W2FC39E504A4388BDEC8E99FC10@phx.gbl \
--to=bo-liu@hotmail.com \
--cc=akpm@linux-foundation.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox