public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Padraig Brady <padraig@antefacto.com>
To: "Roy S.C. Ho" <scho1208@yahoo.com>,
	david@gibson.dropbear.id.au, tachino@open.nm.fujitsu.co.jp
Cc: linux-kernel@vger.kernel.org
Subject: Re: question about kernel 2.4 ramdisk
Date: Tue, 04 Dec 2001 19:47:15 +0000	[thread overview]
Message-ID: <3C0D2843.5060708@antefacto.com> (raw)
In-Reply-To: <20011204190109.68826.qmail@web21101.mail.yahoo.com>

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



  reply	other threads:[~2001-12-04 19:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04 19:01 question about kernel 2.4 ramdisk Roy S.C. Ho
2001-12-04 19:47 ` Padraig Brady [this message]
2001-12-04 20:14   ` Alan Cox
2001-12-05  7:49     ` Christoph Rohland
2001-12-05  7:56     ` Tachino Nobuhiro
2001-12-05  8:23       ` Christoph Rohland
2001-12-05  8:42         ` Tachino Nobuhiro
2001-12-05 13:51           ` Christoph Rohland
2001-12-06 16:37         ` David Gibson
2001-12-06 16:55           ` Alan Cox
2001-12-08  9:53           ` Christoph Rohland
2001-12-14  5:35             ` David Gibson
2001-12-16 15:34               ` Christoph Rohland
2001-12-17  3:49                 ` David Gibson
2001-12-17  7:55                   ` Christoph Rohland
2001-12-05  9:37   ` Roy S.C. Ho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C0D2843.5060708@antefacto.com \
    --to=padraig@antefacto.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scho1208@yahoo.com \
    --cc=tachino@open.nm.fujitsu.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox