Hi,

2013-10-08 (화), 13:25 +0200, folkert:
> Hi,
> 
> For the last few days f2fs started to use loads of cpu on one of my
> raspberry pi systems:
> 
>   PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
>  2822 root      20   0     0    0    0 R  35.3  0.0 328:34.01 f2fs_gc-254:0
>  2826 root      20   0     0    0    0 R  35.3  0.0 327:40.07 flush-254:0

The f2fs_gc is a kernel thread conducting on-line defragementation.
The period between each triggers is dependant on the system idling time,
ranging from 30 to 60 secs by default.
In order to control these times, you can use sysfs enabled by the
following patch that was merged into 3.12-rc1.

commit d2dc095f4280ad5fdea33769e8e119fd16648426 f2fs: add sysfs entries
to select the gc policy

commit b59d0bae6ca30c496f298881616258f9cde0d9c6 f2fs: add sysfs support
for controlling the gc_thread

> This is continuous load, the whole day.

Right. It runs until there is no fragmentation.

> This is to a SSD connected via USB:
> Bus 001 Device 025: ID 0c45:7401 Microdia
> The SSD does not support trim (that's why I put f2fs on it).
> 
> It is constantly reading (and not writing) data from the SSD it is on:

The f2fs_gc just loads a bunch of victim blocks from the disk to
in-memory cache first.
Afterwards, it writes cached blocks by the write-back mechanism in VFS
according to the system status.

> 
> folkert@vnvnation ~ $ vmstat 2
> procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
>  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
>  2  0      0  20744     16 375052    0    0 305774     0  413  157  0 100  0  > 0
>  2  0      0  20744     16 375052    0    0 304272     0  409  151  0 100  0  > 0
>  2  0      0  21536     16 375052    0    0 301444     0  410  163  0 100  0  > 0
>  2  0      0  21536     16 375052    0    0 305052     0  408  150  0 100  0  > 0
>  2  0      0  21536     16 375052    0    0 302994     0  407  151  0 100  0  > 0
>  2  0      0  21932     16 375052    0    0 303408     0  406  153  0 100  0  > 0
>  2  0      0  21932     16 375052    0    0 301580     0  417  152  1 99  0  0
>  2  0      0  21932     16 375052    0    0 304142     0  411  150  0 100  0  > 0
>  2  0      0  21932     16 375052    0    0 305944     0  409  152  0 100  0  > 0
>  2  0      0  21932     16 375052    0    0 299700     0  414  156  0 100  0  > 0
> 
> It has lots of free diskspace left:

You'd better keep track on /sys/kernel/debug/f2fs/status, and I think
you can find many dirty segments across the partition.
In the status file, you can also see the f2fs_gc behavior.

Thanks,

> 
> folkert@vnvnation ~ $ df -h /home/folkert/backups
> Filesystem           Size  Used Avail Use% Mounted on
> /dev/mapper/backups  118G   91G   27G  78% /home/folkert/backups
> 
> Kernel:
> 
> folkert@vnvnation ~ $ uname -r
> 3.9.8+
> 
> 
> Folkert van Heusden
> 

-- 
Jaegeuk Kim
Samsung



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to