Help!

BKL: Remove BKL from Squashfs

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel RSS
Next:  Accepted lsb-pkgchk3 3.2.1-1.1 (source amd64)  
Author Message
Phillip Lougher
External


Since: Jan 07, 2007
Posts: 5



PostPosted: Tue Nov 03, 2009 11:10 am    Post subject: BKL: Remove BKL from Squashfs
Archived from groups: linux>kernel (more info?)

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

Signed-off-by: Phillip Lougher <phillip.RemoveThis@lougher.demon.co.uk>
---
fs/squashfs/super.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 23cea83..7c25056 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -30,7 +30,6 @@
#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/slab.h>
-#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <linux/pagemap.h>
#include <linux/init.h>
@@ -78,14 +77,11 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
u64 lookup_table_start;
int err;

- lock_kernel();
-
TRACE("Entered squashfs_fill_superblock\n");

sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
if (sb->s_fs_info == NULL) {
ERROR("Failed to allocate squashfs_sb_info\n");
- unlock_kernel();
return -ENOMEM;
}
msblk = sb->s_fs_info;
@@ -289,7 +285,6 @@ allocate_root:

TRACE("Leaving squashfs_fill_super\n");
kfree(sblk);
- unlock_kernel();
return 0;

failed_mount:
@@ -303,14 +298,12 @@ failed_mount:
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
kfree(sblk);
- unlock_kernel();
return err;

failure:
kfree(msblk->stream.workspace);
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
- unlock_kernel();
return -ENOMEM;
}

@@ -345,8 +338,6 @@ static int squashfs_remount(struct super_block *sb, int *flags, char *data)

static void squashfs_put_super(struct super_block *sb)
{
- lock_kernel();
-
if (sb->s_fs_info) {
struct squashfs_sb_info *sbi = sb->s_fs_info;
squashfs_cache_delete(sbi->block_cache);
@@ -359,8 +350,6 @@ static void squashfs_put_super(struct super_block *sb)
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
}
-
- unlock_kernel();
}


--
1.5.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Andrew Morton
External


Since: Feb 02, 2007
Posts: 2303



PostPosted: Tue Nov 10, 2009 4:10 pm    Post subject: Re: BKL: Remove BKL from Squashfs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 03 Nov 2009 15:15:16 +0000
Phillip Lougher <phillip RemoveThis @lougher.demon.co.uk> wrote:

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

What kernel are you trying to patch here?

Most of your patch is already present in mainline. Against mainline,
this what is left of your patch:

--- a/fs/squashfs/super.c~bkl-remove-bkl-from-squashfs
+++ a/fs/squashfs/super.c
@@ -30,7 +30,6 @@
#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/slab.h>
-#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <linux/pagemap.h>
#include <linux/init.h>
@@ -339,8 +338,6 @@ static int squashfs_remount(struct super

static void squashfs_put_super(struct super_block *sb)
{
- lock_kernel();
-
if (sb->s_fs_info) {
struct squashfs_sb_info *sbi = sb->s_fs_info;
squashfs_cache_delete(sbi->block_cache);
@@ -353,8 +350,6 @@ static void squashfs_put_super(struct su
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
}
-
- unlock_kernel();
}


So someone has decided to remove lots of lock_kernel()'s but chose to
leave the squashfs_put_super() ones behind.

Why did they do that? Your patch effectively asserts that their
decision was incorrect.


So please rethink, update the changelog appropriately and resend.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Phillip Lougher
External


Since: Jan 07, 2007
Posts: 5



PostPosted: Tue Nov 10, 2009 5:10 pm    Post subject: Re: BKL: Remove BKL from Squashfs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Andrew Morton wrote:

>
> So someone has decided to remove lots of lock_kernel()'s but chose to
> leave the squashfs_put_super() ones behind.
>
> Why did they do that? Your patch effectively asserts that their
> decision was incorrect.
>


This patch was prompted by Jan Blunck's "Push down BKL to the filesystems" patch
series, where he firstly pushes the BKL down to individual filesystems
(even if they don't need it) , and then successively removes them
(on a one patch per filesystem basis) in later patches.

See http://lwn.net/Articles/359887/

His large patch pushed the BKL down to squashfs_fill_super(). He didn't send a
later patch removing them. The BKL pushdown is unnecessary in squashfs_fill_super(),
because it isn't protecting any shared state. The BKL in squashfs_put_super() is mine.
After reviewing Jan's BKL patches I realised it was unnecessary, and it shouldn't
be there.

The patch should be reviewed in the context that it is intended for Jan's
BKL removal patch series.

Phillip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Phillip Lougher
External


Since: Jan 07, 2007
Posts: 5



PostPosted: Tue Nov 10, 2009 6:10 pm    Post subject: Re: BKL: Remove BKL from Squashfs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Phillip Lougher wrote:

> This patch was prompted by Jan Blunck's "Push down BKL to the
> filesystems" patch
> series, where he firstly pushes the BKL down to individual filesystems
> (even if they don't need it) , and then successively removes them
> (on a one patch per filesystem basis) in later patches.
>
> The patch should be reviewed in the context that it is intended for Jan's
> BKL removal patch series.
>

Jan and/or Matthew,

Can you please ACK this patch, and say whether you're going to
add it to your BKL patch series? (I'm happy for it to go through
there, rather than my Squashfs tree).

After reviewing your patches, it seems to me that the BKL isn't
needed in Squashfs. You removed it from 23 filesystems because
it's not protecting any shared state, on that basis it isn't needed
needed in Squashfs either.

Thanks

Phillip


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Jan Blunck
External


Since: May 30, 2006
Posts: 58



PostPosted: Wed Nov 11, 2009 11:10 am    Post subject: Re: BKL: Remove BKL from Squashfs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, Nov 10, Phillip Lougher wrote:

> Phillip Lougher wrote:
>
> >This patch was prompted by Jan Blunck's "Push down BKL to the
> >filesystems" patch
> >series, where he firstly pushes the BKL down to individual filesystems
> >(even if they don't need it) , and then successively removes them
> >(on a one patch per filesystem basis) in later patches.
> >
> >The patch should be reviewed in the context that it is intended for Jan's
> >BKL removal patch series.
> >
>
> Jan and/or Matthew,
>
> Can you please ACK this patch, and say whether you're going to
> add it to your BKL patch series? (I'm happy for it to go through
> there, rather than my Squashfs tree).
>
> After reviewing your patches, it seems to me that the BKL isn't
> needed in Squashfs. You removed it from 23 filesystems because
> it's not protecting any shared state, on that basis it isn't needed
> needed in Squashfs either.

Yes, I'll do this through my patch series. I'll rework the series a bit and
will repost it soon.

Thanks,
Jan

--
Jan Blunck <jblunck.DeleteThis@suse.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum