Skip to content

Commit

Permalink
time res
Browse files Browse the repository at this point in the history
Signed-off-by: George Amanakis <[email protected]>
  • Loading branch information
gamanakis committed Aug 29, 2023
1 parent 0b5dacd commit 2b7322f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9172,6 +9172,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
headroom = (headroom * l2arc_headroom_boost) / 100;

uint64_t i = 0;
#ifdef _KERNEL
/*
* Sweeping the full buf cache takes about 1.5-3 secs on a machine
* with 8Gb RAM.
*/
hrtime_t start, end;
start = gethrtime();
#endif
for (i = 0; ;i++) {
kmutex_t *hash_lock;
abd_t *to_write = NULL;
Expand Down Expand Up @@ -9344,6 +9352,10 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)

zio_nowait(wzio);
}
#ifdef _KERNEL
end = gethrtime();
cmn_err(CE_NOTE, "time: %llu", end-start);
#endif

/* No buffers selected for writing? */
if (pio == NULL) {
Expand Down

0 comments on commit 2b7322f

Please sign in to comment.