linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.27-rc5 xen balloon driver warnings
@ 2008-09-05  8:41 Rambaldi
  2008-09-07 22:38 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 9+ messages in thread
From: Rambaldi @ 2008-09-05  8:41 UTC (permalink / raw)
  To: linux-kernel

Hi,

when running the 2.6.27-rc5 kernel as 64 bits dumU I get the following warnings:


xen_balloon: Initialising balloon driver.
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:463 sysfs_add_one+0x33/0x39()
sysfs: duplicate filename 'memory' can not be created
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.27-rc5 #2

Call Trace:
  [<ffffffff80231c9c>] warn_slowpath+0xb4/0xdd
  [<ffffffff803311f8>] write_console+0xda/0x119
  [<ffffffff8020baf6>] xen_mc_flush+0x11c/0x15b
  [<ffffffff8032c0d8>] notify_update+0x2b/0x30
  [<ffffffff80330579>] vt_console_print+0x27b/0x288
  [<ffffffff802f0b6e>] idr_get_empty_slot+0x164/0x243
  [<ffffffff80274ad0>] __kmalloc+0x99/0xc6
  [<ffffffff8027456b>] kmem_cache_alloc+0x65/0x92
  [<ffffffff802b7a30>] sysfs_ilookup_test+0x0/0xf
  [<ffffffff802b7c2c>] sysfs_find_dirent+0x1b/0x2f
  [<ffffffff802b7ce2>] sysfs_add_one+0x33/0x39
  [<ffffffff802b8219>] create_dir+0x4f/0x87
  [<ffffffff802b8286>] sysfs_create_dir+0x35/0x4c
  [<ffffffff802f1959>] kobject_add_internal+0xd3/0x18e
  [<ffffffff8055dbb9>] balloon_init+0x0/0x1bd
  [<ffffffff802f1a38>] kset_register+0x24/0x3a
  [<ffffffff8055dc69>] balloon_init+0xb0/0x1bd
  [<ffffffff8020a042>] do_one_initcall+0x42/0x141
  [<ffffffff802b1b04>] create_proc_entry+0x73/0x8a
  [<ffffffff80254260>] register_irq_proc+0xa7/0xbf
  [<ffffffff805488d0>] kernel_init+0x116/0x16b
  [<ffffffff8020fd3b>] int_ret_from_sys_call+0x13/0x33
  [<ffffffff80210ef9>] child_rip+0xa/0x11
  [<ffffffff80210208>] retint_restore_args+0x5/0x20
  [<ffffffff8030caa0>] dummycon_dummy+0x0/0x3
  [<ffffffff8030caa0>] dummycon_dummy+0x0/0x3
  [<ffffffff80210eef>] child_rip+0x0/0x11

---[ end trace 4eaa2a86a8e2da22 ]---
kobject_add_internal failed for memory with -EEXIST, don't try to register things with the same name in the same directory.
Pid: 1, comm: swapper Tainted: G        W 2.6.27-rc5 #2

Call Trace:
  [<ffffffff802f19d5>] kobject_add_internal+0x14f/0x18e
  [<ffffffff8055dbb9>] balloon_init+0x0/0x1bd
  [<ffffffff802f1a38>] kset_register+0x24/0x3a
  [<ffffffff8055dc69>] balloon_init+0xb0/0x1bd
  [<ffffffff8020a042>] do_one_initcall+0x42/0x141
  [<ffffffff802b1b04>] create_proc_entry+0x73/0x8a
  [<ffffffff80254260>] register_irq_proc+0xa7/0xbf
  [<ffffffff805488d0>] kernel_init+0x116/0x16b
  [<ffffffff8020fd3b>] int_ret_from_sys_call+0x13/0x33
  [<ffffffff80210ef9>] child_rip+0xa/0x11
  [<ffffffff80210208>] retint_restore_args+0x5/0x20
  [<ffffffff8030caa0>] dummycon_dummy+0x0/0x3
  [<ffffffff8030caa0>] dummycon_dummy+0x0/0x3
  [<ffffffff80210eef>] child_rip+0x0/0x11

SCSI subsystem initialized


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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-05  8:41 2.6.27-rc5 xen balloon driver warnings Rambaldi
@ 2008-09-07 22:38 ` Jeremy Fitzhardinge
  2008-09-08 15:37   ` Rambaldi
  2008-09-08 17:59   ` Ingo Molnar
  0 siblings, 2 replies; 9+ messages in thread
From: Jeremy Fitzhardinge @ 2008-09-07 22:38 UTC (permalink / raw)
  To: Rambaldi; +Cc: linux-kernel, Ingo Molnar

Rambaldi wrote:
> Hi,
>
> when running the 2.6.27-rc5 kernel as 64 bits dumU I get the following
> warnings:

This patch, change 167e6cf62979df03513898966f9227847d192327 in tip.git,
should fix this.  I'm not sure if the other sysfs changes apply to
mainline git or not.

Could you try this and see how it goes?  The first chunk should be
sufficient to fix your problem.

     J

Subject: xen-balloon: fix up sysfs issues

1. Set the class so it doesn't clash with the normal memory class
2. Fix up the sysfs show functions to match the new prototype
3. Clean up use of memparse

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: viets@work.de
Cc: Andi Kleen <andi@firstfloor.org>
---
 drivers/xen/balloon.c |   27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

===================================================================
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -60,7 +60,7 @@
 
 #define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
 
-#define BALLOON_CLASS_NAME "memory"
+#define BALLOON_CLASS_NAME "xen_memory"
 
 struct balloon_stats {
 	/* We aim for 'current allocation' == 'target allocation'. */
@@ -588,12 +587,13 @@
 }
 
 
-#define BALLOON_SHOW(name, format, args...)			\
-	static ssize_t show_##name(struct sys_device *dev,	\
-				   char *buf)			\
-	{							\
-		return sprintf(buf, format, ##args);		\
-	}							\
+#define BALLOON_SHOW(name, format, args...)				\
+	static ssize_t show_##name(struct sys_device *dev,		\
+				   struct sysdev_attribute *attr,	\
+				   char *buf)				\
+	{								\
+		return sprintf(buf, format, ##args);			\
+	}								\
 	static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL)
 
 BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
@@ -604,7 +604,8 @@
 	     (balloon_stats.hard_limit!=~0UL) ? PAGES2KB(balloon_stats.hard_limit) : 0);
 BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(balloon_stats.driver_pages));
 
-static ssize_t show_target_kb(struct sys_device *dev, char *buf)
+static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr,
+			      char *buf)
 {
 	return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
 }
@@ -614,19 +615,14 @@
 			       const char *buf,
 			       size_t count)
 {
-	char memstring[64], *endchar;
+	char *endchar;
 	unsigned long long target_bytes;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	if (count <= 1)
-		return -EBADMSG; /* runt */
-	if (count > sizeof(memstring))
-		return -EFBIG;   /* too long */
-	strcpy(memstring, buf);
+	target_bytes = memparse(buf, &endchar);
 
-	target_bytes = memparse(memstring, &endchar);
 	balloon_set_new_target(target_bytes >> PAGE_SHIFT);
 
 	return count;




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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-07 22:38 ` Jeremy Fitzhardinge
@ 2008-09-08 15:37   ` Rambaldi
  2008-09-08 16:54     ` Jeremy Fitzhardinge
  2008-09-08 17:59   ` Ingo Molnar
  1 sibling, 1 reply; 9+ messages in thread
From: Rambaldi @ 2008-09-08 15:37 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: linux-kernel, Ingo Molnar

Jeremy Fitzhardinge wrote:
> Rambaldi wrote:
>> Hi,
>>
>> when running the 2.6.27-rc5 kernel as 64 bits dumU I get the following
>> warnings:
> 
> This patch, change 167e6cf62979df03513898966f9227847d192327 in tip.git,
> should fix this.  I'm not sure if the other sysfs changes apply to
> mainline git or not.
> 
> Could you try this and see how it goes?  The first chunk should be
> sufficient to fix your problem.
> 
>      J
> 
>

Hi Jeremy,

I used the complete patch, I had some compile warnings.
The oops is gone and I was able to access the
	/sys/devices/system/xen_memory/xen_memory0/info/current_kb
entry.

thanks,

R.


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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-08 15:37   ` Rambaldi
@ 2008-09-08 16:54     ` Jeremy Fitzhardinge
  2008-09-08 18:01       ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremy Fitzhardinge @ 2008-09-08 16:54 UTC (permalink / raw)
  To: Rambaldi; +Cc: linux-kernel, Ingo Molnar

Rambaldi wrote:
> I used the complete patch, I had some compile warnings.

Well, the compile warning are bad news.  Just use the first hunk.

Ingo, could you send this up to Linus?  It's a subset of a patch you've
already got in your tree.

Thanks,
    J

Subject: xen-balloon: fix balloon sysfs name

Set the class so it doesn't clash with the normal memory class.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
===================================================================
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -60,7 +60,7 @@
 
 #define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
 
-#define BALLOON_CLASS_NAME "memory"
+#define BALLOON_CLASS_NAME "xen_memory"
 
 struct balloon_stats {
 	/* We aim for 'current allocation' == 'target allocation'. */


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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-07 22:38 ` Jeremy Fitzhardinge
  2008-09-08 15:37   ` Rambaldi
@ 2008-09-08 17:59   ` Ingo Molnar
  2008-09-08 18:13     ` Jeremy Fitzhardinge
  1 sibling, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2008-09-08 17:59 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Rambaldi, linux-kernel


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Rambaldi wrote:
> > Hi,
> >
> > when running the 2.6.27-rc5 kernel as 64 bits dumU I get the following
> > warnings:
> 
> This patch, change 167e6cf62979df03513898966f9227847d192327 in tip.git,
> should fix this.  I'm not sure if the other sysfs changes apply to
> mainline git or not.
> 
> Could you try this and see how it goes?  The first chunk should be
> sufficient to fix your problem.

We could certainly propagate it to x86/urgent, if it fixes a real issue. 
It cherry-picks just fine.

	Ingo

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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-08 16:54     ` Jeremy Fitzhardinge
@ 2008-09-08 18:01       ` Ingo Molnar
  2008-09-08 18:14         ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2008-09-08 18:01 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Rambaldi, linux-kernel


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Rambaldi wrote:
> > I used the complete patch, I had some compile warnings.
> 
> Well, the compile warning are bad news.  Just use the first hunk.
> 
> Ingo, could you send this up to Linus?  It's a subset of a patch you've
> already got in your tree.

i cherry-picked the whole thing as that's the tested commit. Is that 
fine too?

	Ingo

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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-08 17:59   ` Ingo Molnar
@ 2008-09-08 18:13     ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 9+ messages in thread
From: Jeremy Fitzhardinge @ 2008-09-08 18:13 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Rambaldi, linux-kernel

Ingo Molnar wrote:
> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>   
>> Rambaldi wrote:
>>     
>>> Hi,
>>>
>>> when running the 2.6.27-rc5 kernel as 64 bits dumU I get the following
>>> warnings:
>>>       
>> This patch, change 167e6cf62979df03513898966f9227847d192327 in tip.git,
>> should fix this.  I'm not sure if the other sysfs changes apply to
>> mainline git or not.
>>
>> Could you try this and see how it goes?  The first chunk should be
>> sufficient to fix your problem.
>>     
>
> We could certainly propagate it to x86/urgent, if it fixes a real issue. 
> It cherry-picks just fine.
>   

The rest of that patch updates the sysfs entries in line with Andi's
changes, but I don't think they're in mainline yet.

The sysfs namespace clash means that Xen balloon and hotplug memory try
to register the same name, which is bad because one of them is going to
lose.

    J

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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-08 18:01       ` Ingo Molnar
@ 2008-09-08 18:14         ` Jeremy Fitzhardinge
  2008-09-08 18:21           ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremy Fitzhardinge @ 2008-09-08 18:14 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Rambaldi, linux-kernel

Ingo Molnar wrote:
> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>   
>> Rambaldi wrote:
>>     
>>> I used the complete patch, I had some compile warnings.
>>>       
>> Well, the compile warning are bad news.  Just use the first hunk.
>>
>> Ingo, could you send this up to Linus?  It's a subset of a patch you've
>> already got in your tree.
>>     
>
> i cherry-picked the whole thing as that's the tested commit. Is that 
> fine too?

No, because it caused compile-time warnings.  The signatures on sysfs
access functions changed, so that patch will break unless the rest of
the sysfs changes went in.

    J

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

* Re: 2.6.27-rc5 xen balloon driver warnings
  2008-09-08 18:14         ` Jeremy Fitzhardinge
@ 2008-09-08 18:21           ` Ingo Molnar
  0 siblings, 0 replies; 9+ messages in thread
From: Ingo Molnar @ 2008-09-08 18:21 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: Rambaldi, linux-kernel


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Ingo Molnar wrote:
> > * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> >
> >   
> >> Rambaldi wrote:
> >>     
> >>> I used the complete patch, I had some compile warnings.
> >>>       
> >> Well, the compile warning are bad news.  Just use the first hunk.
> >>
> >> Ingo, could you send this up to Linus?  It's a subset of a patch you've
> >> already got in your tree.
> >>     
> >
> > i cherry-picked the whole thing as that's the tested commit. Is that 
> > fine too?
> 
> No, because it caused compile-time warnings.  The signatures on sysfs 
> access functions changed, so that patch will break unless the rest of 
> the sysfs changes went in.

ok - i've picked up your narrowed patch into tip/x86/urgent.

	Ingo

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

end of thread, other threads:[~2008-09-08 18:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-05  8:41 2.6.27-rc5 xen balloon driver warnings Rambaldi
2008-09-07 22:38 ` Jeremy Fitzhardinge
2008-09-08 15:37   ` Rambaldi
2008-09-08 16:54     ` Jeremy Fitzhardinge
2008-09-08 18:01       ` Ingo Molnar
2008-09-08 18:14         ` Jeremy Fitzhardinge
2008-09-08 18:21           ` Ingo Molnar
2008-09-08 17:59   ` Ingo Molnar
2008-09-08 18:13     ` Jeremy Fitzhardinge

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).