linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* f2fs using tons of cpu
@ 2013-10-08 11:25 folkert
  2013-10-10  0:28 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: folkert @ 2013-10-08 11:25 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: udovdh

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

This is continuous load, the whole day.
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:

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:

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

-- 
Multitail es una herramienta flexible que permite visualizar los "log
file" y seguir la ejecución de comandos. Permite filtrar, añadir
colores, combinar archivos, la visualización de diferencias (diff-
view), etc.  http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

------------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: f2fs using tons of cpu
  2013-10-08 11:25 f2fs using tons of cpu folkert
@ 2013-10-10  0:28 ` Jaegeuk Kim
  2013-11-09 17:29   ` folkert
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2013-10-10  0:28 UTC (permalink / raw)
  To: folkert; +Cc: udovdh, linux-f2fs-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: f2fs using tons of cpu
  2013-10-10  0:28 ` Jaegeuk Kim
@ 2013-11-09 17:29   ` folkert
  0 siblings, 0 replies; 3+ messages in thread
From: folkert @ 2013-11-09 17:29 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: udovdh, linux-f2fs-devel

[ garbage collector ]

> 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.

Ok but if the gc runs, the system completely locks up. That is: it is
100% unresponsive. And since it is a 120GB volume on a raspberry pi it
is practically down for _days_ (maybe even weeks - I rebooted the device
after a day).


Folkert van Heusden

-- 
www.vanheusden.com/multitail - win een vlaai van multivlaai! zorg
ervoor dat multitail opgenomen wordt in Fedora Core, AIX, Solaris of
HP/UX en win een vlaai naar keuze
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-09 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 11:25 f2fs using tons of cpu folkert
2013-10-10  0:28 ` Jaegeuk Kim
2013-11-09 17:29   ` folkert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).