ANDROID: Incremental fs: RCU locks instead of mutex for pending_reads.
Use RCU locks instead of pending_reads_mutex.
Current mutex is taking lock on entire mount_info
structure which seems a heavy operation.
Following fields of mount_info structure
are protected through spinlocks for multiple
writers and are RCU safe for readers:
- reads_list_head
- mi_pending_reads_count
- mi_last_pending_read_number
- data_file_segment.reads_list_head
We could probably use atomic_inc/atomic_dec for
mi_pending_reads_count and mi_last_pending_read_number
which can futher cut down spin_locks at couple of more places,
thereby only the list addition and removal can protected
by spinlock. This CL doesn't address it.
Bug: 161565969
Test: kernel selftest incfs_test and incfs_perf
Signed-off-by:
Akilesh Kailash <akailash@google.com>
Change-Id: Iad7439657016764dce25d64c8b3df69b930452bc
Loading
Please register or sign in to comment