vilobh meshram
2011-May-05 06:37 UTC
[Lustre-discuss] Question on path name resolution in Lustre
Hi, I have noticed that for file or directory kind of operation in Lustre, the Lock Manager grabs an EX (Exclusive lock) on the parent directory and then creates a directory or file inside it.Is there a specific reason behind this logic or implementation. e.g. : If we want to create foo.txt in /d1/d2/d3/d4/d5/foo.txt We grab the lock on /d1 then we grab the lock on /d1/d2 then we grab the lock on /d1/d2/d3 then we grab the lock on /d1/d2/d3/d4 then we grab the lock on /d1/d2/d3/d4/d5 then we create the file. This is what I have seen in logs. Is this the correct method followed during first time file access or file creation ? If yes then how is the performance when the directory depth is very high ? If no can you explain me how it happens. Thanks, Vilobh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lustre.org/pipermail/lustre-discuss/attachments/20110505/cd77b3cf/attachment.html
vilobh meshram
2011-May-05 06:57 UTC
[Lustre-devel] Fwd: Question on path name resolution in Lustre
---------- Forwarded message ---------- From: vilobh meshram <meshram.vilobh at gmail.com> Date: Thu, May 5, 2011 at 2:37 AM Subject: Question on path name resolution in Lustre To: lustre-discuss <lustre-discuss at lists.lustre.org>, lusre-devel at lists.lustre.org Hi, I have noticed that for file or directory kind of operation in Lustre, the Lock Manager grabs an EX (Exclusive lock) on the parent directory and then creates a directory or file inside it.Is there a specific reason behind this logic or implementation. e.g. : If we want to create foo.txt in /d1/d2/d3/d4/d5/foo.txt We grab the lock on /d1 then we grab the lock on /d1/d2 then we grab the lock on /d1/d2/d3 then we grab the lock on /d1/d2/d3/d4 then we grab the lock on /d1/d2/d3/d4/d5 then we create the file. This is what I have seen in logs. Is this the correct method followed during first time file access or file creation ? If yes then how is the performance when the directory depth is very high ? If no can you explain me how it happens. Thanks, Vilobh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lustre.org/pipermail/lustre-devel/attachments/20110505/65724222/attachment.html
Oleg Drokin
2011-May-05 15:56 UTC
[Lustre-discuss] Question on path name resolution in Lustre
Hello! On May 5, 2011, at 2:37 AM, vilobh meshram wrote:> I have noticed that for file or directory kind of operation in Lustre, the Lock Manager grabs an EX (Exclusive lock) on the parent directory and then creates a directory or file inside it.Is there a specific reason behind this logic or implementation. > > e.g. : If we want to create foo.txt in /d1/d2/d3/d4/d5/foo.txt > > We grab the lock on /d1 > then we grab the lock on /d1/d2 > then we grab the lock on /d1/d2/d3 > then we grab the lock on /d1/d2/d3/d4 > then we grab the lock on /d1/d2/d3/d4/d5 > then we create the file. > This is what I have seen in logs.In fact the EX lock is taken only on d5 in this scenario, and then only on "UPDATE" bit.> Is this the correct method followed during first time file access or file creation ? > > If yes then how is the performance when the directory depth is very high ?If client is unaware of the tree (ie. it is not yet cached on the client), then there is no way but to traverse the tree first. Of course it is slower if we do it one component per RPC instead of just whole path in one RPC, but it has other advantages like checking local for mountpoints first and not breaking Linux VFS assumptions too badly. Bye, Oleg