From: Ray Bryant <raybry@sgi.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>, linux-mm <linux-mm@kvack.org>
Subject: Re: migration cache, updated
Date: Fri, 07 Jan 2005 10:57:52 -0600 [thread overview]
Message-ID: <41DEBF90.4030400@sgi.com> (raw)
In-Reply-To: <41DADFB9.2090607@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]
Marcello,
Attached is a patch which fixes some compiler warnings in mmigrate.c
that I was getting with the migration cache code. The only substantive
change was to change:
/* Wait for all operations against the page to finish. */
ret = migrate_fn(page, newpage, &vlist);
switch (ret) {
default:
/* The page is busy. Try it later. */
goto out_busy;
case -ENOENT:
/* The file the page belongs to has been truncated. */
page_cache_get(page);
page_cache_release(newpage);
newpage->mapping = NULL;
/* fall thru */
case 0:
/* fall thru */
}
in generic_migrate_page(), to:
/* Wait for all operations against the page to finish. */
ret = migrate_fn(page, newpage, &vlist);
switch (ret) {
case -ENOENT:
/* The file the page belongs to has been truncated. */
page_cache_get(page);
page_cache_release(newpage);
newpage->mapping = NULL;
/* fall thru */
case 0:
break;
default:
/* The page is busy. Try it later. */
goto out_busy;
}
This change was made to get rid of the warning:
mm/mmigrate.c:500: warning: deprecated use of label at end of compound statement
I suppose you used the previous order to eliminate an extra branch or
some such. Do you have any other suggestion on how to eliminate that
warning?
--
Best Regards,
Ray
-----------------------------------------------
Ray Bryant
512-453-9679 (work) 512-507-7807 (cell)
raybry@sgi.com raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
so I installed Linux.
-----------------------------------------------
[-- Attachment #2: fix-migration-cache-warnings.patch --]
[-- Type: text/plain, Size: 3087 bytes --]
Index: linux-2.6.10-rc2-mm4-page-migration-only/include/linux/swap.h
===================================================================
--- linux-2.6.10-rc2-mm4-page-migration-only.orig/include/linux/swap.h 2005-01-04 07:55:22.000000000 -0800
+++ linux-2.6.10-rc2-mm4-page-migration-only/include/linux/swap.h 2005-01-04 08:13:16.000000000 -0800
@@ -258,7 +258,7 @@ static inline int remove_exclusive_swap_
{
return __remove_exclusive_swap_page(p, 0);
}
-extern int migration_remove_entry(swp_entry_t);
+extern void migration_remove_entry(swp_entry_t);
struct backing_dev_info;
extern struct swap_list_t swap_list;
Index: linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c
===================================================================
--- linux-2.6.10-rc2-mm4-page-migration-only.orig/mm/mmigrate.c 2005-01-04 07:55:22.000000000 -0800
+++ linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c 2005-01-04 08:11:51.000000000 -0800
@@ -79,7 +79,6 @@ struct page *lookup_migration_cache(int
void migration_duplicate(swp_entry_t entry)
{
- int offset;
struct counter *cnt;
read_lock_irq(&migration_space.tree_lock);
@@ -96,32 +95,11 @@ void remove_from_migration_cache(struct
idr_remove(&migration_idr, id);
radix_tree_delete(&migration_space.page_tree, id);
ClearPageSwapCache(page);
- page->private = NULL;
+ page->private = 0;
write_unlock_irq(&migration_space.tree_lock);
}
-// FIXME: if the page is locked will it be correctly removed from migr cache?
-// check races
-
-int migration_remove_entry(swp_entry_t entry)
-{
- struct page *page;
-
- page = find_get_page(&migration_space, entry.val);
-
- if (!page)
- BUG();
-
- lock_page(page);
-
- migration_remove_reference(page, 1);
-
- unlock_page(page);
-
- page_cache_release(page);
-}
-
-int migration_remove_reference(struct page *page, int dec)
+void migration_remove_reference(struct page *page, int dec)
{
struct counter *c;
swp_entry_t entry;
@@ -145,6 +123,28 @@ int migration_remove_reference(struct pa
}
}
+
+// FIXME: if the page is locked will it be correctly removed from migr cache?
+// check races
+
+void migration_remove_entry(swp_entry_t entry)
+{
+ struct page *page;
+
+ page = find_get_page(&migration_space, entry.val);
+
+ if (!page)
+ BUG();
+
+ lock_page(page);
+
+ migration_remove_reference(page, 1);
+
+ unlock_page(page);
+
+ page_cache_release(page);
+}
+
int detach_from_migration_cache(struct page *page)
{
lock_page(page);
@@ -486,9 +486,6 @@ generic_migrate_page(struct page *page,
/* Wait for all operations against the page to finish. */
ret = migrate_fn(page, newpage, &vlist);
switch (ret) {
- default:
- /* The page is busy. Try it later. */
- goto out_busy;
case -ENOENT:
/* The file the page belongs to has been truncated. */
page_cache_get(page);
@@ -496,7 +493,10 @@ generic_migrate_page(struct page *page,
newpage->mapping = NULL;
/* fall thru */
case 0:
- /* fall thru */
+ break;
+ default:
+ /* The page is busy. Try it later. */
+ goto out_busy;
}
arch_migrate_page(page, newpage);
next prev parent reply other threads:[~2005-01-07 16:57 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 17:48 page migration Ray Bryant
2005-01-03 18:25 ` Dave Hansen
2005-01-03 19:04 ` Ray Bryant
2005-01-03 16:24 ` page migration\ Marcelo Tosatti
2005-01-03 17:13 ` Marcelo Tosatti
2005-01-03 20:33 ` Ray Bryant
2005-01-03 18:38 ` Marcelo Tosatti
2005-01-04 15:42 ` Hirokazu Takahashi
2005-01-04 17:34 ` Ray Bryant
2005-01-04 16:11 ` Marcelo Tosatti
2005-01-05 0:08 ` page migration Ray Bryant
2005-01-03 20:30 ` Ray Bryant
2005-01-03 19:37 ` Dave Hansen
2005-01-03 20:15 ` Ray Bryant
2005-01-03 20:17 ` William Lee Irwin III
2005-01-03 20:36 ` Ray Bryant
2005-01-04 14:42 ` Hirokazu Takahashi
2005-01-04 17:30 ` Ray Bryant
2005-01-04 17:40 ` process " Dave Hansen
2005-01-04 18:26 ` Ray Bryant
2005-01-07 16:40 ` page migration patch Ray Bryant
2005-01-10 2:58 ` Dave Hansen
2005-01-07 16:57 ` Ray Bryant [this message]
2005-01-10 10:07 ` migration cache, updated Marcelo Tosatti
2005-01-04 22:03 ` page migration Yasunori Goto
2005-01-04 23:58 ` Ray Bryant
-- strict thread matches above, loose matches on Subject: below --
2005-02-06 2:02 migration cache, updated Marcelo Tosatti
2005-01-03 19:25 Ray Bryant
2004-10-25 21:39 Marcelo Tosatti
2004-10-26 1:17 ` Hiroyuki KAMEZAWA
2004-10-26 12:01 ` Marcelo Tosatti
2004-10-26 23:47 ` Hiroyuki KAMEZAWA
2004-10-26 6:37 ` Hirokazu Takahashi
2004-10-26 9:20 ` Marcelo Tosatti
2004-10-26 13:45 ` Hirokazu Takahashi
2004-10-26 11:41 ` Marcelo Tosatti
2004-10-27 13:40 ` Hirokazu Takahashi
2004-10-26 9:15 ` Hirokazu Takahashi
2004-10-26 9:25 ` Marcelo Tosatti
2004-10-26 14:01 ` Hirokazu Takahashi
2004-10-26 12:24 ` Marcelo Tosatti
2004-10-27 7:25 ` IWAMOTO Toshihiro
2004-10-27 16:27 ` Marcelo Tosatti
2004-10-27 13:48 ` Hirokazu Takahashi
2004-10-28 15:19 ` Marcelo Tosatti
2004-10-28 16:05 ` Marcelo Tosatti
2004-10-28 18:51 ` Dave Hansen
2004-10-28 16:26 ` Marcelo Tosatti
2004-10-28 20:24 ` Dave Hansen
2004-11-03 15:21 ` Marcelo Tosatti
2004-11-04 8:01 ` Hirokazu Takahashi
2004-11-05 13:49 ` Hirokazu Takahashi
2004-11-05 15:16 ` Marcelo Tosatti
2004-11-16 4:07 ` Hirokazu Takahashi
2004-11-23 12:14 ` Marcelo Tosatti
2004-11-24 10:21 ` Hirokazu Takahashi
2004-12-01 20:21 ` Marcelo Tosatti
2004-12-08 13:23 ` Hirokazu Takahashi
2005-01-17 9:59 ` Marcelo Tosatti
2005-01-31 18:33 ` Ray Bryant
2005-01-31 18:44 ` Marcelo Tosatti
2005-02-02 21:28 ` Ray Bryant
2005-02-03 2:59 ` Hirokazu Takahashi
2005-02-03 15:19 ` Ray Bryant
2005-02-04 7:32 ` Hirokazu Takahashi
2005-02-04 16:08 ` Ray Bryant
2005-02-07 12:46 ` Hirokazu Takahashi
2005-02-07 20:54 ` Ray Bryant
2005-02-08 2:17 ` Hirokazu Takahashi
[not found] ` <42083913.9050306@sgi.com>
[not found] ` <20050209.151938.63052333.taka@valinux.co.jp>
2005-02-09 20:48 ` Ray Bryant
2005-02-07 13:16 ` Hirokazu Takahashi
2005-02-03 2:49 ` Hirokazu Takahashi
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=41DEBF90.4030400@sgi.com \
--to=raybry@sgi.com \
--cc=linux-mm@kvack.org \
--cc=marcelo.tosatti@cyclades.com \
--cc=taka@valinux.co.jp \
/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