aboutsummaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2023-03-01 21:47:08 +0100
committerDavid Sterba <dsterba@suse.com>2023-04-17 18:01:17 +0200
commit0b5485391deff35c6633d7cbff5cf3a8229fbe9e (patch)
treeffb1add40aa5cff2b52b3db39e9061bc61dd2b95 /arch/mips
parentce4cf3793e72a4ca2eeebc5db5d04f25b42a59db (diff)
btrfs: locking: use atomic for DREW lock writers
The DREW lock uses percpu variable to track lock counters and for that it needs to allocate the structure. In btrfs_read_tree_root() or btrfs_init_fs_root() this may add another error case or requires the NOFS scope protection. One way is to preallocate the structure as was suggested in https://lore.kernel.org/linux-btrfs/20221214021125.28289-1-robbieko@synology.com/ We may avoid the allocation altogether if we don't use the percpu variables but an atomic for the writer counter. This should not make any difference, the DREW lock is used for truncate and NOCOW writes along with other IO operations. The percpu counter for writers has been there since the original commit 8257b2dc3c1a1057 "Btrfs: introduce btrfs_{start, end}_nocow_write() for each subvolume". The reason could be to avoid hammering the same cacheline from all the readers but then the writers do that anyway. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'arch/mips')
0 files changed, 0 insertions, 0 deletions