Re: [Patch]Memory leak in sysfs

From: Adam J. Richter (adam_at_yggdrasil.com)
Date: 12/10/04

  • Next message: Adam J. Richter: "Re: [Patch]Memory leak in sysfs"
    Date:	Fri, 10 Dec 2004 23:11:46 +0800
    To: nanhai.zou@intel.com
    
    

    Zou, Nanhai wrote:
    >Some stress testes show there is a memory leak in the latest kernel.
    >I found the memory leak is in sysfs.
    >Here is a patch against 2.6.10-rc2-mm4 to fix that.
    >
    >Signed-off-by: Zou Nan hai <Nanhai.Zou@intel.com>
    >
    >["sysfs-memleak-fix.patch" (application/octet-stream)]
    >
    >diff -Nraup a/fs/sysfs/dir.c b/fs/sysfs/dir.c
    >--- a/fs/sysfs/dir.c 2004-12-06 13:04:56.000000000 +0800
    >+++ b/fs/sysfs/dir.c 2004-12-07 16:49:36.000000000 +0800
    >@@ -349,6 +349,7 @@ static int sysfs_dir_close(struct inode
    >
    > down(&dentry->d_inode->i_sem);
    > list_del_init(&cursor->s_sibling);
    >+ sysfs_put(cursor);
    > up(&dentry->d_inode->i_sem);
    >
    > return 0;

            This is will be fixed when the patch that I posted
    at http://marc.theaimsgroup.com/?l=linux-kernel&m=110204311025022&w=2
    is applied (that patch calls release_sysfs_dirent, since there
    is no need for the reference counting of sysfs_put in this case).
    I believe that Greg had already indicated he was going to forward
    that patch to Linus (without the BUG_ON statement in my patch, which
    is fine with me).

                        __ ______________
    Adam J. Richter \ /
    adam@yggdrasil.com | g g d r a s i l
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Adam J. Richter: "Re: [Patch]Memory leak in sysfs"

    Relevant Pages

    • [PATCH] PCI / OF linkage in sysfs
      ... This patch adds a "devspec" property to all PCI entries in sysfs ... PPC and PPC64 platforms that have Open Firmware support. ... of the PowerMac patch), I need that to fix various things in XFree ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: CPU hotplug on i386
      ... > Pavel, I've ported the basic i386 CPU hotplug stuff, without the sysfs ... don't count on my patch. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • EDD - set sysfs attr owner field
      ... field of a sysfs attribute. ... Without this patch, it is possible to ... # fix edd module unload race vs sysfs access ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] scsi/sata write barrier support
      ... The patch is actually wrong. ... the disc parameters and then trigger a device rescan via sysfs (I'll ... then reading and setting it should be exported via sysfs. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] scsi/sata write barrier support
      ... The patch is actually wrong. ... the disc parameters and then trigger a device rescan via sysfs (I'll ... then reading and setting it should be exported via sysfs. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)