Searched hist:a569469e967022d9ceeaa4b73619f96614087d2d (Results 1 – 5 of 5) sorted by relevance
/openbmc/linux/fs/f2fs/ |
H A D | inode.c | diff a569469e967022d9ceeaa4b73619f96614087d2d Mon Aug 05 07:02:04 CDT 2013 Jin Xu <jinuxstyle@gmail.com> f2fs: fix a deadlock in fsync
This patch fixes a deadlock bug that occurs quite often when there are concurrent write and fsync on a same file.
Following is the simplified call trace when tasks get hung.
fsync thread: - f2fs_sync_file ... - f2fs_write_data_pages ... - update_extent_cache ... - update_inode - wait_on_page_writeback
bdi writeback thread - __writeback_single_inode - f2fs_write_data_pages - mutex_lock(sbi->writepages)
The deadlock happens when the fsync thread waits on a inode page that has been added to the f2fs' cached bio sbi->bio[NODE], and unfortunately, no one else could be able to submit the cached bio to block layer for writeback. This is because the fsync thread already hold a sbi->fs_lock and the sbi->writepages lock, causing the bdi thread being blocked when attempt to write data pages for the same inode. At the same time, f2fs_gc thread does not notice the situation and could not help. Even the sync syscall gets blocked.
To fix it, we could submit the cached bio first before waiting on a inode page that is being written back.
Signed-off-by: Jin Xu <jinuxstyle@gmail.com> [Jaegeuk Kim: add more cases to use f2fs_wait_on_page_writeback] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
H A D | gc.c | diff a569469e967022d9ceeaa4b73619f96614087d2d Mon Aug 05 07:02:04 CDT 2013 Jin Xu <jinuxstyle@gmail.com> f2fs: fix a deadlock in fsync
This patch fixes a deadlock bug that occurs quite often when there are concurrent write and fsync on a same file.
Following is the simplified call trace when tasks get hung.
fsync thread: - f2fs_sync_file ... - f2fs_write_data_pages ... - update_extent_cache ... - update_inode - wait_on_page_writeback
bdi writeback thread - __writeback_single_inode - f2fs_write_data_pages - mutex_lock(sbi->writepages)
The deadlock happens when the fsync thread waits on a inode page that has been added to the f2fs' cached bio sbi->bio[NODE], and unfortunately, no one else could be able to submit the cached bio to block layer for writeback. This is because the fsync thread already hold a sbi->fs_lock and the sbi->writepages lock, causing the bdi thread being blocked when attempt to write data pages for the same inode. At the same time, f2fs_gc thread does not notice the situation and could not help. Even the sync syscall gets blocked.
To fix it, we could submit the cached bio first before waiting on a inode page that is being written back.
Signed-off-by: Jin Xu <jinuxstyle@gmail.com> [Jaegeuk Kim: add more cases to use f2fs_wait_on_page_writeback] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
H A D | segment.c | diff a569469e967022d9ceeaa4b73619f96614087d2d Mon Aug 05 07:02:04 CDT 2013 Jin Xu <jinuxstyle@gmail.com> f2fs: fix a deadlock in fsync
This patch fixes a deadlock bug that occurs quite often when there are concurrent write and fsync on a same file.
Following is the simplified call trace when tasks get hung.
fsync thread: - f2fs_sync_file ... - f2fs_write_data_pages ... - update_extent_cache ... - update_inode - wait_on_page_writeback
bdi writeback thread - __writeback_single_inode - f2fs_write_data_pages - mutex_lock(sbi->writepages)
The deadlock happens when the fsync thread waits on a inode page that has been added to the f2fs' cached bio sbi->bio[NODE], and unfortunately, no one else could be able to submit the cached bio to block layer for writeback. This is because the fsync thread already hold a sbi->fs_lock and the sbi->writepages lock, causing the bdi thread being blocked when attempt to write data pages for the same inode. At the same time, f2fs_gc thread does not notice the situation and could not help. Even the sync syscall gets blocked.
To fix it, we could submit the cached bio first before waiting on a inode page that is being written back.
Signed-off-by: Jin Xu <jinuxstyle@gmail.com> [Jaegeuk Kim: add more cases to use f2fs_wait_on_page_writeback] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
H A D | data.c | diff a569469e967022d9ceeaa4b73619f96614087d2d Mon Aug 05 07:02:04 CDT 2013 Jin Xu <jinuxstyle@gmail.com> f2fs: fix a deadlock in fsync
This patch fixes a deadlock bug that occurs quite often when there are concurrent write and fsync on a same file.
Following is the simplified call trace when tasks get hung.
fsync thread: - f2fs_sync_file ... - f2fs_write_data_pages ... - update_extent_cache ... - update_inode - wait_on_page_writeback
bdi writeback thread - __writeback_single_inode - f2fs_write_data_pages - mutex_lock(sbi->writepages)
The deadlock happens when the fsync thread waits on a inode page that has been added to the f2fs' cached bio sbi->bio[NODE], and unfortunately, no one else could be able to submit the cached bio to block layer for writeback. This is because the fsync thread already hold a sbi->fs_lock and the sbi->writepages lock, causing the bdi thread being blocked when attempt to write data pages for the same inode. At the same time, f2fs_gc thread does not notice the situation and could not help. Even the sync syscall gets blocked.
To fix it, we could submit the cached bio first before waiting on a inode page that is being written back.
Signed-off-by: Jin Xu <jinuxstyle@gmail.com> [Jaegeuk Kim: add more cases to use f2fs_wait_on_page_writeback] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
H A D | f2fs.h | diff a569469e967022d9ceeaa4b73619f96614087d2d Mon Aug 05 07:02:04 CDT 2013 Jin Xu <jinuxstyle@gmail.com> f2fs: fix a deadlock in fsync
This patch fixes a deadlock bug that occurs quite often when there are concurrent write and fsync on a same file.
Following is the simplified call trace when tasks get hung.
fsync thread: - f2fs_sync_file ... - f2fs_write_data_pages ... - update_extent_cache ... - update_inode - wait_on_page_writeback
bdi writeback thread - __writeback_single_inode - f2fs_write_data_pages - mutex_lock(sbi->writepages)
The deadlock happens when the fsync thread waits on a inode page that has been added to the f2fs' cached bio sbi->bio[NODE], and unfortunately, no one else could be able to submit the cached bio to block layer for writeback. This is because the fsync thread already hold a sbi->fs_lock and the sbi->writepages lock, causing the bdi thread being blocked when attempt to write data pages for the same inode. At the same time, f2fs_gc thread does not notice the situation and could not help. Even the sync syscall gets blocked.
To fix it, we could submit the cached bio first before waiting on a inode page that is being written back.
Signed-off-by: Jin Xu <jinuxstyle@gmail.com> [Jaegeuk Kim: add more cases to use f2fs_wait_on_page_writeback] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|