Re: mds sync wrlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,Gregory
now, we test the ceph 0.30, and get the same result.
steps are:
we mount ceph on /mnt/test/
then create dir "/mnt/test/a/b/"
1) in dir "b" , use "seq 3000|xargs -i mkdir {}" to create 3000 dirs
2) and at some time,make a directory "c" in "a"
from the mds debug log:

 2011-06-29 05:44:19.368961 7f7a0b421700 mds0.locker wrlock_start
waiting on (inest lock->sync w=1 dirty flushing) on [inode 10000000000
[...2,head] /a/ auth v18 pv20 ap=312 f(v0 m2011-06-29 05:44:15.550665
2=0+2) n(v0 rc2011-06-29 05:44:15.550665 1934=0+1934) (iauth sync r=1)
(isnap sync r=1) (inest lock->sync w=1 dirty flushing) (ifile excl
w=1) (ixattr excl) (iversion lock) caps={4099=pAsLsXsxFsx/-@10},l=4099
| dirtyscattered lock dirfrag caps dirty authpin 0x14c97e0]

we find:
the dir "a" was locked when we create dirs below dir "b"
in function predirty_journal_parents (in MDCache.cc ), the flag "stop"
was marked true,so we got the message "predirty_journal_parents stop.
marking nestlock on".
 step 1) got a lock of dir "a", it type is  CEPH_LOCK_INEST , it name
is " sync "
and the value of  this lock is "inest lock->sync w=1 dirty flushing".

i want to know:
why  it got the wrlock of dir "a" when creates dirs below dir "b" ?

thanks!


2011/6/28 Gregory Farnum <gregory.farnum@xxxxxxxxxxxxx>:
> On Jun 27, 2011, at 4:53 AM, huang jun wrote:
>
>> hi,all
>> now,we test the directory operation in ceph,and found follow phenomenons:
>> we mount ceph on /mnt/test/
>> then create dir "/mnt/test/a/b/"
>> 1) in dir "b" , use "seq 3000|xargs -i mkdir {}" to create 3000 dirs
>> 2) and at some time,make a directory "c" in "a"
>> then step 2) returns very slow,from the debug log,we got :
>> step 2) will block  until  step 1)  finished
>> because  step 2) need a sync wrlock of dir "a", but step 1) got the
>> wrlock in predirectory_journal_parents function
>> until it finished works .
>> so i have few questions:
>>  a) why step 1)  got the wrlock of dir "a" ? I think it should just
>> hold the wrlock of dir "b",but not dir "a".
>>  b) why circularly judge the  variable "stop" value  of all the
>> parent directory of dir "b" ?
>
> Hmm. Which locks specifically are getting wrlock'ed in dir a? In general it shouldn't be taking locks there to make files in dir b, although it can happen in various circumstances for certain of the locks.
>
> Also, what versions are you using of the server code and your client?
> -Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux