I am trying to understand the Linux block layer so I am writing a blog about it: http://www.linuxintro.org/wiki/blktrAce. When calling blktrace like this:

blktrace -d /dev/sdg -o - | blkparse -i -

I see e.g. the output

8,96   4      695   430.080106382  2356  I   N 0 (00 ..) [kworker/4:2]
8,96   3       29   430.082179440    53  D   N 0 (00 ..) [ksoftirqd/3]

I do not understand what this means. According to the man page of blkparse, there is an RWBS field (containing R for read, W for write, B for barrier, D for discard or S for sync). With some experimenting I found out it is the 7th column. However it contains N. What does that mean? Where can I find the info what it means?

2 Answers 2


It appears that there are additional undocumented flags in the RWBS field and that the 'B' for barrier is deprecated. N denotes anything that is not discard, read or write.

D - discard
W - write
R - read
N - None of the above 

A - readahead
S - sync
M - metadata

static inline void fill_rwbs(char *rwbs, struct blk_io_trace *t)
    int w = t->action & BLK_TC_ACT(BLK_TC_WRITE);
    int a = t->action & BLK_TC_ACT(BLK_TC_AHEAD);
    int s = t->action & BLK_TC_ACT(BLK_TC_SYNC);
    int m = t->action & BLK_TC_ACT(BLK_TC_META);
    int d = t->action & BLK_TC_ACT(BLK_TC_DISCARD);
    int f = t->action & BLK_TC_ACT(BLK_TC_FLUSH);
    int u = t->action & BLK_TC_ACT(BLK_TC_FUA);
    int i = 0;

    if (f)
            rwbs[i++] = 'F'; /* flush */

    if (d)
            rwbs[i++] = 'D';
    else if (w)
            rwbs[i++] = 'W';
    else if (t->bytes)
            rwbs[i++] = 'R';
            rwbs[i++] = 'N';

    if (u)
            rwbs[i++] = 'F'; /* fua */
    if (a)
            rwbs[i++] = 'A';
    if (s)
            rwbs[i++] = 'S';
    if (m)
            rwbs[i++] = 'M';

    rwbs[i] = '\0';

blkparse documentation looks outdated and is missing to document this flag.

Its source code is lacking comments however, from this function it looks like N means the operation is neither a read, a write, a discard, or anything expected by the code, perhaps N is simply used for None.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.