Re: [PATCH] x86_64/lib: improve the performance of memmove

2010-09-15 Thread Andi Kleen
> When the dest and the src do overlap and the memory area is large, memmove > of > x86_64 is very inefficient, and it led to bad performance, such as btrfs's > file > deletion performance. This patch improved the performance of memmove on > x86_64 > by using __memcpy_bwd() instead of byte copy whe

[PATCH] x86_64/lib: improve the performance of memmove

2010-09-15 Thread Miao Xie
When the dest and the src do overlap and the memory area is large, memmove of x86_64 is very inefficient, and it led to bad performance, such as btrfs's file deletion performance. This patch improved the performance of memmove on x86_64 by using __memcpy_bwd() instead of byte copy when doing large

Re: [PATCH] Add the "btrfs filesystem label" command

2010-09-15 Thread cwillu
On Wed, Sep 15, 2010 at 7:10 PM, Chris Ball wrote: > Hi, > >   > How can one char equal two chars? >   > >   > input[i] == '\\' > > If the first char is the C escape sequence for string literals.  :) Why are those characters forbidden in a label? -- To unsubscribe from this list: send the line "

[PATCH] Btrfs: fix memory leak on free root

2010-09-15 Thread liubo
On free root, name field should be freed too. Signed-off-by: Liu Bo --- fs/btrfs/disk-io.c |1 + fs/btrfs/extent-tree.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 280de15..fe20248 100644 --- a/fs/btrfs/disk-io.c

Re: [PATCH] Add the "btrfs filesystem label" command

2010-09-15 Thread Chris Ball
Hi, > How can one char equal two chars? > > input[i] == '\\' If the first char is the C escape sequence for string literals. :) - Chris. -- Chris Ball One Laptop Per Child -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body

Re: [PATCH] Add the "btrfs filesystem label" command

2010-09-15 Thread Mike Fedyk
On Mon, Sep 13, 2010 at 12:24 PM, Goffredo Baroncelli wrote: > +int get_label(char *btrfs_dev) > +{ > + > +       int ret; > +       ret = check_mounted(btrfs_dev); > +       if (ret < 0) > +       { > +              fprintf(stderr, "FATAL: error checking %s mount status\n", > btrfs_dev); > +    

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Josh Berry
On Wed, Sep 15, 2010 at 15:37, Chris Ball wrote: ... >   > Why not just do: >   > # btrfs subvolume delete /path/to/subvolume1 >   > # btrfs subvolume delete /path/to/subvolume2 >   > # sync > > Or even better, "btrfs filesystem sync ". > > I'm assuming that the caller wants to wait until the subv

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Chris Ball
Hi Sage, > Actually, that was fixed in 2.6.34 (0bdb1db2). Creating a > snapshot syncs all dirty data and metadata to disk, so you get a > fully consistent point in time snapshot. No 'sync' is necessary > (and doing a 'sync' yourself would be racy any). Oh, thanks! Am happy to see t

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Sage Weil
On Wed, 15 Sep 2010, Sage Weil wrote: > For subvolume removal, racing doesn't seem like an issue. Why not just > do > > # btrfs subvolume delete /path/to/subvolume1 > # btrfs subvolume delete /path/to/subvolume2 > # ... > # sync > > ? Nevermind, read the whole thread this time. I'll defer to

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Sage Weil
On Wed, 15 Sep 2010, Chris Ball wrote: > Hi, > >> Or make --sync the default behavior. This is probably what most >> people are expecting anyway (similar to how standard filesystem >> commands like "rm" work). Add an --aysnc option for those that >> only care about knowing when t

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Josh Berry
On Wed, Sep 15, 2010 at 14:52, Chris Ball wrote: > Hi, > >   > Or make --sync the default behavior.  This is probably what most >   > people are expecting anyway (similar to how standard filesystem >   > commands like "rm" work).  Add an --aysnc option for those that >   > only care about knowing

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Chris Ball
Hi, > Or make --sync the default behavior. This is probably what most > people are expecting anyway (similar to how standard filesystem > commands like "rm" work). Add an --aysnc option for those that > only care about knowing when the subvolume is taken out of the > tree. Yeah.

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Josh Berry
On Wed, Sep 15, 2010 at 14:07, Chris Ball wrote: > Hi, > >   > adding a --wait or --sync switch to the delete command is >   > certainly possible, you'd want to add it to the last in a series >   > of deletes. > > I think this (--sync) is a much better idea than the alternatives so far. Or make -

Re: Updating the wiki pages adding btrfs command

2010-09-15 Thread Chris Ball
Hi, > adding a --wait or --sync switch to the delete command is > certainly possible, you'd want to add it to the last in a series > of deletes. I think this (--sync) is a much better idea than the alternatives so far. Thanks, -- Chris Ball One Laptop Per Chi

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread David Nicol
On Wed, Sep 15, 2010 at 1:41 PM, Josh Berry wrote: > Personally, I like "gc" or "clean".  "wait-subvolume-deletion", > "garbage-collect" or similar is too verbose for my taste. > > -- Josh the question IMO is how much implementation details to saddle the user with. Anything with the word "garbage

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread Goffredo Baroncelli
On Wednesday, 15 September, 2010, David Nicol wrote: > btrfs s ... is imprecise, as the operation isn't on a subvolume, but > on the fi where the s used to be but isn't any more. ok > > With your approval I'll go with "filesystem garbage-collection" which > can be abbrevd to > >btrfs fi g /

[PATCH 1/3] Btrfs: create special free space cache inode FORMAT CHANGE

2010-09-15 Thread Josef Bacik
In order to save free space cache, we need an inode to hold the data, and we need a special item to point at the right inode for the right block group. So first, create a special item that will point to the right inode, and the number of extent entries we will have and the number of bitmaps we wil

[PATCH 3/3] Btrfs: load free space cache if it exists

2010-09-15 Thread Josef Bacik
This patch actually loads the free space cache if it exists. The only thing that really changes here is that we need to cache the block group if we're going to remove an extent from it. Previously we did not do this since the caching kthread would pick it up. With the on disk cache we don't have

[PATCH 2/3] Btrfs: write out free space cache

2010-09-15 Thread Josef Bacik
This is a simple bit, just dump the free space cache out to our preallocated inode when we're writing out dirty block groups. There are a bunch of changes in inode.c in order to account for special cases. Mostly when we're doing the writeout we're holding trans_mutex, so we need to use the nolock

[PATCH 0/3] Btrfs: save free space cache to the disk

2010-09-15 Thread Josef Bacik
This patch series introduces the ability for btrfs to store the free space cache ondisk to make the caching of a block group much quicker. Previously we had to search the entire extent-tree to look for gaps everytime we wanted to allocate in a block group. This approach instead dumps all of the f

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread Josh Berry
On Wed, Sep 15, 2010 at 07:10, David Nicol wrote: > Does the manpatch below describe an acceptable API for a hook to a > facility for waiting for the completion of deleted snapshot cleanup? ... > +\fBfilesystem GC\fR\fI [ms] \fR > +wait for completion of salvage of deleted subvolumes on > +the fi

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread David Nicol
btrfs s ... is imprecise, as the operation isn't on a subvolume, but on the fi where the s used to be but isn't any more. With your approval I'll go with "filesystem garbage-collection" which can be abbrevd to btrfs fi g /butter 3 || echo there should be some more space now \ but it wou

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread Goffredo Baroncelli
Hi David, the btrfs command is smart enough to accept short form of the sub-command if there is no ambiguity. For example "btrfs fi" is a synonymous of "btrfs filesystem". Because that the acronyms are discouraged. Instead a long form is preferred. So instead of CG (which means ? Garbage Collec

Re: Updating the wiki pages adding btrfs command [Was Re: reserving an IOCTL number; other details]

2010-09-15 Thread David Nicol
Does the manpatch below describe an acceptable API for a hook to a facility for waiting for the completion of deleted snapshot cleanup? diff --git a/man/btrfs.8.in b/man/btrfs.8.in index 26ef982..290d202 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@ -19,6 +19,8 @@ btrfs \- control a btrfs fi

Re: [PATCH] Add the "btrfs filesystem label" command

2010-09-15 Thread Felix Blanke
Worked like it should for me :) Thanks a lot for your work. I hope this patch will be merged soon. Like G.Baroncelli says: It's such an essential feature. Regards, Felix Goffredo Baroncelli schrieb: Hi all, this patch adds the command "btrfs filesystem label" to change (or show) the label