Tejun Heo | 1 Nov 10:31 2009

Re: [PATCH] Fix bio_alloc() and bio_kmalloc() documentation

Alberto Bertogli wrote:
> Commit 451a9ebf accidentally broke bio_alloc() and bio_kmalloc() comments by
> (almost) swapping them.
> 
> This patch fixes that, by placing the comments in the right place.
> 
> Signed-off-by: Alberto Bertogli <albertito <at> blitiri.com.ar>

Oops,

Acked-by: Tejun Heo <tj <at> kernel.org>

Thank you.

--

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 00/27] Push down BKL to the filesystems (v2)

During the realtime preemption mini-summit we discussed the entire removal of
the big kernel lock. I've started working on this for some filesystems. My plan
is to push the BKL down to the implementations first and remove it from there
later.

This series is pushing the BKL from do_new_mount() down to the filesystems and
removes it from ext series of filesystems and one other trivial use: if the BKL
is only used in get_sb/fill_super due to the push-down, we just need to make
sure that parallel calls to get_sb/fill_super would race against each other.

I addressed the feedback from Matthew Wilcox and tried to be more verbose about
why I think it is safe to remove the BKL. In most cases there is no shared
resource accessed anyway so it is trivially safe to remove the lock.

There are two filesystems where I'm not 100% sure if the proposed patch is
enough, namely btrfs and xfs. Chris(+toph), could you help me here?

I left out the patch to remove default_llseek() on purpose. This indeed needs
some more lovin'.

Comments?

Jan

Jan Blunck (27):
  BKL: Push down BKL from do_new_mount() to the filesystems
    get_sb/fill_super operation
  BKL: Remove outdated comment and include
  BKL: Remove BKL from simple_fill_super
  ext2: Add ext2_sb_info mutex
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 02/27] BKL: Remove outdated comment and include

remount_fs does not need lock_kernel() anymore since that was pushed down some
time ago. Since nothing needs smp_lock.h anymore lets remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/super.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index 19eb70b..6fe4611 100644
--- a/fs/super.c
+++ b/fs/super.c
 <at>  <at>  -23,7 +23,6  <at>  <at> 
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/acct.h>
 #include <linux/blkdev.h>
 #include <linux/quotaops.h>
 <at>  <at>  -618,8 +617,6  <at>  <at>  static void do_emergency_remount(struct work_struct *work)
 		down_write(&sb->s_umount);
 		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
 			/*
-			 * ->remount_fs needs lock_kernel().
-			 *
 			 * What lock protects sb->s_flags??
 			 */
 			do_remount_sb(sb, MS_RDONLY, NULL, 1);
--

-- 
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 03/27] BKL: Remove BKL from simple_fill_super

simple_fill_super is used in following filesystems that don't use the BKL
otherwise:
- security/selinux/selinuxfs.c
- security/inode.c
- security/smack/smackfs.c
- drivers/infiniband/hw/ipath/ipath_fs.c
- drivers/xen/xenfs/super.c
- fs/debugfs/inode.c

It is used in following filesystems that make use of the BKL:
- fs/fuse/control.c
- fs/binfmt_misc.c
- fs/nfsd/nfsctl.c

All three filesystems protect the call to simple_fill_super() by the BKL
themself. Therefore it is safe to remove the BKL from simpe_fill_super().

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/libfs.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index 3484040..4a70729 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
 <at>  <at>  -11,7 +11,6  <at>  <at> 
 #include <linux/exportfs.h>
 #include <linux/writeback.h>
 #include <linux/buffer_head.h>
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 07/27] BKL: Remove BKL from ext3_put_super() and ext3_remount()

The BKL lock is protecting the remounting against a potential call to
ext3_put_super(). This could not happen, since this is protected by the
s_umount rw semaphore of struct super_block.

Therefore I think the BKL is protecting nothing here.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/ext3/super.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 4b635b7..3ddce03 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
 <at>  <at>  -398,8 +398,6  <at>  <at>  static void ext3_put_super (struct super_block * sb)
 	struct ext3_super_block *es = sbi->s_es;
 	int i, err;

-	lock_kernel();
-
 	ext3_xattr_put_super(sb);
 	err = journal_destroy(sbi->s_journal);
 	sbi->s_journal = NULL;
 <at>  <at>  -448,8 +446,6  <at>  <at>  static void ext3_put_super (struct super_block * sb)
 	sb->s_fs_info = NULL;
 	kfree(sbi->s_blockgroup_lock);
 	kfree(sbi);
-
-	unlock_kernel();
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 16/27] BKL: Remove BKL from efs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/efs/super.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/efs/super.c b/fs/efs/super.c
index 0981141..f049428 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
 <at>  <at>  -249,13 +249,9  <at>  <at>  static int efs_fill_super(struct super_block *s, void *d, int silent)
 	struct inode *root;
 	int ret = -EINVAL;

-	lock_kernel();
-
-	sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
-	if (!sb) {
-		unlock_kernel();
+ 	sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
+	if (!sb)
 		return -ENOMEM;
-	}
 	s->s_fs_info = sb;

 	s->s_magic		= EFS_SUPER_MAGIC;
 <at>  <at>  -323,14 +319,12  <at>  <at>  static int efs_fill_super(struct super_block *s, void *d, int silent)
 		goto out_no_fs;
 	}
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 12/27] BKL: Remove BKL from btrfs

BKL is only used in get_sb. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/btrfs/super.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e5cd2cf..752a546 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
 <at>  <at>  -480,17 +480,13  <at>  <at>  static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 	fmode_t mode = FMODE_READ;
 	int error = 0;

-	lock_kernel();
-
 	if (!(flags & MS_RDONLY))
 		mode |= FMODE_WRITE;

 	error = btrfs_parse_early_options(data, mode, fs_type,
 					  &subvol_name, &fs_devices);
-	if (error) {
-		unlock_kernel();
+	if (error)
 		return error;
-	}

 	error = btrfs_scan_one_device(dev_name, mode, fs_type, &fs_devices);
 	if (error)
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 17/27] BKL: Remove BKL from exofs

We don't need the BKL in exofs.

Signed-off-by: Boaz Harrosh <bharrosh <at> panasas.com>
Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/exofs/super.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index ea045b8..8358532 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
 <at>  <at>  -31,7 +31,6  <at>  <at> 
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */

-#include <linux/smp_lock.h>
 #include <linux/string.h>
 #include <linux/parser.h>
 #include <linux/vfs.h>
 <at>  <at>  -297,13 +296,10  <at>  <at>  static int exofs_fill_super(struct super_block *sb, void *data, int silent)
 	struct osd_obj_id obj;
 	int ret;

-	lock_kernel();
-
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
-	if (!sbi) {
-		unlock_kernel();
+	if (!sbi)
(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 11/27] BKL: Remove BKL from befs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/befs/linuxvfs.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index f2aa193..33baf27 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
 <at>  <at>  -759,8 +759,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)
 	const unsigned long sb_block = 0;
 	const off_t x86_sb_off = 512;

-	lock_kernel();
-
 	save_mount_options(sb, data);

 	sb->s_fs_info = kmalloc(sizeof (*befs_sb), GFP_KERNEL);
 <at>  <at>  -869,7 +867,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)
 		befs_sb->nls = load_nls_default();
 	}

-	unlock_kernel();
 	return 0;
 /*****************/
       unacquire_bh:
 <at>  <at>  -880,7 +877,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)

(Continue reading)

Jan Blunck | 2 Nov 11:04 2009
Picon

[PATCH 10/27] BKL: Remove BKL from autofs4

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/autofs4/inode.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 3adaba9..69c8142 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
 <at>  <at>  -323,8 +323,6  <at>  <at>  int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	struct autofs_sb_info *sbi;
 	struct autofs_info *ino;

-	lock_kernel();
-
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		goto fail_unlock;
 <at>  <at>  -420,7 +418,6  <at>  <at>  int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	 * Success! Install the root dentry now to indicate completion.
 	 */
 	s->s_root = root;
-	unlock_kernel();
 	return 0;
 	
 	/*
 <at>  <at>  -442,7 +439,6  <at>  <at>  fail_free:
 	kfree(sbi);
(Continue reading)


Gmane