diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-08-31 13:56:05 +0300 | 
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-09-05 20:50:22 +0300 | 
| commit | edd748e6c8e824a8281f8a8450f12c4a95ec61ee (patch) | |
| tree | 69d2f53faab82737599b1c93534721c716f214ff /tools/perf/util/scripting-engines/trace-event-python.c | |
| parent | 025d63a486aad611b20fa39184fc86e4b76d260e (diff) | |
| download | linux-edd748e6c8e824a8281f8a8450f12c4a95ec61ee.tar.xz | |
f2fs: avoid race in between atomic_read & atomic_inc
Previously, we will miss merging flush command during fsync due to below
race condition:
Thread A 		Thread B		Thread C
- f2fs_issue_flush
 - atomic_read(&issing_flush)
			- f2fs_issue_flush
			 - atomic_read(&issing_flush)
						- f2fs_issue_flush
						 - atomic_read(&issing_flush)
  - atomic_inc(&issing_flush)
			  - atomic_inc(&issing_flush)
						  - atomic_inc(&issing_flush)
   - submit_flush_wait
			   - submit_flush_wait
						   - submit_flush_wait
It needs to use atomic_inc_return instead to avoid such race.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions
