<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Sep 11, 2019, at 10:06, Michael Di Domenico &lt;<a href="mailto:mdidomenico4@gmail.com" class="">mdidomenico4@gmail.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On Tue, Sep 10, 2019 at 5:48 PM Andreas Dilger &lt;<a href="mailto:adilger@whamcloud.com" class="">adilger@whamcloud.com</a>&gt; wrote:<br class="">
<blockquote type="cite" class=""><br class="">
I don't think &quot;lfs find -xdev&quot; has never been a priority for Lustre, since it is rare for Lustre filesystems to be<br class="">
mounted in a nested manner. &nbsp;Since people already run multiple &quot;lfs find&quot; tasks in parallel on different<br class="">
clients to get better performance, it isn't hard to run separate tasks from the top-level mountpoint of<br class="">
different filesystems. &nbsp;What is the use case for this?<br class="">
</blockquote>
<br class="">
doesn't xdev keep find from crossing mount points, not necessarily<br class="">
only in a nested manner but also if there's a link to a directory in a<br class="">
different filesystem. &nbsp;i believe 'find' without -xdev will follow and<br class="">
descend. &nbsp;but this predicates that my understanding is sound (which it<br class="">
probably isn't). &nbsp;i generally add -xdev to my finds as a habit to keep<br class="">
from scanning nfs volumes.<br class="">
</div>
</div>
</blockquote>
<div><br class="">
</div>
Yes, -xdev is to avoid crossing mountpoints, but like I wrote it is rare to have nested Lustre</div>
<div>mountpoints, so this wouldn't really be useful in most cases. &nbsp;The find tree walking does</div>
<div>*not* follow symlinks into the target directory, only mountpoints.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">along the same vein, can anyone state whether there's any actual<br class="">
performance gain walking the filesystem using find vs lfs find?<br class="">
<br class="">
For &quot;find&quot; vs. &quot;lfs find&quot; performance, this depends heavily on what the search parameters are. &nbsp;If just<br class="">
the filename, they will be the same. &nbsp;If it includes some MDT-specific attributes (e.g. uid, gid) then<br class="">
&quot;lfs find&quot; can be significantly faster (e.g 3-5x). &nbsp;If it is uses file size, then they will be about the same<br class="">
unless there are other MDT-only parameters, or once LSOM support is landed (hopefully 2.13).<br class="">
</blockquote>
<br class="">
okay, that's what i thought or recalled correctly from hearing<br class="">
somewhere else. &nbsp;in my particular instance i was just using 'find<br class="">
-type f' and didn't see any appreciable difference in scanning speed<br class="">
between the two<br class="">
</div>
</div>
</blockquote>
<br class="">
</div>
<div>For Lustre, ext4, and most other filesystems, the file type is also stored in the directory entry, so that</div>
<div>&quot;find&quot; can determine the type without a &quot;stat&quot;. &nbsp;That is safe since the file type cannot be changed after</div>
<div>the file is created.</div>
<div><br class="">
</div>
<div>In a scan like &quot;(lfs) find -name '*foo*' -type f&quot; it only needs to read the directory entries (including the</div>
<div>file type) and process each entry. &nbsp;There is nothing that &quot;lfs find&quot; can optimize. &nbsp;With mode, uid, gid, and</div>
<div>*some* timestamp queries, &quot;lfs find&quot; can fetch only the MDS attributes and skip any OST RPCs for</div>
<div>that file if the (non)match can be decided without the OST attributes.</div>
<div><br class="">
</div>
<div>Once the Lazy Size-on-MDT (LSOM) integration is finished (<a href="https://review.whamcloud.com/35167" class="">https://review.whamcloud.com/35167</a>) it</div>
<div>will be possible for &quot;lfs find --lazy&quot; to use *only* attributes from the MDS (size, timestamps) to speed</div>
<div>up scanning and avoid OST RPC overhead.</div>
<br class="">
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div>Cheers, Andreas</div>
<div>--</div>
<div>Andreas Dilger</div>
<div>Principal Lustre Architect</div>
<div>Whamcloud</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
</div>
<br class="">
</body>
</html>