All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Don't use pdflush for filesystems has BDI_CAP_NO_WRITEBACK
Date: Sat, 29 Oct 2005 17:58:32 +0900	[thread overview]
Message-ID: <87r7a4d7if.fsf_-_@devron.myhome.or.jp> (raw)
In-Reply-To: <87vezgd89q.fsf_-_@devron.myhome.or.jp> (OGAWA Hirofumi's message of "Sat, 29 Oct 2005 17:42:09 +0900")

Hi,

If inodes of filesystem has BDI_CAP_NO_WRITEBACK, it shouldn't be
needed to flush the inodes by pdflush at all.  So, this patch stops
puting the inode on the sb->s_dirty, by setting I_DIRTY as initial
state.

With this patch, I think unnecessary flush is stopped.

BTW, probably all most of on memory filesystems also doesn't need to
flush by pdflush...?

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 fs/hugetlbfs/inode.c |    1 +
 fs/pipe.c            |    8 +-------
 fs/ramfs/inode.c     |    1 +
 fs/relayfs/inode.c   |    1 +
 fs/sysfs/inode.c     |    1 +
 include/linux/fs.h   |   10 ++++++++++
 kernel/cpuset.c      |    1 +
 mm/shmem.c           |    1 +
 8 files changed, 17 insertions(+), 7 deletions(-)

diff -puN fs/hugetlbfs/inode.c~add-set_inode_noflush fs/hugetlbfs/inode.c
--- linux-2.6.14/fs/hugetlbfs/inode.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/fs/hugetlbfs/inode.c	2005-10-29 08:13:57.000000000 +0900
@@ -394,6 +394,7 @@ static struct inode *hugetlbfs_get_inode
 	inode = new_inode(sb);
 	if (inode) {
 		struct hugetlbfs_inode_info *info;
+		set_inode_noflush(inode);
 		inode->i_mode = mode;
 		inode->i_uid = uid;
 		inode->i_gid = gid;
diff -puN fs/pipe.c~add-set_inode_noflush fs/pipe.c
--- linux-2.6.14/fs/pipe.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/fs/pipe.c	2005-10-29 08:13:57.000000000 +0900
@@ -697,13 +697,7 @@ static struct inode * get_pipe_inode(voi
 	PIPE_READERS(*inode) = PIPE_WRITERS(*inode) = 1;
 	inode->i_fop = &rdwr_pipe_fops;
 
-	/*
-	 * Mark the inode dirty from the very beginning,
-	 * that way it will never be moved to the dirty
-	 * list because "mark_inode_dirty()" will think
-	 * that it already _is_ on the dirty list.
-	 */
-	inode->i_state = I_DIRTY;
+	set_inode_noflush(inode);
 	inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR;
 	inode->i_uid = current->fsuid;
 	inode->i_gid = current->fsgid;
diff -puN fs/ramfs/inode.c~add-set_inode_noflush fs/ramfs/inode.c
--- linux-2.6.14/fs/ramfs/inode.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/fs/ramfs/inode.c	2005-10-29 08:13:57.000000000 +0900
@@ -55,6 +55,7 @@ struct inode *ramfs_get_inode(struct sup
 	struct inode * inode = new_inode(sb);
 
 	if (inode) {
+		set_inode_noflush(inode);
 		inode->i_mode = mode;
 		inode->i_uid = current->fsuid;
 		inode->i_gid = current->fsgid;
diff -puN fs/relayfs/inode.c~add-set_inode_noflush fs/relayfs/inode.c
--- linux-2.6.14/fs/relayfs/inode.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/fs/relayfs/inode.c	2005-10-29 08:13:57.000000000 +0900
@@ -52,6 +52,7 @@ static struct inode *relayfs_get_inode(s
 		return NULL;
 	}
 
+	set_inode_noflush(inode);
 	inode->i_mode = mode;
 	inode->i_uid = 0;
 	inode->i_gid = 0;
diff -puN fs/sysfs/inode.c~add-set_inode_noflush fs/sysfs/inode.c
--- linux-2.6.14/fs/sysfs/inode.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/fs/sysfs/inode.c	2005-10-29 08:13:57.000000000 +0900
@@ -113,6 +113,7 @@ struct inode * sysfs_new_inode(mode_t mo
 {
 	struct inode * inode = new_inode(sysfs_sb);
 	if (inode) {
+		set_inode_noflush(inode);
 		inode->i_blksize = PAGE_CACHE_SIZE;
 		inode->i_blocks = 0;
 		inode->i_mapping->a_ops = &sysfs_aops;
diff -puN include/linux/fs.h~add-set_inode_noflush include/linux/fs.h
--- linux-2.6.14/include/linux/fs.h~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/include/linux/fs.h	2005-10-29 08:13:57.000000000 +0900
@@ -1075,6 +1075,16 @@ static inline void file_accessed(struct 
 		touch_atime(file->f_vfsmnt, file->f_dentry);
 }
 
+static inline void set_inode_noflush(struct inode *inode)
+{
+	/*
+	 * Mark the inode dirty from the very beginning, that way it
+	 * will never be moved to the dirty list because "mark_inode_dirty()"
+	 * will think that it already _is_ on the dirty list.
+	 */
+	inode->i_state |= I_DIRTY;
+}
+
 int sync_inode(struct inode *inode, struct writeback_control *wbc);
 
 /**
diff -puN kernel/cpuset.c~add-set_inode_noflush kernel/cpuset.c
--- linux-2.6.14/kernel/cpuset.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/kernel/cpuset.c	2005-10-29 08:13:57.000000000 +0900
@@ -236,6 +236,7 @@ static struct inode *cpuset_new_inode(mo
 	struct inode *inode = new_inode(cpuset_sb);
 
 	if (inode) {
+		set_inode_noflush(inode);
 		inode->i_mode = mode;
 		inode->i_uid = current->fsuid;
 		inode->i_gid = current->fsgid;
diff -puN mm/shmem.c~add-set_inode_noflush mm/shmem.c
--- linux-2.6.14/mm/shmem.c~add-set_inode_noflush	2005-10-29 08:13:57.000000000 +0900
+++ linux-2.6.14-hirofumi/mm/shmem.c	2005-10-29 08:13:57.000000000 +0900
@@ -1283,6 +1283,7 @@ shmem_get_inode(struct super_block *sb, 
 
 	inode = new_inode(sb);
 	if (inode) {
+		set_inode_noflush(inode);
 		inode->i_mode = mode;
 		inode->i_uid = current->fsuid;
 		inode->i_gid = current->fsgid;
_

  reply	other threads:[~2005-10-29  8:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 20:39 [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime) Machida, Hiroyuki
2005-09-15 13:15 ` OGAWA Hirofumi
2005-09-15 13:58   ` Machida, Hiroyuki
2005-09-29 17:35   ` [PATCH 1/2] miss-sync changes on attributes (Re: [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime)) Machida, Hiroyuki
2005-09-29 17:49     ` [PATCH 2/2] replace ext2_sync_inode() with sync_inode_wodata( " Machida, Hiroyuki
2005-09-29 19:20     ` [PATCH 1/2] miss-sync changes on attributes " Machida, Hiroyuki
2005-10-11 21:26     ` Andrew Morton
2005-10-12  4:02       ` OGAWA Hirofumi
2005-10-12  4:16         ` Andrew Morton
2005-10-12  4:58           ` OGAWA Hirofumi
2005-10-12  5:47             ` OGAWA Hirofumi
2005-10-12  5:54             ` Machida, Hiroyuki
2005-10-12  6:10               ` Andrew Morton
2005-10-12  9:04                 ` Machida, Hiroyuki
2005-10-12  6:21               ` OGAWA Hirofumi
2005-10-12  9:15                 ` Machida, Hiroyuki
2005-10-14 13:01                   ` [PATCH] generic_osync_inode() with OSYNC_INODE only passed (Re: [PATCH 1/2] miss-sync changes on attributes) Machida, Hiroyuki
2005-10-14 13:02                   ` Machida, Hiroyuki
2005-10-29  8:42           ` [PATCH] Fix !mapping_cap_writeback_dirty(inode->i_mapping) OGAWA Hirofumi
2005-10-29  8:58             ` OGAWA Hirofumi [this message]
2005-10-30 17:15               ` [PATCH] Don't use pdflush for filesystems has BDI_CAP_NO_WRITEBACK OGAWA Hirofumi

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=87r7a4d7if.fsf_-_@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 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.