]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ceph: use vfs __set_page_dirty_nobuffers interface instead of doing it inside filesystem
authorSha Zhengju <handai.szj@taobao.com>
Wed, 21 Aug 2013 08:27:34 +0000 (16:27 +0800)
committerSage Weil <sage@inktank.com>
Tue, 27 Aug 2013 23:29:44 +0000 (16:29 -0700)
commit7d6e1f5461d0c16eb6aa8d226976995856d85e4e
treeb85d1758b3969499ff993bac4b16962f442fd559
parentee7289bfadda5f4ef60884547ebc9989c8fb314a
ceph: use vfs __set_page_dirty_nobuffers interface instead of doing it inside filesystem

Following we will begin to add memcg dirty page accounting around
__set_page_dirty_{buffers,nobuffers} in vfs layer, so we'd better use vfs interface to
avoid exporting those details to filesystems.

Since vfs set_page_dirty() should be called under page lock, here we don't need elaborate
codes to handle racy anymore, and two WARN_ON() are added to detect such exceptions.
Thanks very much for Sage and Yan Zheng's coaching!

I tested it in a two server's ceph environment that one is client and the other is
mds/osd/mon, and run the following fsx test from xfstests:

  ./fsx   1MB -N 50000 -p 10000 -l 1048576
  ./fsx  10MB -N 50000 -p 10000 -l 10485760
  ./fsx 100MB -N 50000 -p 10000 -l 104857600

The fsx does lots of mmap-read/mmap-write/truncate operations and the tests completed
successfully without triggering any of WARN_ON.

Signed-off-by: Sha Zhengju <handai.szj@taobao.com>
Reviewed-by: Sage Weil <sage@inktank.com>
fs/ceph/addr.c