linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xs_ig_attempts ≠ xs_ig_found + xs_ig_missed
@ 2021-08-26  8:36 Paul Menzel
  2021-08-26 21:17 ` Dave Chinner
  2021-08-27  6:22 ` xs_ig_attempts ??? " Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Menzel @ 2021-08-26  8:36 UTC (permalink / raw)
  To: linux-xfs

Dear Linux folks,


In the internal statistics [1] the attempts to look up an inode in the 
inode cache (`xs_ig_attempts`) is a little bigger (35) than the sum of 
found and missed entries minus duplicates (`xfs.inode_ops.ig_dup`): 
651067226 = 651067191 + 35 > 651067191 = 259143798 + 391923706 - 313.

     $ grep ^ig /sys/fs/xfs/sdc/stats/stats # hardware RAID
     ig 651067226 259143798 75 391923706 313 391196609 8760483

For the software RAID device there is no difference: 794085909 = 
293058663 + 501027325 - 79.

     $ grep ^ig /sys/fs/xfs/md0/stats/stats
     ig 794085909 293058663 18555 501027325 79 500997366 320679

Is the first difference expected?


Kind regards,

Paul


[1]: https://xfs.org/index.php/Runtime_Stats#ig

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xs_ig_attempts ≠ xs_ig_found + xs_ig_missed
  2021-08-26  8:36 xs_ig_attempts ≠ xs_ig_found + xs_ig_missed Paul Menzel
@ 2021-08-26 21:17 ` Dave Chinner
  2021-08-27  6:22 ` xs_ig_attempts ??? " Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2021-08-26 21:17 UTC (permalink / raw)
  To: Paul Menzel; +Cc: linux-xfs

On Thu, Aug 26, 2021 at 10:36:41AM +0200, Paul Menzel wrote:
> Dear Linux folks,
> 
> 
> In the internal statistics [1] the attempts to look up an inode in the inode
> cache (`xs_ig_attempts`) is a little bigger (35) than the sum of found and
> missed entries minus duplicates (`xfs.inode_ops.ig_dup`): 651067226 =
> 651067191 + 35 > 651067191 = 259143798 + 391923706 - 313.
> 
>     $ grep ^ig /sys/fs/xfs/sdc/stats/stats # hardware RAID
>     ig 651067226 259143798 75 391923706 313 391196609 8760483
> 
> For the software RAID device there is no difference: 794085909 = 293058663 +
> 501027325 - 79.
> 
>     $ grep ^ig /sys/fs/xfs/md0/stats/stats
>     ig 794085909 293058663 18555 501027325 79 500997366 320679
> 
> Is the first difference expected?

Yes. XFS stats are low overhead unsynchronised per-cpu counters,
never guaranteed to be perfectly accurate or consistent because,
well, unsycnhronised per-cpu counters are neither.

IOWs, individual counters are never "point in time" accurate because of
counter update races during aggregation. Multiple counters are never
"point in time" synchronised, either, as individual
counters are aggregated sequentially and hence have different,
unsynchronised sampling times.

IOWs, the stats are not really meaningful as aboslute values - they
are generally used for monitoring purposes via delta sampling (e.g.
"how many of these events happened in the last second") or checking
that certain operations have occurred as a basic code coverage check
for developers (e.g. did we split the freespace inode btree at all
during a fstests run?).....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xs_ig_attempts ??? xs_ig_found + xs_ig_missed
  2021-08-26  8:36 xs_ig_attempts ≠ xs_ig_found + xs_ig_missed Paul Menzel
  2021-08-26 21:17 ` Dave Chinner
@ 2021-08-27  6:22 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-08-27  6:22 UTC (permalink / raw)
  To: Paul Menzel; +Cc: linux-xfs

On Thu, Aug 26, 2021 at 10:36:41AM +0200, Paul Menzel wrote:
> Dear Linux folks,
> 
> 
> In the internal statistics [1] the attempts to look up an inode in the inode
> cache (`xs_ig_attempts`) is a little bigger (35) than the sum of found and
> missed entries minus duplicates (`xfs.inode_ops.ig_dup`): 651067226 =
> 651067191 + 35 > 651067191 = 259143798 + 391923706 - 313.

In addition to the explanation about the counters from data:  all error
returns are also not counted, as well as the case where an
XFS_IGET_INCORE lookup did not find the inode cached.  The latter
would make sense to be included in a missed counter, but it looks like
the counter is more intended to count when an inode is actually read
from disk.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-27  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  8:36 xs_ig_attempts ≠ xs_ig_found + xs_ig_missed Paul Menzel
2021-08-26 21:17 ` Dave Chinner
2021-08-27  6:22 ` xs_ig_attempts ??? " Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).