write file to stroage trigger kernel warning

时间:2021-08-07 05:23:38

when you write large files  to extern stroage, the kernel may have as follow context:

[ 4560.236385] INFO: task sync:1036 blocked for more than 120 seconds.
[ 4560.236389] Not tainted 4.4.0-21-generic #37-Ubuntu
[ 4560.236390] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 4560.236391] sync D ffff880065aafdd8 0 1036 869 0x00000000
[ 4560.236394] ffff880065aafdd8 ffff8800b83a6650 ffff8801b73b2940 ffff880034938dc0
[ 4560.236396] ffff880065ab0000 ffff8800b83a6680 ffff8800b83a6330 ffff880065aafe64
[ 4560.236397] ffffffff81240470 ffff880065aafdf0 ffffffff818203f5 ffff880065aafe64
[ 4560.236398] Call Trace:
[ 4560.236404] [<ffffffff81240470>] ? SyS_tee+0x3e0/0x3e0
[ 4560.236407] [<ffffffff818203f5>] schedule+0x35/0x80
[ 4560.236430] [<ffffffff81236788>] wb_wait_for_completion+0x58/0xa0
[ 4560.236433] [<ffffffff810c3a10>] ? wake_atomic_t_function+0x60/0x60
[ 4560.236434] [<ffffffff81239e23>] sync_inodes_sb+0xa3/0x1f0
[ 4560.236436] [<ffffffff81240470>] ? SyS_tee+0x3e0/0x3e0
[ 4560.236437] [<ffffffff81240485>] sync_inodes_one_sb+0x15/0x20
[ 4560.236440] [<ffffffff812100b9>] iterate_supers+0xb9/0x110
[ 4560.236442] [<ffffffff812407e4>] sys_sync+0x44/0xb0
[ 4560.236443] [<ffffffff818244f2>] entry_SYSCALL_64_fastpath+0x16/0x71

why happen:

  normal, it not direct I/O when write file to extern stroage,

  it will to write to cache, when the cache up to forty percent of the memory capacity

  it will trigger flush to extern stroage, it depend your system configure.

  so subject to I/O performance, system unable compelte  synchronization  in 120 seconds

  kernel will upraised warning message.