<div dir="ltr">No, these were empty files. It wasn't an inode limit because I could still create files in other directories.<div><br></div><div>Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 10, 2018 at 10:35 AM, Fangrui Song <span dir="ltr"><<a href="mailto:maskray@google.com" target="_blank">maskray@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2018-04-09, Peter Collingbourne wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you sure about that? I'm pretty sure that before writing that comment I<br>
wrote a small program that created lots of files (not subdirectories) in a<br>
directory until it started getting error messages, which started happening at<br>
around 6000000 files.<br>
<br>
Peter<br>
</blockquote>
<br></span>
I guess you created a file of 100GiB. The number of inodes is roughly 6553600.<br>
<br>
100*1024*1024*1024 / 16384 = 6553600.0 where 16384 is the default bytes-per-inode (man mke2fs).<br>
<br>
% truncate -s 100G 100G<br>
% mkfs.ext4 100G<br>
% dumpe2fs 100G<br>
.....<br>
Inode count:              6553600<br>
.....<br>
<br>
Each file consumes one inode and the number of files in that directory<br>
is limited by this factor.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Mon, Apr 9, 2018 at 5:12 PM, Fangrui Song via llvm-commits <<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
<br>
   Author: maskray<br>
   Date: Mon Apr  9 17:12:28 2018<br>
   New Revision: 329648<br>
<br>
   URL: <a href="http://llvm.org/viewvc/llvm-project?rev=329648&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=329648&view=rev</a><br>
   Log:<br>
   [CachePruning] Fix comment about ext4 per-directory file limit. NFC<br>
<br>
   There is a limit on number of subdirectories if dir_nlinks is not<br>
   enabled (31998), but per-directory number of files is not limited.<br>
<br>
   Modified:<br>
       llvm/trunk/include/llvm/Suppor<wbr>t/CachePruning.h<br>
<br>
   Modified: llvm/trunk/include/llvm/Suppor<wbr>t/CachePruning.h<br>
   URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>Support/</a><br>
   CachePruning.h?rev=329648&r1=<wbr>329647&r2=329648&view=diff<br>
   =============================<wbr>==============================<wbr>================<br>
   ===<br>
   --- llvm/trunk/include/llvm/Suppor<wbr>t/CachePruning.h (original)<br>
   +++ llvm/trunk/include/llvm/Suppor<wbr>t/CachePruning.h Mon Apr  9 17:12:28 2018<br>
   @@ -52,9 +52,8 @@ struct CachePruningPolicy {<br>
      /// the number of files based pruning.<br>
      ///<br>
      /// This defaults to 1000000 because with that many files there are<br>
   -  /// diminishing returns on the effectiveness of the cache, and some file<br>
   -  /// systems have a limit on how many files can be contained in a<br>
   directory<br>
   -  /// (notably ext4, which is limited to around 6000000 files).<br>
   +  /// diminishing returns on the effectiveness of the cache, and file<br>
   +  /// systems have a limit on total number of files.<br>
      uint64_t MaxSizeFiles = 1000000;<br>
    };<br>
<br>
   _____________________________<wbr>__________________<br>
   llvm-commits mailing list<br>
   <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
   <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/llvm-<wbr>commits</a><br>
<br>
--<br>
-- <br>
Peter<br>
</blockquote>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
宋方睿<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div>