<font size=2 face="sans-serif">Aaron, brilliant! Your example is close
to the worst case, where every file is 512K+1 bytes and the blocksize is
1024K.<br>Yes, in the worse case 49.99999% of space is &quot;lost&quot; or wasted.
&nbsp;Don't do that!</font><br><br><font size=2 face="sans-serif">One can construct such a worst case
for any system that allocates by blocks or sectors or whatever you want
to call it.</font><br><font size=2 face="sans-serif">Just fill the system with files that
are each 0.5*Block_Size+1 bytes and argue that 1/2 the space is wasted.</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Aaron Knister &lt;aaron.s.knister@nasa.gov&gt;</font><br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">&lt;gpfsug-discuss@spectrumscale.org&gt;</font><br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">11/06/2017 12:10 AM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [gpfsug-discuss]
file layout API + file fragmentation</font><br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">gpfsug-discuss-bounces@spectrumscale.org</font><br><hr noshade><br><br><br><tt><font size=2>Thanks, Frank!<br><br>That's truly fascinating and has some interesting implications that I<br>hadn't thought of before. I just ran a test on an ~8G fs with a block<br>size of 1M:<br><br>for i in `seq 1 100000`; do<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
dd if=/dev/zero of=foofile${i} bs=520K count=1<br>done<br><br>The fs is &quot;full&quot; according to df/mmdf but there's 3.6G left in
subblocks<br>but yeah, I can't allocate any new files that wouldn't fit into the<br>inode and I can't seem to allocate any new subblocks to existing files<br>(e.g. append).<br><br>What's interesting is if I do the same exercise but with a file size of<br>30K or even 260K I don't seem to run into the same issue. I'm not sure
I<br>understand that yet.<br><br>I was curious about what this meant in the case of appending to a file<br>where the last offset in the file was allocated to a fragment. By<br>looking at &quot;tsdbfs listda&quot; and appending to a file I could see
that the<br>last DA would change (presumably to point to the DA of the start of a<br>contiguous subblock) once the amount of data appended caused the file<br>size to exceed the space available in the trailing subblocks.<br><br>-Aaron<br><br><br>On 11/5/17 7:57 PM, Frank Schmuck wrote:<br>&gt; In GPFS blocks within a file are never fragmented.&nbsp; For example,
if you<br>&gt; have a file of size 7.3 MB and your file system block size is 1MB,
then<br>&gt; this file will be made up of 7 full blocks and one fragment of size
320k<br>&gt; (10 subblocks).&nbsp; Each of the 7 full blocks will be contiguous
on a singe<br>&gt; diks (LUN) behind a single NSD server.&nbsp; The fragment that makes
up the<br>&gt; last part of the file will also be contiguous on a single disk, just<br>&gt; shorter than a full block.<br>&gt; &nbsp;<br>&gt; Frank Schmuck<br>&gt; IBM Almaden Research Center<br>&gt; &nbsp;<br>&gt; &nbsp;<br>&gt; <br>&gt; &nbsp; &nbsp; ----- Original message -----<br>&gt; &nbsp; &nbsp; From: Aaron Knister &lt;aaron.s.knister@nasa.gov&gt;<br>&gt; &nbsp; &nbsp; Sent by: gpfsug-discuss-bounces@spectrumscale.org<br>&gt; &nbsp; &nbsp; To: &lt;gpfsug-discuss@spectrumscale.org&gt;<br>&gt; &nbsp; &nbsp; Cc:<br>&gt; &nbsp; &nbsp; Subject: Re: [gpfsug-discuss] file layout API + file
fragmentation<br>&gt; &nbsp; &nbsp; Date: Sun, Nov 5, 2017 3:39 PM<br>&gt; &nbsp; &nbsp; &nbsp;<br>&gt; &nbsp; &nbsp; Thanks Marc, that helps. I can't easily use tsdbfs for
what I'm working<br>&gt; &nbsp; &nbsp; on since it needs to be run as unprivileged users.<br>&gt; <br>&gt; &nbsp; &nbsp; Perhaps I'm not asking the right question. I'm wondering
how the file<br>&gt; &nbsp; &nbsp; layout api behaves if a given &quot;block&quot;-aligned
offset in a file is made<br>&gt; &nbsp; &nbsp; up of sub-blocks/fragments that are not all on the same
NSD. The<br>&gt; &nbsp; &nbsp; assumption based on how I've seen the API used so far
is that all<br>&gt; &nbsp; &nbsp; sub-blocks within a block at a given offset within a
file are all on the<br>&gt; &nbsp; &nbsp; same NSD.<br>&gt; <br>&gt; &nbsp; &nbsp; -Aaron<br>&gt; <br>&gt; &nbsp; &nbsp; On 11/5/17 6:01 PM, Marc A Kaplan wrote:<br>&gt; &nbsp; &nbsp; &gt; I googled GPFS_FCNTL_GET_DATABLKDISKIDX<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; and found this discussion:<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &nbsp;</font></tt><a href="https://www.ibm.com/developerworks/community/forums/html/topic?id=db48b190-4f2f-4e24-a035-25d3e2b06b2d&amp;ps=50"><tt><font size=2>https://www.ibm.com/developerworks/community/forums/html/topic?id=db48b190-4f2f-4e24-a035-25d3e2b06b2d&amp;ps=50</font></tt></a><tt><font size=2><br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; In general, GPFS files ARE deliberately &quot;fragmented&quot;
but we don't say<br>&gt; &nbsp; &nbsp; &gt; that - we say they are &quot;striped&quot; over
many disks -- and that is<br>&gt; &nbsp; &nbsp; &gt; generally a good thing for parallel performance.<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; Also, in GPFS, if the last would-be block of a
file is less than a<br>&gt; &nbsp; &nbsp; &gt; block, then it is stored in a &quot;fragment&quot;
of a block. &nbsp;<br>&gt; &nbsp; &nbsp; &gt; So you see we use &quot;fragment&quot; to mean
something different than<br>&gt; &nbsp; &nbsp; other file<br>&gt; &nbsp; &nbsp; &gt; systems you may know.<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; --marc<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; From: &nbsp; &nbsp; &nbsp; &nbsp;Aaron Knister
&lt;aaron.s.knister@nasa.gov&gt;<br>&gt; &nbsp; &nbsp; &gt; To: &nbsp; &nbsp; &nbsp; &nbsp;gpfsug main
discussion list<br>&gt; &nbsp; &nbsp; &lt;gpfsug-discuss@spectrumscale.org&gt;<br>&gt; &nbsp; &nbsp; &gt; Date: &nbsp; &nbsp; &nbsp; &nbsp;11/04/2017
12:22 PM<br>&gt; &nbsp; &nbsp; &gt; Subject: &nbsp; &nbsp; &nbsp; &nbsp;[gpfsug-discuss]
file layout API + file<br>&gt; &nbsp; &nbsp; fragmentation<br>&gt; &nbsp; &nbsp; &gt; Sent by: &nbsp; &nbsp; &nbsp; &nbsp;gpfsug-discuss-bounces@spectrumscale.org<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; ------------------------------------------------------------------------<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; I've got a question about the file layout API and
how it reacts in the<br>&gt; &nbsp; &nbsp; &gt; case of fragmented files.<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; I'm using the GPFS_FCNTL_GET_DATABLKDISKIDX structure
and have<br>&gt; &nbsp; &nbsp; some code<br>&gt; &nbsp; &nbsp; &gt; based on tsGetDataBlk.C. I'm basing the block size
based off of what's<br>&gt; &nbsp; &nbsp; &gt; returned by filemapOut.blockSize but that only
seems to return a<br>&gt; &nbsp; &nbsp; value &gt;<br>&gt; &nbsp; &nbsp; &gt; 0 when filemapIn.startOffset is 0.<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; In a case where a file were to be made up of a
significant number of<br>&gt; &nbsp; &nbsp; &gt; non-contiguous fragments (which... would be awful
in of itself) how<br>&gt; &nbsp; &nbsp; &gt; would this be reported by the file layout API?
Does the interface<br>&gt; &nbsp; &nbsp; &gt; technically just report the disk location information
of the first<br>&gt; &nbsp; &nbsp; block<br>&gt; &nbsp; &nbsp; &gt; of the $blockSize range and assume that it's contiguous?<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; Thanks!<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; -Aaron<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; --<br>&gt; &nbsp; &nbsp; &gt; Aaron Knister<br>&gt; &nbsp; &nbsp; &gt; NASA Center for Climate Simulation (Code 606.2)<br>&gt; &nbsp; &nbsp; &gt; Goddard Space Flight Center<br>&gt; &nbsp; &nbsp; &gt; (301) 286-2776<br>&gt; &nbsp; &nbsp; &gt; _______________________________________________<br>&gt; &nbsp; &nbsp; &gt; gpfsug-discuss mailing list<br>&gt; &nbsp; &nbsp; &gt; gpfsug-discuss at spectrumscale.org<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwICAg&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=wnR7m6d4urZ_8dM4mkHQjMbFD9xJEeesmJyzt1osCnM&amp;s=-dgGO6O5i1EqWj-8MmzjxJ1Iz2I5gT1aRmtyP44Cvdg&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwICAg&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=wnR7m6d4urZ_8dM4mkHQjMbFD9xJEeesmJyzt1osCnM&amp;s=-dgGO6O5i1EqWj-8MmzjxJ1Iz2I5gT1aRmtyP44Cvdg&amp;e=</font></tt></a><tt><font size=2><br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &gt; _______________________________________________<br>&gt; &nbsp; &nbsp; &gt; gpfsug-discuss mailing list<br>&gt; &nbsp; &nbsp; &gt; gpfsug-discuss at spectrumscale.org<br>&gt; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIF-g&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=ai3ddVzf50ktH78ovGv6NU4O2LZUOWLpiUiggb8lEgA&amp;m=pUdB4fbWLD03ZTAhk9OlpRdIasz628Oa_yG8z8NOjsk&amp;s=kisarJ7IVnyYBx05ZZiGzdwaXnPqNR8UJoywU1OJNRU&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIF-g&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=ai3ddVzf50ktH78ovGv6NU4O2LZUOWLpiUiggb8lEgA&amp;m=pUdB4fbWLD03ZTAhk9OlpRdIasz628Oa_yG8z8NOjsk&amp;s=kisarJ7IVnyYBx05ZZiGzdwaXnPqNR8UJoywU1OJNRU&amp;e=</font></tt></a><tt><font size=2><br>&gt; &nbsp; &nbsp; &gt;<br>&gt; <br>&gt; &nbsp; &nbsp; --<br>&gt; &nbsp; &nbsp; Aaron Knister<br>&gt; &nbsp; &nbsp; NASA Center for Climate Simulation (Code 606.2)<br>&gt; &nbsp; &nbsp; Goddard Space Flight Center<br>&gt; &nbsp; &nbsp; (301) 286-2776<br>&gt; &nbsp; &nbsp; _______________________________________________<br>&gt; &nbsp; &nbsp; gpfsug-discuss mailing list<br>&gt; &nbsp; &nbsp; gpfsug-discuss at spectrumscale.org<br>&gt; &nbsp; &nbsp; </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIF-g&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=ai3ddVzf50ktH78ovGv6NU4O2LZUOWLpiUiggb8lEgA&amp;m=pUdB4fbWLD03ZTAhk9OlpRdIasz628Oa_yG8z8NOjsk&amp;s=kisarJ7IVnyYBx05ZZiGzdwaXnPqNR8UJoywU1OJNRU&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIF-g&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=ai3ddVzf50ktH78ovGv6NU4O2LZUOWLpiUiggb8lEgA&amp;m=pUdB4fbWLD03ZTAhk9OlpRdIasz628Oa_yG8z8NOjsk&amp;s=kisarJ7IVnyYBx05ZZiGzdwaXnPqNR8UJoywU1OJNRU&amp;e=</font></tt></a><tt><font size=2><br>&gt; &nbsp; &nbsp; &nbsp;<br>&gt; <br>&gt; &nbsp;<br>&gt; <br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; gpfsug-discuss mailing list<br>&gt; gpfsug-discuss at spectrumscale.org<br>&gt; </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIGaQ&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=_xM9xVsqOuNiCqn3ikx6ZaaIHChTPhz_8iDmEKoteX4&amp;s=uy462L5sxX_3Mm3Dh824ptJIxtah9LVRPMmyKz1lAdg&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIGaQ&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=_xM9xVsqOuNiCqn3ikx6ZaaIHChTPhz_8iDmEKoteX4&amp;s=uy462L5sxX_3Mm3Dh824ptJIxtah9LVRPMmyKz1lAdg&amp;e=</font></tt></a><tt><font size=2><br>&gt; <br><br>-- <br>Aaron Knister<br>NASA Center for Climate Simulation (Code 606.2)<br>Goddard Space Flight Center<br>(301) 286-2776<br>_______________________________________________<br>gpfsug-discuss mailing list<br>gpfsug-discuss at spectrumscale.org<br></font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIGaQ&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=_xM9xVsqOuNiCqn3ikx6ZaaIHChTPhz_8iDmEKoteX4&amp;s=uy462L5sxX_3Mm3Dh824ptJIxtah9LVRPMmyKz1lAdg&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__gpfsug.org_mailman_listinfo_gpfsug-2Ddiscuss&amp;d=DwIGaQ&amp;c=jf_iaSHvJObTbx-siA1ZOg&amp;r=cvpnBBH0j41aQy0RPiG2xRL_M8mTc1izuQD3_PmtjZ8&amp;m=_xM9xVsqOuNiCqn3ikx6ZaaIHChTPhz_8iDmEKoteX4&amp;s=uy462L5sxX_3Mm3Dh824ptJIxtah9LVRPMmyKz1lAdg&amp;e=</font></tt></a><tt><font size=2><br><br></font></tt><br><br><BR>