Skip to contentSkip to conversation

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

PATCH In review Nikanth Karthikesan 3 participants 6 messages Jun 10, 2011 – Jun 14, 2011 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

Fix compilation warning

drivers/xen/tmem.c: In function ‘xen_tmem_init’:
drivers/xen/tmem.c:246: warning: unused variable ‘old_ops’ drivers/xen/tmem.c: At top level:
drivers/xen/tmem.c:234: warning: ‘tmem_cleancache_ops’ defined but not used

---

drivers/xen/Makefile +1 -1
Index: linux-2.6/drivers/xen/Makefile
===================================================================
@@ -1,6 +1,6 @@
 obj-y	+= grant-table.o features.o events.o manage.o balloon.o
 obj-y	+= xenbus/
-obj-y	+= tmem.o
+obj-$(CONFIG_CLEAN_CACHE)	+= tmem.o
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)
drivers/xen/tmem.c +0 -2
Index: linux-2.6/drivers/xen/tmem.c
===================================================================
@@ -247,7 +247,6 @@
 
 	if (!xen_domain())
 		return 0;
-#ifdef CONFIG_CLEANCACHE
 	BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
 	if (tmem_enabled && use_cleancache) {
 		char *s = "";
@@ -257,7 +256,6 @@
 		printk(KERN_INFO "cleancache enabled, RAM provided by "
 				 "Xen Transcendent Memory%s\n", s);
 	}
-#endif
 	return 0;
 }
 
#1 lore raw
Quoted 1 line

+obj-$(CONFIG_CLEAN_CACHE) += tmem.o

Hi Nikanth --

Thanks for the suggested patch. However, tmem.c works with both cleancache and frontswap... the shim in place only works with cleancache but there is a posted patch for it to work with frontswap as well. So your patch would just need to be redone when frontswap is included soon.

BUT... is there a way to do an inclusive-or operation in a Makefile?... something like this (though I know this exact syntax won't work)...

obj-($CONFIG_CLEANCACHE||$CONFIG_FRONTSWAP)

Thanks,
Dan

Thanks... for the memory!
I really could use more / my throughput's on the floor The balloon is flat / my swap disk's fat / I've OOM's in store Overcommitted so much
(with apologies to Bob Hope)

Quoted 60 lines

-----Original Message-----
From: Nikanth Karthikesan [mailto:[email protected]]
Sent: Friday, June 10, 2011 2:57 AM
To: [email protected]
Cc: Jeremy Fitzhardinge; Konrad Rzeszutek Wilk
Subject: [Xen-devel] [PATCH] xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

Fix compilation warning

drivers/xen/tmem.c: In function ‘xen_tmem_init’:
drivers/xen/tmem.c:246: warning: unused variable ‘old_ops’ drivers/xen/tmem.c: At top level:
drivers/xen/tmem.c:234: warning: ‘tmem_cleancache_ops’ defined but not used

---

Index: linux-2.6/drivers/xen/Makefile
===================================================================

drivers/xen/Makefile +1 -1
@@ -1,6 +1,6 @@
 obj-y	+= grant-table.o features.o events.o manage.o balloon.o
 obj-y	+= xenbus/
-obj-y	+= tmem.o
+obj-$(CONFIG_CLEAN_CACHE)	+= tmem.o
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)

Index: linux-2.6/drivers/xen/tmem.c
===================================================================

drivers/xen/tmem.c +0 -2
@@ -247,7 +247,6 @@
 
 	if (!xen_domain())
 		return 0;
-#ifdef CONFIG_CLEANCACHE
 	BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
 	if (tmem_enabled && use_cleancache) {
 		char *s = "";
@@ -257,7 +256,6 @@
 		printk(KERN_INFO "cleancache enabled, RAM provided by "
 				 "Xen Transcendent Memory%s\n", s);
 	}
-#endif
 	return 0;
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 10 lines · Dan Magenheimer
Quoted 1 line

+obj-$(CONFIG_CLEAN_CACHE) += tmem.o

Hi Nikanth --

Thanks for the suggested patch. However, tmem.c works with both cleancache and frontswap... the shim in place only works with cleancache but there is a posted patch for it to work with frontswap as well. So your patch would just need to be redone when frontswap is included soon.

Quoted 6 lines

BUT... is there a way to do an inclusive-or operation in a Makefile?... something like this (though I know this exact syntax won't work)...

obj-($CONFIG_CLEANCACHE||$CONFIG_FRONTSWAP)

I think, we need to introduce a new kconfig option config XEN_TMEM

	bool
	depends on CLEANCACHE || FRONTSWAP

and use

obj-($CONFIG_XEN_TMEM)

Thanks
Nikanth

Quoted 69 lines

Thanks,
Dan

Thanks... for the memory!
I really could use more / my throughput's on the floor The balloon is flat / my swap disk's fat / I've OOM's in store Overcommitted so much
(with apologies to Bob Hope)

Quoted 60 lines

-----Original Message-----
From: Nikanth Karthikesan [mailto:[email protected]]
Sent: Friday, June 10, 2011 2:57 AM
To: [email protected]
Cc: Jeremy Fitzhardinge; Konrad Rzeszutek Wilk
Subject: [Xen-devel] [PATCH] xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

Fix compilation warning

drivers/xen/tmem.c: In function ‘xen_tmem_init’:
drivers/xen/tmem.c:246: warning: unused variable ‘old_ops’ drivers/xen/tmem.c: At top level:
drivers/xen/tmem.c:234: warning: ‘tmem_cleancache_ops’ defined but not used

---

Index: linux-2.6/drivers/xen/Makefile
===================================================================

drivers/xen/Makefile +1 -1
@@ -1,6 +1,6 @@
 obj-y	+= grant-table.o features.o events.o manage.o balloon.o
 obj-y	+= xenbus/
-obj-y	+= tmem.o
+obj-$(CONFIG_CLEAN_CACHE)	+= tmem.o
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)

Index: linux-2.6/drivers/xen/tmem.c
===================================================================

drivers/xen/tmem.c +0 -2
@@ -247,7 +247,6 @@
 
 	if (!xen_domain())
 		return 0;
-#ifdef CONFIG_CLEANCACHE
 	BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
 	if (tmem_enabled && use_cleancache) {
 		char *s = "";
@@ -257,7 +256,6 @@
 		printk(KERN_INFO "cleancache enabled, RAM provided by "
 				 "Xen Transcendent Memory%s\n", s);
 	}
-#endif
 	return 0;
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
In reply to Dan Magenheimer
Quoted 11 lines
Quoted 2 lines
Quoted 1 line · Dan Magenheimer

+obj-$(CONFIG_CLEAN_CACHE) += tmem.o

Hi Nikanth --

Thanks for the suggested patch. However, tmem.c works with both cleancache and frontswap... the shim in place only works with cleancache but there is a posted patch for it to work with frontswap as well. So your patch would just need to be redone when frontswap is included soon.

Quoted 5 lines

BUT... is there a way to do an inclusive-or operation in a Makefile?... something like this (though I know this exact syntax won't work)...

obj-($CONFIG_CLEANCACHE||$CONFIG_FRONTSWAP)

You can specify the same object more than once, i.e.

obj-$(CONFIG_CLEAN_CACHE) += tmem.o
obj-$(CONFIG_FRONTSWAP) += tmem.o

Jan

Quoted 77 lines

Thanks,
Dan

Thanks... for the memory!
I really could use more / my throughput's on the floor The balloon is flat / my swap disk's fat / I've OOM's in store Overcommitted so much
(with apologies to Bob Hope)

Quoted 6 lines

-----Original Message-----
From: Nikanth Karthikesan [mailto:[email protected]]
Sent: Friday, June 10, 2011 2:57 AM
To: [email protected]
Cc: Jeremy Fitzhardinge; Konrad Rzeszutek Wilk
Subject: [Xen-devel] [PATCH] xen-tmem: Build cleancache shim to Xen

Transcendent Memory only if

Quoted 3 lines

Cleancache is enabled

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if

Cleancache is enabled

Quoted 47 lines

Fix compilation warning

drivers/xen/tmem.c: In function ‘xen_tmem_init’:
drivers/xen/tmem.c:246: warning: unused variable ‘old_ops’ drivers/xen/tmem.c: At top level:
drivers/xen/tmem.c:234: warning: ‘tmem_cleancache_ops’ defined but not used

---

Index: linux-2.6/drivers/xen/Makefile
===================================================================

drivers/xen/Makefile +1 -1
@@ -1,6 +1,6 @@
 obj-y	+= grant-table.o features.o events.o manage.o balloon.o
 obj-y	+= xenbus/
-obj-y	+= tmem.o
+obj-$(CONFIG_CLEAN_CACHE)	+= tmem.o
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)

Index: linux-2.6/drivers/xen/tmem.c
===================================================================

drivers/xen/tmem.c +0 -2
@@ -247,7 +247,6 @@
 
 	if (!xen_domain())
 		return 0;
-#ifdef CONFIG_CLEANCACHE
 	BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
 	if (tmem_enabled && use_cleancache) {
 		char *s = "";
@@ -257,7 +256,6 @@
 		printk(KERN_INFO "cleancache enabled, RAM provided by "
 				 "Xen Transcendent Memory%s\n", s);
 	}
-#endif
 	return 0;
 }
 
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw
Quoted 15 lines · Jan Beulich
Quoted 15 lines
Quoted 2 lines
Quoted 1 line · Dan Magenheimer

+obj-$(CONFIG_CLEAN_CACHE) += tmem.o

Hi Nikanth --

Thanks for the suggested patch. However, tmem.c works with both cleancache and frontswap... the shim in place only works with cleancache but there is a posted patch for it to work with frontswap as well. So your patch would just need to be redone when frontswap is included soon.

BUT... is there a way to do an inclusive-or operation in a Makefile?... something like this (though I know this exact syntax won't work)...

Quoted 7 lines
Quoted 1 line

obj-($CONFIG_CLEANCACHE||$CONFIG_FRONTSWAP)

You can specify the same object more than once, i.e.

obj-$(CONFIG_CLEAN_CACHE) += tmem.o
obj-$(CONFIG_FRONTSWAP) += tmem.o

Cool!

So, can this patch be merged then? It would be easy to patch for frontswap, in the frontswap patchset.

Thanks
Nikanth

Quoted 81 lines

Jan

Quoted 77 lines

Thanks,
Dan

Thanks... for the memory!
I really could use more / my throughput's on the floor The balloon is flat / my swap disk's fat / I've OOM's in store Overcommitted so much
(with apologies to Bob Hope)

Quoted 6 lines

-----Original Message-----
From: Nikanth Karthikesan [mailto:[email protected]]
Sent: Friday, June 10, 2011 2:57 AM
To: [email protected]
Cc: Jeremy Fitzhardinge; Konrad Rzeszutek Wilk
Subject: [Xen-devel] [PATCH] xen-tmem: Build cleancache shim to Xen

Transcendent Memory only if

Quoted 3 lines

Cleancache is enabled

xen-tmem: Build cleancache shim to Xen Transcendent Memory only if

Cleancache is enabled

Quoted 47 lines

Fix compilation warning

drivers/xen/tmem.c: In function ‘xen_tmem_init’:
drivers/xen/tmem.c:246: warning: unused variable ‘old_ops’ drivers/xen/tmem.c: At top level:
drivers/xen/tmem.c:234: warning: ‘tmem_cleancache_ops’ defined but not used

---

Index: linux-2.6/drivers/xen/Makefile
===================================================================

drivers/xen/Makefile +1 -1
@@ -1,6 +1,6 @@
 obj-y	+= grant-table.o features.o events.o manage.o balloon.o
 obj-y	+= xenbus/
-obj-y	+= tmem.o
+obj-$(CONFIG_CLEAN_CACHE)	+= tmem.o
 
 nostackp := $(call cc-option, -fno-stack-protector)
 CFLAGS_features.o			:= $(nostackp)

Index: linux-2.6/drivers/xen/tmem.c
===================================================================

drivers/xen/tmem.c +0 -2
@@ -247,7 +247,6 @@
 
 	if (!xen_domain())
 		return 0;
-#ifdef CONFIG_CLEANCACHE
 	BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
 	if (tmem_enabled && use_cleancache) {
 		char *s = "";
@@ -257,7 +256,6 @@
 		printk(KERN_INFO "cleancache enabled, RAM provided by "
 				 "Xen Transcendent Memory%s\n", s);
 	}
-#endif
 	return 0;
 }
 
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
Quoted 27 lines

From: Nikanth Karthikesan [mailto:[email protected]]
Sent: Tuesday, June 14, 2011 2:43 AM
To: Jan Beulich
Cc: Dan Magenheimer; Jeremy Fitzhardinge; [email protected]; Konrad Wilk
Subject: RE: [Xen-devel] [PATCH] xen-tmem: Build cleancache shim to Xen Transcendent Memory only if Cleancache is enabled

Quoted 19 lines · Jan Beulich
Quoted 11 lines
Quoted 2 lines
Quoted 1 line · Dan Magenheimer

+obj-$(CONFIG_CLEAN_CACHE) += tmem.o

Hi Nikanth --

Thanks for the suggested patch. However, tmem.c works with both cleancache and frontswap... the shim in place only works with cleancache but there is a posted patch for it to work with frontswap as well. So your patch would just need to be redone when frontswap is included soon.

Quoted 5 lines

BUT... is there a way to do an inclusive-or operation in a Makefile?... something like this (though I know this exact syntax won't work)...

obj-($CONFIG_CLEANCACHE||$CONFIG_FRONTSWAP)

You can specify the same object more than once, i.e.

Quoted 8 lines
Quoted 3 lines

obj-$(CONFIG_CLEAN_CACHE) += tmem.o
obj-$(CONFIG_FRONTSWAP) += tmem.o

Cool!

So, can this patch be merged then? It would be easy to patch for frontswap, in the frontswap patchset.

I'm OK with the Makefile change, but the second part of your patch that removes the #ifdef CONFIG_CLEANCACHE will just need to be put in again when frontswap is added (as it will be possible that CONFIG_FRONTSWAP=y but CONFIG_CLEANCACHE=n).

Is there a rush on this (i.e. is the compiler warning impeding your work somehow)? As I said, it should all be cleaned up soon so would prefer not to submit these piecemeal.

Thanks,
Dan