* [patch?] RAMFS
@ 2001-02-03 19:02 Mike Galbraith
2001-02-04 6:32 ` Mike Galbraith
0 siblings, 1 reply; 4+ messages in thread
From: Mike Galbraith @ 2001-02-03 19:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Alan Cox
Hi,
With the patch below, ramfs will withstand make -j20 (binutils)
even while an iozone is running, and cp /dev/zero zero. These
fail as is. The problem seems to be in the way writepage() is
called.. ClearPageDirty(); writepage(). That screws up ramfs's
beancounting and makes it wipe pages and do double accounting.
(df;cp /dev/zero zero;rm zero;df to see accounting woes).
Accounting only from ramfs_prepare_write() seems to be enough for
the page limit to function (whodathunkit;)
-Mike
--- linux-2.4.1.ac2/fs/ramfs/inode.c.org Sat Feb 3 10:29:54 2001
+++ linux-2.4.1.ac2/fs/ramfs/inode.c Sat Feb 3 19:22:08 2001
@@ -173,11 +173,8 @@
(inode->i_data.nrpages <= rsb->max_file_pages) ) ) {
inode->i_blocks += IBLOCKS_PER_PAGE;
rsb->free_pages--;
- SetPageDirty(page);
- } else {
- ClearPageUptodate(page);
+ } else
ret = 0;
- }
unlock_rsb(rsb);
@@ -259,13 +256,7 @@
*/
static int ramfs_writepage(struct page *page)
{
- struct inode *inode = (struct inode *)page->mapping->host;
-
- if (! ramfs_alloc_page(inode, page))
- {
- UnlockPage(page);
- return -ENOSPC;
- }
+ SetPageDirty(page);
UnlockPage(page);
return 0;
}
@@ -275,9 +266,8 @@
struct inode *inode = (struct inode *)page->mapping->host;
void *addr;
- if (! ramfs_alloc_page(inode, page)) {
+ if (! ramfs_alloc_page(inode, page))
return -ENOSPC;
- }
addr = (void *) kmap(page);
if (!Page_Uptodate(page)) {
@@ -285,6 +275,7 @@
flush_dcache_page(page);
SetPageUptodate(page);
}
+ SetPageDirty(page);
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch?] RAMFS
2001-02-03 19:02 [patch?] RAMFS Mike Galbraith
@ 2001-02-04 6:32 ` Mike Galbraith
2001-02-04 9:53 ` Christoph Rohland
0 siblings, 1 reply; 4+ messages in thread
From: Mike Galbraith @ 2001-02-04 6:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Alan Cox
On Sat, 3 Feb 2001, Mike Galbraith wrote:
> Hi,
>
> With the patch below...
However, tmpfs appears to cover the functionality provided by ramfs.
Are there any uses for ramfs which can't be handled by tmpfs?
The only thing I could think of was "what if you don't have a
swap device up and running". Seems it doesn't need one :))
-Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch?] RAMFS
2001-02-04 6:32 ` Mike Galbraith
@ 2001-02-04 9:53 ` Christoph Rohland
2001-02-04 13:48 ` David Woodhouse
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Rohland @ 2001-02-04 9:53 UTC (permalink / raw)
To: Mike Galbraith; +Cc: linux-kernel, Alan Cox
Mike Galbraith <mikeg@wen-online.de> writes:
> However, tmpfs appears to cover the functionality provided by ramfs.
> Are there any uses for ramfs which can't be handled by tmpfs?
Nothing I know of.
> The only thing I could think of was "what if you don't have a
> swap device up and running". Seems it doesn't need one :))
Yes and no. tmpfs has a little bit overhead for the noswap case but
this overhead is in the kernel anyways for shared anon mappings. The
whole vm is using swap unconditionally.
Greetings
Christoph
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch?] RAMFS
2001-02-04 9:53 ` Christoph Rohland
@ 2001-02-04 13:48 ` David Woodhouse
0 siblings, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2001-02-04 13:48 UTC (permalink / raw)
To: Christoph Rohland; +Cc: Mike Galbraith, linux-kernel, Alan Cox
On 4 Feb 2001, Christoph Rohland wrote:
> Yes and no. tmpfs has a little bit overhead for the noswap case but
> this overhead is in the kernel anyways for shared anon mappings. The
> whole vm is using swap unconditionally.
I'm hoping that'll end up conditional on CONFIG_BLK_DEV or CONFIG_SWAP.
--
dwmw2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-02-04 13:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-03 19:02 [patch?] RAMFS Mike Galbraith
2001-02-04 6:32 ` Mike Galbraith
2001-02-04 9:53 ` Christoph Rohland
2001-02-04 13:48 ` David Woodhouse
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.