After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 363400 - Nautilus / gnomevfs very slow with xfs file system
Nautilus / gnomevfs very slow with xfs file system
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.16.x
Other All
: Normal normal
: ---
Assigned To: Hans Petter Jansson
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-10-19 12:54 UTC by Matthias Kloszczyk
Modified: 2007-03-30 00:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Please delete. (463 bytes, text/plain)
2006-12-02 08:15 UTC, Dino Wu
  Details
Profiling data (sysprof file) of gnome-vfs-copy from an xfs partition to an xfs partition with barriers enabled (17.89 KB, application/xml)
2007-01-02 22:00 UTC, Francesco Degrassi
  Details
tracing nautilus/gnome-vfs-daemon while copying over smb network (2.03 KB, text/plain)
2007-01-03 00:33 UTC, Benjamin Eckenfels
  Details
tracing a big file transfer over smb to ext2 with additional dbg-flags (2.67 KB, text/plain)
2007-01-03 11:27 UTC, Benjamin Eckenfels
  Details
oprofile output while vfscopying a file to an xfs partition with barriers enabled (28.06 KB, text/plain)
2007-01-03 13:14 UTC, Francesco Degrassi
  Details
strace -c output of vfscopying a file to an xfs partition with barriers enabled (2.80 KB, text/plain)
2007-01-03 13:15 UTC, Francesco Degrassi
  Details
oprofile output while vfscopying a file to an xfs partition with barriers enabled (232.55 KB, text/plain)
2007-01-03 18:16 UTC, Francesco Degrassi
  Details
Remove fadvise(), Because it has poor preformace with SOME filesystem. (612 bytes, patch)
2007-01-30 08:56 UTC, Dino Wu
none Details | Review
Reduce the number of calls to fadvise() during data transfer operations. (2.50 KB, patch)
2007-02-22 06:37 UTC, Hans Petter Jansson
none Details | Review
Reduce the number of calls to fadvise() during data transfer operations, revisited. (2.34 KB, patch)
2007-03-28 20:38 UTC, Hans Petter Jansson
none Details | Review

Description Matthias Kloszczyk 2006-10-19 12:54:17 UTC
Please describe the problem:
It takes a very long time to copy files to xfs filesystem in nautilus. It's quick if I use cp command or other filesystems.
Slow means that i need about 3 minutes for a 650mb file instead of 15 seconds while copying onto a ext3 filesystem or via command line or midnight commander onto xfs. And the problem also exists when copying via gnomefvs-copy.

Steps to reproduce:
1. make a xfs filesystem and mount it to /target
2. open nautilus, copy a big file from somewhere and paste it to /target
3. 


Actual results:
Very slow file transfer.

Expected results:
Look into description.

Does this happen every time?
Yes.

Other information:
The problem also exists when copying via gnomefvs-copy.
Comment 1 Daniel Holbach 2006-10-30 20:03:03 UTC
If at all, it's a gnome-vfs problem. Reassigning.

According to https://launchpad.net/distros/ubuntu/+source/gnome-vfs2/+bug/58672/comments/7 this also happens in FC6.
Comment 2 mythos 2006-11-02 17:24:30 UTC
i have the same problem.
please fix the bug.
Comment 3 Robin 2006-11-03 07:31:57 UTC
I have the same problem too
Comment 4 Krzysztof Kotlenga 2006-11-04 18:09:00 UTC
The same problem in FC6 here, gnome-vfs 2.16.0
Comment 5 Yang Dehua 2006-11-16 11:04:45 UTC
Same problem here on gentoo ppc64 linux, gnome-vfs-2.16.2.
Comment 6 Gabriel Lavoie 2006-11-19 05:05:50 UTC
I have the same problem with the ntfs-3g (for fuse) driver. Writing to the NTFS partition is very slow while it is fast using command line. What I noticed is that bigger the partition is, slower it will be. For a 30 mb file, it takes about 15-30 seconds on a 20gb partition and I stopped the copy action after 20 minutes waiting on a 116 gb partition. I have this problem on Ubuntu Edgy Eft (6.10).
Comment 7 Bonfante Fabio 2006-11-27 23:49:09 UTC
me too... 
gentoo-linux on amd64
kernel 2.6.17-gentoo-r8
gnome vfs 2.14.2-r1
nautilus 2.14.1

well for a iso file of 230MB takes... hmm... 3 guns 'n roses songs...
Comment 8 Dino Wu 2006-11-29 12:18:42 UTC
I got same problem in openSUSE 10.2 RC1
It's very very slow(all here is XFS), even execute applications and cause high CPU percentage.
Everything's slower than in KDE. VERY VERY SLOW! 128M file cost 4-5min(several seconds in KDE).
Comment 9 Dino Wu 2006-11-29 15:56:57 UTC
http://blog.51sun.cn/wp-content/uploads/2006/11/Screenshot-Copying%20files-1.png

This file just 120.4MB, 3:49 remaining????
Comment 10 Dino Wu 2006-11-30 05:03:18 UTC
Why it's still UNCONFIRMED??
Comment 11 Dino Wu 2006-11-30 05:50:44 UTC
I have fix this BUG temporary, it's in libgnome/gnome-xfs-xfer.c line 1228.
I set forget_cache = 0;
It works good now... 

May be one of the functions below takes a lone time in XFS...
gnome_vfs_forget_cache (source_handle, total_bytes_read, bytes_read);
retry = handle_error (&result, progress, error_mode, skip);


Comment 12 Dino Wu 2006-11-30 06:04:42 UTC
it's in libgnome/gnome-vfs-xfer.c sorry :P
Just gnome_vfs_forget_cache() is slow.
Please fix this BUG as soon as possible thanks!! !!-_-
Comment 13 Dino Wu 2006-12-02 08:15:39 UTC
Created attachment 77527 [details]
Please delete.

gnome-vfs slow in XFS filesystem copy operations.
Just because of forget_cache()?
Comment 14 Benjamin Eckenfels 2006-12-13 23:18:02 UTC
I confirm low performance for gnome-vfs ...

... when copying from smb/cifs over network to ext3. Transferrate on 100 MBit network is around 4 MB/s where it sould be at least 8 MB/s (testet via "smbget"). 

Additional Nautilus and gnome-vfs-daemo start to eat up to 50 percent CPU-time on my iBookG4 (running on lower speed of 600 Mhz).

 
Ubuntu 6.10
2.6.17-10-powerpc
Gnome 2.16
libgnomevfs2-common 2.16.1-0ubuntu4

Comment 15 Sven Herzberg 2006-12-17 19:13:07 UTC
Has anyone ever tried to profile this so we can get an idea on how to solve this?
Comment 16 Francesco Degrassi 2006-12-23 14:07:42 UTC
I'm experiencing the same problem:
A 650M iso file written in 10 minutes with gnome-vfs, 30 secs with a shell cp.
System:
ubuntu edgy 6.10
athlon xp 3200
libgnomevfs2-common 2.16.1-0ubuntu4

I'll try to profile, if i find the time.
I wonder why this is still unconfirmed btw.
Comment 17 Francesco Degrassi 2006-12-23 14:58:19 UTC
I tested the same system with kernel 2.6.15 and it works flawlessly, so i suppose it's an XFS problem, probably in the code involved in the fadvice POSIX_FADV_DONTNEED call made by gnome_vfs_forget_cache when working on a local filesystem.

Comment 18 Benjamin Eckenfels 2006-12-31 17:28:37 UTC
Hi Francesco,

I'm not convinced it's actually XFS specific what causes this problem (see comment #14). Got the bad feeling it's slow code then. 

By the way: gnome-vfs seems to be pretty slow on debian stable, too. Can anybody confirm that?


Cheers
Comment 19 Szabolcs Szakacsits 2007-01-01 13:11:06 UTC
Hi, this is ntfs-3g upstream. I can confirm that quite many people reported major slowness which were gone if they copied files from the command line or they started to use another file manager.
Comment 20 Benjamin Eckenfels 2007-01-01 14:01:33 UTC
@szaka: Thanks to that confirmation.

Seeing no significant action from gnome upstream on this issue, i contacted the  maintainer of gnome-vfs-*-packages on debian. Let's see what happens.
Comment 21 Sven Herzberg 2007-01-02 20:37:32 UTC
(In reply to comment #20)
> @szaka: Thanks to that confirmation.
> 
> Seeing no significant action from gnome upstream on this issue, i contacted the
>  maintainer of gnome-vfs-*-packages on debian. Let's see what happens.

Thanks for trolling around. But as you try to tell "the bad gnome people don't do anything" I'm going to tell you my 2 cents:

From Comment #17:
> Has anyone ever tried to profile this so we can get an idea on how to solve
> this?

You're just fooling around over here, instead of starting sysprof and providing some real numbers that we (developers) can use.
Comment 22 Francesco Degrassi 2007-01-02 22:00:02 UTC
Created attachment 79228 [details]
Profiling data (sysprof file) of gnome-vfs-copy from an xfs partition to an xfs partition with barriers enabled
Comment 23 Francesco Degrassi 2007-01-02 22:05:54 UTC
(In reply to comment #18)

I wrote about this on the XFS mailing list and some more informations surfaced.
I suspect that we are facing 2 different problems here, one XFS related and one of a different kind. 
Regarding XFS, i can add that it only affects XFS with barriers active, remounting the filesystem with barriers disabled makes the problem vanish (barriers became active by default with 2.6.17).
I suggest you take a look at the XFS mailing list thread i started for more insights; i also run sysprof while using gnomevfs-copy and all time gets spent in kernel space, i am attaching the profiling data as a sysprof file.

XFS mailing list thread:
http://oss.sgi.com/archives/xfs/2006-12/msg00256.html

> Hi Francesco,
> 
> I'm not convinced it's actually XFS specific what causes this problem (see
> comment #14). Got the bad feeling it's slow code then. 
> 
> By the way: gnome-vfs seems to be pretty slow on debian stable, too. Can
> anybody confirm that?
> 
> 
> Cheers
> 

Comment 24 Sven Herzberg 2007-01-02 22:48:17 UTC
Thanks a lot mate; just to be sure (as you don't specify it explicitly): your profile was generated without XFS {barriers,problems}, right?
Comment 25 Szabolcs Szakacsits 2007-01-02 22:53:04 UTC
Does strace reveal any difference? Once I was reported stat() flood.
Comment 26 Sven Herzberg 2007-01-02 22:55:51 UTC
Unfortunately this isn't pretty useful; can you please install the debug symbols for glib and gnome-vfs? (and is it possible to get some for the kernel?) Having function names and not just libraries doesn't give much insight.
Comment 27 Christian Neumair 2007-01-03 00:24:56 UTC
According to http://oss.sgi.com/archives/xfs/2006-12/msg00289.html the repeated call of posix_fadvise is very likely to be the culprit.

It is only called in streaming mode (i.e. if the file is bigger than 20 MB):

/* When the total copy size is over this limit, we try to
 * forget the data cached for the files, in order to
 * lower VM pressure
 */
#define DROP_CACHE_SIZE_LIMIT (20*1024*1024)


It will be called with POSIX_FADV_DONTNEED. Assuming both the source and the target block sizes match, it will be called for each block size big chunk that has been transferred for both the source and the target file.

Note that the block size is always 8192 for local files (I don't know why), so we get many calls (~> 10^6 per file!).

On a sidenote: I'm not sure why we don't use POSIX_FADV_NOREUSE instead of POSIX_FADV_DONTNEED, according to "man posix_fadvise" it looks more appropriate - I don't know how the OS will precisely react, though.
Comment 28 Benjamin Eckenfels 2007-01-03 00:33:10 UTC
Created attachment 79237 [details]
tracing nautilus/gnome-vfs-daemon while copying over smb network
Comment 29 Benjamin Eckenfels 2007-01-03 00:36:24 UTC
Trolling was not what i had in mind. But your right. I should provide more info. So back to business. Sry for the long posting.

Here my profiling:

--


(I) Bug 363400

Problem: Nautilus / gnomevfs very slow with xfs file system
Partial Confirm: Nautilus seems slow when using gnome-vfs to copy files over smb/cifs-network.

(II) Profiling


Test 1: How slow exactly ist gnome-vfs on which system?


Performance:

335 MB over 100 Mbit from Samba smb-share (Version: Samba 3.0.14a-Debian) to localhost ext3 takes 3.10 minutes with nautilus. On second and third try transfer took between 2.40 and 2.10 minutes. smbget needs around 45 seconds.

Tracking resources on localhost while copying over network:
/usr/bin/top :
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND        
15087 benny     16   0  102m  31m  22m S 51.2  6.2   0:19.87 nautilus           
 5490 benny     15   0 59236 6628 4932 S 15.6  1.3   0:19.32 gnome-vfs-daemo 

Ubuntu 6.10 (Edgy Eft)
2.6.17-10
Arch: ppc G4, 1,33 GHz , 512 RAM
gnome				2.16.1
libgnome2-0			2.16.0-0ubuntu1
nautilus			2.16.1-0ubuntu3
gstreamer0.10-gnomevfs         	0.10.10-1ubuntu1                
libgnome2-vfs-perl              1.060-1               
libgnomevfs2-0      		2.16.1-0ubuntu4                       
libgnomevfs2-bin               	2.16.1-0ubuntu4         
libgnomevfs2-common             2.16.1-0ubuntu4          
libgnomevfs2-dev                2.16.1-0ubuntu4            
libgnomevfs2-extra              2.16.1-0ubuntu4               
libgnomevfs2-ruby               0.15.0-1.1               


Test 2: Is it slow on attached devices, too ?

 
copying a large file from localhost (ext3) to a usb 2.0 pendrive (vfat) is on equal speed with nautilus and command line tool.

Test 3: Is it slow on same disk?


duplicate a large file using nautilus on local ext3 is as fast as using cp on commandline. 

Ergo: Tracking only Test 1


(II) Stack Tracing


(see attachment stack_trace_be1)
Comment 30 Benjamin Eckenfels 2007-01-03 11:27:47 UTC
Created attachment 79264 [details]
tracing a big file transfer over smb to ext2 with additional dbg-flags

Reading comment # 27 I decided to make another trace. This time with a big file. Maybe it's easier to see this way if my problem has something in common with the XFS trouble described above.
Comment 31 Francesco Degrassi 2007-01-03 13:12:15 UTC
I'm attacching a profiling session made with oprofile of the same copy of a 120Mb file to an xfs partition with barriers enabled (ultra slow).
I'll attach also a run with strace -c that shows that all the time is spent in fadvice64.
If you need more specific info, please ask precisely for what you need, i'm not really fluent with profiling and such.

Francesco
Comment 32 Francesco Degrassi 2007-01-03 13:14:55 UTC
Created attachment 79270 [details]
oprofile output while vfscopying a file to an xfs partition with barriers enabled
Comment 33 Francesco Degrassi 2007-01-03 13:15:56 UTC
Created attachment 79271 [details]
strace -c output of vfscopying a file to an xfs partition with barriers enabled
Comment 34 Christophe Fergeau 2007-01-03 14:10:38 UTC
(In reply to comment #32)
> Created an attachment (id=79270) [edit]
> oprofile output while vfscopying a file to an xfs partition with barriers
> enabled
> 

Which command did you use exactly to get that profile ? opreport -l gnomevfs-copy will only show profiling information related to gnomevfs-copy and might be more helpful.
Comment 35 Francesco Degrassi 2007-01-03 18:16:37 UTC
Created attachment 79292 [details]
oprofile output while vfscopying a file to an xfs partition with barriers enabled

Redone profiling with oprofile, commands ran are the following:

opreport  -p /lib/modules/2.6.17-10-generic/kernel/fs/xfs/ /usr/bin/gnomevfs-copy  >> /tmp/report
opreport  -l -p /lib/modules/2.6.17-10-generic/kernel/fs/xfs/ /usr/bin/gnomevfs-copy  >> /tmp/report
opreport  -c -l -p /lib/modules/2.6.17-10-generic/kernel/fs/xfs/ /usr/bin/gnomevfs-copy  >> /tmp/report
Comment 36 Dino Wu 2007-01-29 16:21:58 UTC
(In reply to comment #33)
> Created an attachment (id=79271) [edit]
> strace -c output of vfscopying a file to an xfs partition with barriers enabled
> 

I think you need copy a "very large" file and take a strace. and compare with below.
This report with the forget_cache disabled and copying large (608MB) file.

Process 7219 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 60.47    0.393004           3    148591           read
 37.27    0.242244           2    148545           write
  2.23    0.014486           0    148558           gettimeofday
  0.02    0.000111           4        28           fadvise64
  0.01    0.000046           1        41           fstat64
  0.01    0.000041           0       326       285 open
  0.00    0.000010          10         1           fadvise64_64
  0.00    0.000000           0        43           close
  0.00    0.000000           0         1           execve
  0.00    0.000000           0         1           time
  0.00    0.000000           0         1           chmod
  0.00    0.000000           0         1           utime
  0.00    0.000000           0         4         1 access
  0.00    0.000000           0         3           brk
  0.00    0.000000           0         2           ioctl
  0.00    0.000000           0        10           munmap
  0.00    0.000000           0         2           uname
  0.00    0.000000           0         6           mprotect
  0.00    0.000000           0         1           _llseek
  0.00    0.000000           0         1           sched_getparam
  0.00    0.000000           0         1           sched_getscheduler
  0.00    0.000000           0         2           sched_get_priority_max
  0.00    0.000000           0         1           sched_get_priority_min
  0.00    0.000000           0         2           poll
  0.00    0.000000           0         3           rt_sigaction
  0.00    0.000000           0         1           rt_sigprocmask
  0.00    0.000000           0         1           pread64
  0.00    0.000000           0         2           getcwd
  0.00    0.000000           0         1           getrlimit
  0.00    0.000000           0        82           mmap2
  0.00    0.000000           0        27        16 stat64
  0.00    0.000000           0         7         1 lstat64
  0.00    0.000000           0         2           getuid32
  0.00    0.000000           0         1           getgid32
  0.00    0.000000           0         1           geteuid32
  0.00    0.000000           0         1           getegid32
  0.00    0.000000           0         2           setresuid32
  0.00    0.000000           0         2           setresgid32
  0.00    0.000000           0         1           chown32
  0.00    0.000000           0         2           getdents64
  0.00    0.000000           0         3           fcntl64
  0.00    0.000000           0         2           futex
  0.00    0.000000           0         1           set_thread_area
  0.00    0.000000           0         1           set_tid_address
  0.00    0.000000           0         1           statfs64
  0.00    0.000000           0         1           SYS_311
  0.00    0.000000           0         1           socket
  0.00    0.000000           0         1           connect
  0.00    0.000000           0         1           send
  0.00    0.000000           0         1           recvmsg
------ ----------- ----------- --------- --------- ----------------
100.00    0.649942                446321       303 total
Comment 37 Dino Wu 2007-01-30 08:56:03 UTC
Created attachment 81500 [details] [review]
Remove fadvise(), Because it has poor preformace with SOME filesystem.
Comment 38 Kjartan Maraas 2007-02-02 21:21:20 UTC
Maybe it's worth investigating with the different hints that posix_fadvise() can take to see if any of them work better than the others?
Comment 39 Hans Petter Jansson 2007-02-22 06:34:56 UTC
I don't think the solution is to remove fadvise() calls entirely. The traces show that we're calling gnome_vfs_forget_cache() way too often in gnome-vfs-xfer.c:copy_file_data() - as much as once per 4KB transferred. I'm proposing a patch to forget the cache only once per 512KB transferred.

See https://bugzilla.novell.com/show_bug.cgi?id=224527 for reference.
Comment 40 Hans Petter Jansson 2007-02-22 06:37:28 UTC
Created attachment 83090 [details] [review]
Reduce the number of calls to fadvise() during data transfer operations.
Comment 41 Giacomo Perale 2007-03-07 21:22:42 UTC
Was this patch tested? Could we hope to see this bug fixed or it will be present in gnome 2.18 as well?
Comment 42 Hans Petter Jansson 2007-03-07 23:12:17 UTC
I've tested it on my own system (with ext3 and reiserfs) only, and it did not cause any problems that I'm aware of.
Comment 43 Giacomo Perale 2007-03-07 23:28:10 UTC
Just applied here (with xfs). Copying a 700mb file from the command line takes ~40s, with nautilus and patched gnome-vfs ~50s against 10m+ without the patch.
No apparent problems, for now.
Comment 44 Alexander Larsson 2007-03-26 08:51:09 UTC
From email:

That removes the size limit for when using fadvice. I don't think this is right. For small files we don't want to flush them from the cache, as that could cause performance issues (we might be copying a commonly used file).
Comment 45 Hans Petter Jansson 2007-03-26 18:39:22 UTC
No. The following condition:

if (bytes_to_write == 0 &&
    total_bytes_read - last_cache_drop_point >= DROP_CACHE_BATCH_SIZE)

Will trigger for the first time once DROP_CACHE_BATCH_SIZE has been reached. fadvise() will be triggered at the end of each batch, not at the beginning.
Comment 46 Hans Petter Jansson 2007-03-28 20:37:34 UTC
Alex and I discussed the matter on the gnome-vfs mailing list, and we've agreed to keep the lower 20MB file size limit on fadvise() action. I'm attaching a revised patch.
Comment 47 Hans Petter Jansson 2007-03-28 20:38:59 UTC
Created attachment 85481 [details] [review]
Reduce the number of calls to fadvise() during data transfer operations, revisited.
Comment 48 Hans Petter Jansson 2007-03-30 00:27:54 UTC
The last patch was approved by Alex Larsson and committed to trunk and gnome-2-18 branch.