Re: question about kernel 2.4 ramdisk

From: Padraig Brady (padraig@antefacto.com)
Date: Tue Dec 04 2001 - 14:47:15 EST


wrt the ramfs leak (the referenced patch below worked for me),
is the ramfs usage limits patch + this fix going into
the official 2.4 soon as it was in the ac series for ages?

thanks,
Padraig.

-------- Original Message --------
Subject: Re: ramfs leak
Date: Mon, 12 Nov 2001 11:47:41 +0900
From: Tachino Nobuhiro <tachino@open.nm.fujitsu.co.jp>
To: wcm@catnap.com (W Christopher Martin)
CC: linux-kernel@vger.kernel.org, padraig@antefacto.com (Padraig Brady)

Hello,

At Fri, 9 Nov 2001 15:40:43 -0500 (EST),
W Christopher Martin wrote:
>
> Padraig Brady writes:
> > When I remove files from a ramfs the space is not reclaimed?
> > What am I doing wrong? Details below.
>
> Nothing. We've noticed the same thing. It's a bug and was
> first reported back in July, but no one has provided a fix yet.
> I've had a brief look at the source code, but nothing obvious
> pops out at me.

I think you should use tmpfs instead of ramfs, but if you really want to
use ramfs,
the patch below may fix the problem.

diff -Nur linux-2.4.13-ac7.org/fs/ramfs/inode.c
linux-2.4.13-ac7/fs/ramfs/inode.c
--- linux-2.4.13-ac7.org/fs/ramfs/inode.c Mon Nov 12 11:00:47 2001
+++ linux-2.4.13-ac7/fs/ramfs/inode.c Mon Nov 12 11:26:40 2001
@@ -182,12 +182,9 @@
  {
          struct ramfs_sb_info *rsb = RAMFS_SB(inode->i_sb);

-
if (! Page_Uptodate(page))
-
        return;
-
          lock_rsb(rsb);
-
-
ClearPageDirty(page);
+
if (Page_Uptodate(page))
+
        ClearPageDirty(page);
          
          rsb->free_pages++;
          inode->i_blocks -= IBLOCKS_PER_PAGE;

Roy S.C. Ho wrote:

> Hi, I am using linux kernel 2.4.2 and I have 1 GB ram.
> I tried to boot the system with a ramdisk size of
> 600MB. It was ok when I did "mke2fs" on it, but when I
> mounted it, it failed (Magic number mismatch). I tried
> this several times and found that all ramdisk sizes
> larger than 513MB could cause trouble. Could anyone
> please kindly give me some hints? I would like to have
> a larger ramdisk (around 800MB).
>
> (note: I tried ramfs but it seems to have memory
> leakage when files are deleted and created frequently;
> tmpfs is ok, but the pages may be swapped, which is
> not desirable in my case...)

does the patch attached fix your problem with ramfs?

 
> Thank you very much!
>
> Regards,
> Roy

-
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/



This archive was generated by hypermail 2b29 : Fri Dec 07 2001 - 21:00:25 EST