Skip to contentSkip to conversation

mm: frontswap/cleancache: final flush->invalidate

PATCH In review Dan Magenheimer 3 participants 4 messages Sep 15, 2011 – Sep 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v10 6/6 mm: frontswap/cleancache: final flush->invalidate

From: Dan Magenheimer <[email protected]>
Subject: [PATCH V10 6/6] mm: frontswap/cleancache: final flush->invalidate

This sixth patch of six in this frontswap series completes the renaming from "flush" to "invalidate" across both tmem frontends (cleancache and frontswap) and both tmem backends (Xen and zcache), as required by akpm. This change is completely cosmetic.

[v10: no change]
[v9: [email protected]: change "flush" to "invalidate", part 3]

Cc Kamezawa Hiroyuki <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Seth Jennings <[email protected]>
Cc Jeremy Fitzhardinge <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Chris Mason <[email protected]>
Cc Rik Riel <[email protected]>
Cc Andrew Morton <[email protected]>

---

Diffstat:

 drivers/staging/zcache/zcache-main.c     |   10 +++++-----
 drivers/xen/tmem.c                       |   10 +++++-----
 include/linux/cleancache.h               |   11 +++--------
 include/linux/frontswap.h                |    9 ++-------
 mm/cleancache.c                          |    7 ++++---
 mm/frontswap.c                           |    4 ++--
 6 files changed, 21 insertions(+), 30 deletions(-)
drivers/staging/zcache/zcache-main.c +5 -5
diff -Napur -x .git frontswap-v10-no_flush_change/drivers/staging/zcache/zcache-main.c frontswap-v10-with_flush_change/drivers/staging/zcache/zcache-main.c
@@ -1775,9 +1775,9 @@ static int zcache_cleancache_init_shared
 static struct cleancache_ops zcache_cleancache_ops = {
 	.put_page = zcache_cleancache_put_page,
 	.get_page = zcache_cleancache_get_page,
-	.flush_page = zcache_cleancache_flush_page,
-	.flush_inode = zcache_cleancache_flush_inode,
-	.flush_fs = zcache_cleancache_flush_fs,
+	.invalidate_page = zcache_cleancache_flush_page,
+	.invalidate_inode = zcache_cleancache_flush_inode,
+	.invalidate_fs = zcache_cleancache_flush_fs,
 	.init_shared_fs = zcache_cleancache_init_shared_fs,
 	.init_fs = zcache_cleancache_init_fs
 };
@@ -1883,8 +1883,8 @@ static void zcache_frontswap_init(unsign
 static struct frontswap_ops zcache_frontswap_ops = {
 	.put_page = zcache_frontswap_put_page,
 	.get_page = zcache_frontswap_get_page,
-	.flush_page = zcache_frontswap_flush_page,
-	.flush_area = zcache_frontswap_flush_area,
+	.invalidate_page = zcache_frontswap_flush_page,
+	.invalidate_area = zcache_frontswap_flush_area,
 	.init = zcache_frontswap_init
 };
 
drivers/xen/tmem.c +5 -5
diff -Napur -x .git frontswap-v10-no_flush_change/drivers/xen/tmem.c frontswap-v10-with_flush_change/drivers/xen/tmem.c
@@ -242,9 +242,9 @@ __setup("nocleancache", no_cleancache);
 static struct cleancache_ops tmem_cleancache_ops = {
 	.put_page = tmem_cleancache_put_page,
 	.get_page = tmem_cleancache_get_page,
-	.flush_page = tmem_cleancache_flush_page,
-	.flush_inode = tmem_cleancache_flush_inode,
-	.flush_fs = tmem_cleancache_flush_fs,
+	.invalidate_page = tmem_cleancache_flush_page,
+	.invalidate_inode = tmem_cleancache_flush_inode,
+	.invalidate_fs = tmem_cleancache_flush_fs,
 	.init_shared_fs = tmem_cleancache_init_shared_fs,
 	.init_fs = tmem_cleancache_init_fs
 };
@@ -369,8 +369,8 @@ __setup("nofrontswap", no_frontswap);
 static struct frontswap_ops tmem_frontswap_ops = {
 	.put_page = tmem_frontswap_put_page,
 	.get_page = tmem_frontswap_get_page,
-	.flush_page = tmem_frontswap_flush_page,
-	.flush_area = tmem_frontswap_flush_area,
+	.invalidate_page = tmem_frontswap_flush_page,
+	.invalidate_area = tmem_frontswap_flush_area,
 	.init = tmem_frontswap_init
 };
 #endif
include/linux/cleancache.h +3 -8
diff -Napur -x .git frontswap-v10-no_flush_change/include/linux/cleancache.h frontswap-v10-with_flush_change/include/linux/cleancache.h
@@ -28,14 +28,9 @@ struct cleancache_ops {
 			pgoff_t, struct page *);
 	void (*put_page)(int, struct cleancache_filekey,
 			pgoff_t, struct page *);
-	/*
-	 * NOTE: per akpm, flush_page, flush_inode and flush_fs will be
-	 * renamed to invalidate_* in a later commit in which all
-	 * dependencies (i.e Xen, zcache) will be renamed simultaneously
-	 */
-	void (*flush_page)(int, struct cleancache_filekey, pgoff_t);
-	void (*flush_inode)(int, struct cleancache_filekey);
-	void (*flush_fs)(int);
+	void (*invalidate_page)(int, struct cleancache_filekey, pgoff_t);
+	void (*invalidate_inode)(int, struct cleancache_filekey);
+	void (*invalidate_fs)(int);
 };
 
 extern struct cleancache_ops
include/linux/frontswap.h +2 -7
diff -Napur -x .git frontswap-v10-no_flush_change/include/linux/frontswap.h frontswap-v10-with_flush_change/include/linux/frontswap.h
@@ -9,13 +9,8 @@ struct frontswap_ops {
 	void (*init)(unsigned);
 	int (*put_page)(unsigned, pgoff_t, struct page *);
 	int (*get_page)(unsigned, pgoff_t, struct page *);
-	/*
-	 * NOTE: per akpm, flush_page and flush_area will be renamed to
-	 * invalidate_page and invalidate_area in a later commit in which
-	 * all dependencies (i.e. Xen, zcache) will be renamed simultaneously
-	 */
-	void (*flush_page)(unsigned, pgoff_t);
-	void (*flush_area)(unsigned);
+	void (*invalidate_page)(unsigned, pgoff_t);
+	void (*invalidate_area)(unsigned);
 };
 
 extern int frontswap_enabled;
mm/cleancache.c +4 -3
diff -Napur -x .git frontswap-v10-no_flush_change/mm/cleancache.c frontswap-v10-with_flush_change/mm/cleancache.c
@@ -166,7 +166,8 @@ void __cleancache_invalidate_page(struct
 	if (pool_id >= 0) {
 		VM_BUG_ON(!PageLocked(page));
 		if (cleancache_get_key(mapping->host, &key) >= 0) {
-			(*cleancache_ops.flush_page)(pool_id, key, page->index);
+			(*cleancache_ops.invalidate_page)(pool_id,
+							  key, page->index);
 			cleancache_invalidates++;
 		}
 	}
@@ -184,7 +185,7 @@ void __cleancache_invalidate_inode(struc
 	struct cleancache_filekey key = { .u.key = { 0 } };
 
 	if (pool_id >= 0 && cleancache_get_key(mapping->host, &key) >= 0)
-		(*cleancache_ops.flush_inode)(pool_id, key);
+		(*cleancache_ops.invalidate_inode)(pool_id, key);
 }
 EXPORT_SYMBOL(__cleancache_invalidate_inode);
 
@@ -198,7 +199,7 @@ void __cleancache_invalidate_fs(struct s
 	if (sb->cleancache_poolid >= 0) {
 		int old_poolid = sb->cleancache_poolid;
 		sb->cleancache_poolid = -1;
-		(*cleancache_ops.flush_fs)(old_poolid);
+		(*cleancache_ops.invalidate_fs)(old_poolid);
 	}
 }
 EXPORT_SYMBOL(__cleancache_invalidate_fs);
mm/frontswap.c +2 -2
diff -Napur -x .git frontswap-v10-no_flush_change/mm/frontswap.c frontswap-v10-with_flush_change/mm/frontswap.c
@@ -147,7 +147,7 @@ void __frontswap_invalidate_page(unsigne
 
 	BUG_ON(sis == NULL);
 	if (frontswap_test(sis, offset)) {
-		(*frontswap_ops.flush_page)(type, offset);
+		(*frontswap_ops.invalidate_page)(type, offset);
 		atomic_dec(&sis->frontswap_pages);
 		frontswap_clear(sis, offset);
 		frontswap_invalidates++;
@@ -166,7 +166,7 @@ void __frontswap_invalidate_area(unsigne
 	BUG_ON(sis == NULL);
 	if (sis->frontswap_map == NULL)
 		return;
-	(*frontswap_ops.flush_area)(type);
+	(*frontswap_ops.invalidate_area)(type);
 	atomic_set(&sis->frontswap_pages, 0);
 	memset(sis->frontswap_map, 0, sis->max / sizeof(long));
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 2 lines · Dan Magenheimer

From: Dan Magenheimer <[email protected]>
Subject: [PATCH V10 6/6] mm: frontswap/cleancache: final flush->invalidate

Just call it 's/flush/invalidate/' change.

Quoted 7 lines

This sixth patch of six in this frontswap series completes the renaming from "flush" to "invalidate" across both tmem frontends (cleancache and frontswap) and both tmem backends (Xen and zcache), as required by akpm. This change is completely cosmetic.

[v10: no change]

No need for that.. You only need to include them if you did provide some new content to the patch.

Quoted 165 lines

[v9: [email protected]: change "flush" to "invalidate", part 3]

Cc Kamezawa Hiroyuki <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Seth Jennings <[email protected]>
Cc Jeremy Fitzhardinge <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Chris Mason <[email protected]>
Cc Rik Riel <[email protected]>
Cc Andrew Morton <[email protected]>

---

Diffstat:

 drivers/staging/zcache/zcache-main.c     |   10 +++++-----
 drivers/xen/tmem.c                       |   10 +++++-----
 include/linux/cleancache.h               |   11 +++--------
 include/linux/frontswap.h                |    9 ++-------
 mm/cleancache.c                          |    7 ++++---
 mm/frontswap.c                           |    4 ++--
 6 files changed, 21 insertions(+), 30 deletions(-)

diff -Napur -x .git frontswap-v10-no_flush_change/drivers/staging/zcache/zcache-main.c frontswap-v10-with_flush_change/drivers/staging/zcache/zcache-main.c

drivers/staging/zcache/zcache-main.c +5 -5
@@ -1775,9 +1775,9 @@ static int zcache_cleancache_init_shared
 static struct cleancache_ops zcache_cleancache_ops = {
 	.put_page = zcache_cleancache_put_page,
 	.get_page = zcache_cleancache_get_page,
-	.flush_page = zcache_cleancache_flush_page,
-	.flush_inode = zcache_cleancache_flush_inode,
-	.flush_fs = zcache_cleancache_flush_fs,
+	.invalidate_page = zcache_cleancache_flush_page,
+	.invalidate_inode = zcache_cleancache_flush_inode,
+	.invalidate_fs = zcache_cleancache_flush_fs,
 	.init_shared_fs = zcache_cleancache_init_shared_fs,
 	.init_fs = zcache_cleancache_init_fs
 };
@@ -1883,8 +1883,8 @@ static void zcache_frontswap_init(unsign
 static struct frontswap_ops zcache_frontswap_ops = {
 	.put_page = zcache_frontswap_put_page,
 	.get_page = zcache_frontswap_get_page,
-	.flush_page = zcache_frontswap_flush_page,
-	.flush_area = zcache_frontswap_flush_area,
+	.invalidate_page = zcache_frontswap_flush_page,
+	.invalidate_area = zcache_frontswap_flush_area,
 	.init = zcache_frontswap_init
 };
 

diff -Napur -x .git frontswap-v10-no_flush_change/drivers/xen/tmem.c frontswap-v10-with_flush_change/drivers/xen/tmem.c

drivers/xen/tmem.c +5 -5
@@ -242,9 +242,9 @@ __setup("nocleancache", no_cleancache);
 static struct cleancache_ops tmem_cleancache_ops = {
 	.put_page = tmem_cleancache_put_page,
 	.get_page = tmem_cleancache_get_page,
-	.flush_page = tmem_cleancache_flush_page,
-	.flush_inode = tmem_cleancache_flush_inode,
-	.flush_fs = tmem_cleancache_flush_fs,
+	.invalidate_page = tmem_cleancache_flush_page,
+	.invalidate_inode = tmem_cleancache_flush_inode,
+	.invalidate_fs = tmem_cleancache_flush_fs,
 	.init_shared_fs = tmem_cleancache_init_shared_fs,
 	.init_fs = tmem_cleancache_init_fs
 };
@@ -369,8 +369,8 @@ __setup("nofrontswap", no_frontswap);
 static struct frontswap_ops tmem_frontswap_ops = {
 	.put_page = tmem_frontswap_put_page,
 	.get_page = tmem_frontswap_get_page,
-	.flush_page = tmem_frontswap_flush_page,
-	.flush_area = tmem_frontswap_flush_area,
+	.invalidate_page = tmem_frontswap_flush_page,
+	.invalidate_area = tmem_frontswap_flush_area,
 	.init = tmem_frontswap_init
 };
 #endif

diff -Napur -x .git frontswap-v10-no_flush_change/include/linux/cleancache.h frontswap-v10-with_flush_change/include/linux/cleancache.h

include/linux/cleancache.h +3 -8
@@ -28,14 +28,9 @@ struct cleancache_ops {
 			pgoff_t, struct page *);
 	void (*put_page)(int, struct cleancache_filekey,
 			pgoff_t, struct page *);
-	/*
-	 * NOTE: per akpm, flush_page, flush_inode and flush_fs will be
-	 * renamed to invalidate_* in a later commit in which all
-	 * dependencies (i.e Xen, zcache) will be renamed simultaneously
-	 */
-	void (*flush_page)(int, struct cleancache_filekey, pgoff_t);
-	void (*flush_inode)(int, struct cleancache_filekey);
-	void (*flush_fs)(int);
+	void (*invalidate_page)(int, struct cleancache_filekey, pgoff_t);
+	void (*invalidate_inode)(int, struct cleancache_filekey);
+	void (*invalidate_fs)(int);
 };
 
 extern struct cleancache_ops

diff -Napur -x .git frontswap-v10-no_flush_change/include/linux/frontswap.h frontswap-v10-with_flush_change/include/linux/frontswap.h

include/linux/frontswap.h +2 -7
@@ -9,13 +9,8 @@ struct frontswap_ops {
 	void (*init)(unsigned);
 	int (*put_page)(unsigned, pgoff_t, struct page *);
 	int (*get_page)(unsigned, pgoff_t, struct page *);
-	/*
-	 * NOTE: per akpm, flush_page and flush_area will be renamed to
-	 * invalidate_page and invalidate_area in a later commit in which
-	 * all dependencies (i.e. Xen, zcache) will be renamed simultaneously
-	 */
-	void (*flush_page)(unsigned, pgoff_t);
-	void (*flush_area)(unsigned);
+	void (*invalidate_page)(unsigned, pgoff_t);
+	void (*invalidate_area)(unsigned);
 };
 
 extern int frontswap_enabled;

diff -Napur -x .git frontswap-v10-no_flush_change/mm/cleancache.c frontswap-v10-with_flush_change/mm/cleancache.c

mm/cleancache.c +4 -3
@@ -166,7 +166,8 @@ void __cleancache_invalidate_page(struct
 	if (pool_id >= 0) {
 		VM_BUG_ON(!PageLocked(page));
 		if (cleancache_get_key(mapping->host, &key) >= 0) {
-			(*cleancache_ops.flush_page)(pool_id, key, page->index);
+			(*cleancache_ops.invalidate_page)(pool_id,
+							  key, page->index);
 			cleancache_invalidates++;
 		}
 	}
@@ -184,7 +185,7 @@ void __cleancache_invalidate_inode(struc
 	struct cleancache_filekey key = { .u.key = { 0 } };
 
 	if (pool_id >= 0 && cleancache_get_key(mapping->host, &key) >= 0)
-		(*cleancache_ops.flush_inode)(pool_id, key);
+		(*cleancache_ops.invalidate_inode)(pool_id, key);
 }
 EXPORT_SYMBOL(__cleancache_invalidate_inode);
 
@@ -198,7 +199,7 @@ void __cleancache_invalidate_fs(struct s
 	if (sb->cleancache_poolid >= 0) {
 		int old_poolid = sb->cleancache_poolid;
 		sb->cleancache_poolid = -1;
-		(*cleancache_ops.flush_fs)(old_poolid);
+		(*cleancache_ops.invalidate_fs)(old_poolid);
 	}
 }
 EXPORT_SYMBOL(__cleancache_invalidate_fs);

diff -Napur -x .git frontswap-v10-no_flush_change/mm/frontswap.c frontswap-v10-with_flush_change/mm/frontswap.c

mm/frontswap.c +1 -1
@@ -147,7 +147,7 @@ void __frontswap_invalidate_page(unsigne
 
 	BUG_ON(sis == NULL);
 	if (frontswap_test(sis, offset)) {
-		(*frontswap_ops.flush_page)(type, offset);
+		(*frontswap_ops.invalidate_page)(type, offset);
 		atomic_dec(&sis->frontswap_pages);
 		frontswap_clear(sis, offset);
 		frontswap_invalidates++;

mm/frontswap.c void __frontswap_invalidate_area(unsigne · line 172

Quoted 8 lines
mm/frontswap.c +1 -1
@@ -166,7 +166,7 @@ void __frontswap_invalidate_area(unsigne
 	BUG_ON(sis == NULL);
 	if (sis->frontswap_map == NULL)
 		return;
-	(*frontswap_ops.flush_area)(type);
+	(*frontswap_ops.invalidate_area)(type);
 	atomic_set(&sis->frontswap_pages, 0);
 	memset(sis->frontswap_map, 0, sis->max / sizeof(long));
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 21 lines

From: Konrad Rzeszutek Wilk
Sent: Wednesday, September 21, 2011 9:04 AM
To: Dan Magenheimer
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Konrad Wilk; [email protected]; Kurt Hackel; [email protected]; akpm@linux- foundation.org; [email protected]; [email protected]; [email protected]; Chris Mason; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH V10 6/6] mm: frontswap/cleancache: final flush->invalidate

Quoted 2 lines · Dan Magenheimer

From: Dan Magenheimer <[email protected]>
Subject: [PATCH V10 6/6] mm: frontswap/cleancache: final flush->invalidate

Just call it 's/flush/invalidate/' change.

Quoted 6 lines

This sixth patch of six in this frontswap series completes the renaming from "flush" to "invalidate" across both tmem frontends (cleancache and frontswap) and both tmem backends (Xen and zcache), as required by akpm. This change is completely cosmetic.

Quoted 4 lines
Quoted 1 line

[v10: no change]

No need for that.. You only need to include them if you did provide some new content to the patch.

OK, thanks. Fixed in v11. Since no code changes, not reposting, available in git tree at:

git://oss.oracle.com/git/djm/tmem.git#frontswap-v11

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Reviewed-by on v10 6/6
#3 lore raw
In reply to Dan Magenheimer
Quoted 8 lines · On Thu, 15 Sep 2011 14:35:06 -0700 Dan Magenheimer…

From: Dan Magenheimer <[email protected]>
Subject: [PATCH V10 6/6] mm: frontswap/cleancache: final flush->invalidate

This sixth patch of six in this frontswap series completes the renaming from "flush" to "invalidate" across both tmem frontends (cleancache and frontswap) and both tmem backends (Xen and zcache), as required by akpm. This change is completely cosmetic.

Quoted 5 lines

[v10: no change]
[v9: [email protected]: change "flush" to "invalidate", part 3]