Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle block I/O events that are not reads or writes #252

Open
cvonelm opened this issue Mar 13, 2023 · 1 comment
Open

Handle block I/O events that are not reads or writes #252

cvonelm opened this issue Mar 13, 2023 · 1 comment

Comments

@cvonelm
Copy link
Member

cvonelm commented Mar 13, 2023

Besides events that indicate the start and end of read and write operations, the block I/O subsystem gives out information about additional events, such as hard drive buffer cache flushes and so on.

Currently, those get ignored by lo2s because they , depending on the disk type, seldomly, if ever, occur. However, it would still be nice to be able to measure them.

@cvonelm
Copy link
Member Author

cvonelm commented Apr 4, 2023

This is all the information the kernel gives us about events

 static void fill_rwbs(char *rwbs, const struct blk_io_trace *t)
 {
     int i = 0;
     int tc = t->action >> BLK_TC_SHIFT;
 
     if ((t->action & ~__BLK_TN_CGROUP) == BLK_TN_MESSAGE) {
         rwbs[i++] = 'N';
         goto out;
     }
 
     if (tc & BLK_TC_FLUSH)
         rwbs[i++] = 'F';
 
     if (tc & BLK_TC_DISCARD) 
         rwbs[i++] = 'D';
     else if (tc & BLK_TC_WRITE)
         rwbs[i++] = 'W';
     else if (t->bytes) 
         rwbs[i++] = 'R'; 
     else
         rwbs[i++] = 'N';
         
     if (tc & BLK_TC_FUA)
         rwbs[i++] = 'F';
     if (tc & BLK_TC_AHEAD)
         rwbs[i++] = 'A';
     if (tc & BLK_TC_SYNC)
         rwbs[i++] = 'S';
     if (tc & BLK_TC_META)
         rwbs[i++] = 'M';
 out:
     rwbs[i] = '\0';
 }

R and W are read and write respectively.

N is none, so it can be safely discarded

F is flushes, which can be mapped to the flush type otf2 provides. FUA (force unit access) is a more fine-grained flush, so it can be mapped to flush too.

D is for discard. Solid state drives need to know which blocks are not in use currently to be able to do wear levelling. However, this operation does not map to any otf2 concept

A is for readahead. This would be really nice to be able to measure, but there is no nice otf2 concept this maps to and secondly I have not encountered this event type yet

S is for synchronous operation and M for metadata. I haven't encountered those types either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant