1. 16 8月, 2016 1 次提交
  2. 08 8月, 2016 1 次提交
    • J
      block: rename bio bi_rw to bi_opf · 1eff9d32
      Jens Axboe 提交于
      Since commit 63a4cc24, bio->bi_rw contains flags in the lower
      portion and the op code in the higher portions. This means that
      old code that relies on manually setting bi_rw is most likely
      going to be broken. Instead of letting that brokeness linger,
      rename the member, to force old and out-of-tree code to break
      at compile time instead of at runtime.
      
      No intended functional changes in this commit.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      1eff9d32
  3. 18 6月, 2016 1 次提交
    • A
      blktrace: avoid using timespec · 59a37f8b
      Arnd Bergmann 提交于
      The blktrace code stores the current time in a 32-bit word in its
      user interface. This is a bad idea because 32-bit seconds overflow
      at some point.
      
      We probably have until 2106 before this one overflows, as it seems
      to use an 'unsigned' variable, but we should confirm that user
      space treats it the same way.
      
      Aside from this, we want to stop using 'struct timespec' here,
      so I'm adding a comment about the overflow and change the code
      to use timespec64 instead to make the loss of range more obvious.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      59a37f8b
  4. 09 6月, 2016 1 次提交
  5. 08 6月, 2016 3 次提交
  6. 10 5月, 2016 2 次提交
  7. 23 3月, 2016 1 次提交
  8. 04 1月, 2016 1 次提交
  9. 30 10月, 2015 1 次提交
    • D
      blktrace: re-write setting q->blk_trace · cdea01b2
      Davidlohr Bueso 提交于
      This is really about simplifying the double xchg patterns into
      a single cmpxchg, with the same logic. Other than the immediate
      cleanup, there are some subtleties this change deals with:
      
      (i) While the load of the old bt is fully ordered wrt everything,
      ie:
      
              old_bt = xchg(&q->blk_trace, bt);             [barrier]
              if (old_bt)
      	     (void) xchg(&q->blk_trace, old_bt);    [barrier]
      
      blk_trace could still be changed between the xchg and the old_bt
      load. Note that this description is merely theoretical and afaict
      very small, but doing everything in a single context with cmpxchg
      closes this potential race.
      
      (ii) Ordering guarantees are obviously kept with cmpxchg.
      
      (iii) Gets rid of the hacky-by-nature (void)xchg pattern.
      Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
      eviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      cdea01b2
  10. 01 10月, 2015 1 次提交
    • S
      tracing: Move trace_flags from global to a trace_array field · 983f938a
      Steven Rostedt (Red Hat) 提交于
      In preparation to make trace options per instance, the global trace_flags
      needs to be moved from being a global variable to a field within the trace
      instance trace_array structure.
      
      There's still more work to do, as there's some functions that use
      trace_flags without passing in a way to get to the current_trace array. For
      those, the global_trace is used directly (from trace.c). This includes
      setting and clearing the trace_flags. This means that when a new instance is
      created, it just gets the trace_flags of the global_trace and will not be
      able to modify them. Depending on the functions that have access to the
      trace_array, the flags of an instance may not affect parts of its trace,
      where the global_trace is used. These will be fixed in future changes.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      983f938a
  11. 26 9月, 2015 1 次提交
  12. 29 7月, 2015 1 次提交
    • C
      block: add a bi_error field to struct bio · 4246a0b6
      Christoph Hellwig 提交于
      Currently we have two different ways to signal an I/O error on a BIO:
      
       (1) by clearing the BIO_UPTODATE flag
       (2) by returning a Linux errno value to the bi_end_io callback
      
      The first one has the drawback of only communicating a single possible
      error (-EIO), and the second one has the drawback of not beeing persistent
      when bios are queued up, and are not passed along from child to parent
      bio in the ever more popular chaining scenario.  Having both mechanisms
      available has the additional drawback of utterly confusing driver authors
      and introducing bugs where various I/O submitters only deal with one of
      them, and the others have to add boilerplate code to deal with both kinds
      of error returns.
      
      So add a new bi_error field to store an errno value directly in struct
      bio and remove the existing mechanisms to clean all this up.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      4246a0b6
  13. 26 6月, 2015 1 次提交
    • R
      kernel/trace/blktrace.c: use strreplace() in do_blk_trace_setup() · ff14417c
      Rasmus Villemoes 提交于
      Part of the disassembly of do_blk_trace_setup:
      
          231b:       e8 00 00 00 00          callq  2320 <do_blk_trace_setup+0x50>
                              231c: R_X86_64_PC32     strlen+0xfffffffffffffffc
          2320:       eb 0a                   jmp    232c <do_blk_trace_setup+0x5c>
          2322:       66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
          2328:       48 83 c3 01             add    $0x1,%rbx
          232c:       48 39 d8                cmp    %rbx,%rax
          232f:       76 47                   jbe    2378 <do_blk_trace_setup+0xa8>
          2331:       41 80 3c 1c 2f          cmpb   $0x2f,(%r12,%rbx,1)
          2336:       75 f0                   jne    2328 <do_blk_trace_setup+0x58>
          2338:       41 c6 04 1c 5f          movb   $0x5f,(%r12,%rbx,1)
          233d:       4c 89 e7                mov    %r12,%rdi
          2340:       e8 00 00 00 00          callq  2345 <do_blk_trace_setup+0x75>
                              2341: R_X86_64_PC32     strlen+0xfffffffffffffffc
          2345:       eb e1                   jmp    2328 <do_blk_trace_setup+0x58>
      
      Yep, that's right: gcc isn't smart enough to realize that replacing '/' by
      '_' cannot change the strlen(), so we call it again and again (at least
      when a '/' is found).  Even if gcc were that smart, this construction
      would still loop over the string twice, once for the initial strlen() call
      and then the open-coded loop.
      
      Let's simply use strreplace() instead.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Liked-by: NJens Axboe <axboe@fb.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ff14417c
  14. 14 5月, 2015 1 次提交
  15. 10 12月, 2014 1 次提交
    • A
      blktrace: don't let the sysfs interface remove trace from running list · 7eca2103
      Arianna Avanzini 提交于
      Currently, blktrace can be started/stopped via its ioctl-based interface
      (used by the userspace blktrace tool) or via its ftrace interface. The
      function blk_trace_remove_queue(), called each time an "enable" tunable
      of the ftrace interface transitions to zero, removes the trace from the
      running list, even if no function from the sysfs interface adds it to
      such a list. This leads to a null pointer dereference.  This commit
      changes the blk_trace_remove_queue() function so that it does not remove
      the blk_trace from the running list.
      
      v2:
          - Now the patch removes the invocation of list_del() instead of
            adding an useless if branch, as suggested by Namhyung Kim.
      Signed-off-by: NArianna Avanzini <avanzini.arianna@gmail.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      7eca2103
  16. 20 11月, 2014 1 次提交
  17. 06 3月, 2014 1 次提交
    • R
      blktrace: fix accounting of partially completed requests · af5040da
      Roman Pen 提交于
      trace_block_rq_complete does not take into account that request can
      be partially completed, so we can get the following incorrect output
      of blkparser:
      
        C   R 232 + 240 [0]
        C   R 240 + 232 [0]
        C   R 248 + 224 [0]
        C   R 256 + 216 [0]
      
      but should be:
      
        C   R 232 + 8 [0]
        C   R 240 + 8 [0]
        C   R 248 + 8 [0]
        C   R 256 + 8 [0]
      
      Also, the whole output summary statistics of completed requests and
      final throughput will be incorrect.
      
      This patch takes into account real completion size of the request and
      fixes wrong completion accounting.
      Signed-off-by: NRoman Pen <r.peniaev@gmail.com>
      CC: Steven Rostedt <rostedt@goodmis.org>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: linux-kernel@vger.kernel.org
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <axboe@fb.com>
      af5040da
  18. 21 2月, 2014 1 次提交
  19. 24 11月, 2013 1 次提交
    • K
      block: Abstract out bvec iterator · 4f024f37
      Kent Overstreet 提交于
      Immutable biovecs are going to require an explicit iterator. To
      implement immutable bvecs, a later patch is going to add a bi_bvec_done
      member to this struct; for now, this patch effectively just renames
      things.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "Ed L. Cashin" <ecashin@coraid.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Yehuda Sadeh <yehuda@inktank.com>
      Cc: Sage Weil <sage@inktank.com>
      Cc: Alex Elder <elder@inktank.com>
      Cc: ceph-devel@vger.kernel.org
      Cc: Joshua Morris <josh.h.morris@us.ibm.com>
      Cc: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: dm-devel@redhat.com
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux390@de.ibm.com
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: Benny Halevy <bhalevy@tonian.com>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Dave Kleikamp <shaggy@kernel.org>
      Cc: Joern Engel <joern@logfs.org>
      Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Ben Myers <bpm@sgi.com>
      Cc: xfs@oss.sgi.com
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: "Roger Pau Monné" <roger.pau@citrix.com>
      Cc: Jan Beulich <jbeulich@suse.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Jiang Liu <jiang.liu@huawei.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Jerome Marchand <jmarchand@redhat.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Peng Tao <tao.peng@emc.com>
      Cc: Andy Adamson <andros@netapp.com>
      Cc: fanchaoting <fanchaoting@cn.fujitsu.com>
      Cc: Jie Liu <jeff.liu@oracle.com>
      Cc: Sunil Mushran <sunil.mushran@gmail.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Pankaj Kumar <pankaj.km@samsung.com>
      Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
      Cc: Mel Gorman <mgorman@suse.de>6
      4f024f37
  20. 09 11月, 2013 1 次提交
  21. 08 11月, 2013 1 次提交
    • J
      blktrace: Send BLK_TN_PROCESS events to all running traces · a404d557
      Jan Kara 提交于
      Currently each task sends BLK_TN_PROCESS event to the first traced
      device it interacts with after a new trace is started. When there are
      several traced devices and the task accesses more devices, this logic
      can result in BLK_TN_PROCESS being sent several times to some devices
      while it is never sent to other devices. Thus blkparse doesn't display
      command name when parsing some blktrace files.
      
      Fix the problem by sending BLK_TN_PROCESS event to all traced devices
      when a task interacts with any of them.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Review-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a404d557
  22. 19 4月, 2013 1 次提交
  23. 24 3月, 2013 1 次提交
  24. 15 3月, 2013 1 次提交
    • S
      tracing: Consolidate max_tr into main trace_array structure · 12883efb
      Steven Rostedt (Red Hat) 提交于
      Currently, the way the latency tracers and snapshot feature works
      is to have a separate trace_array called "max_tr" that holds the
      snapshot buffer. For latency tracers, this snapshot buffer is used
      to swap the running buffer with this buffer to save the current max
      latency.
      
      The only items needed for the max_tr is really just a copy of the buffer
      itself, the per_cpu data pointers, the time_start timestamp that states
      when the max latency was triggered, and the cpu that the max latency
      was triggered on. All other fields in trace_array are unused by the
      max_tr, making the max_tr mostly bloat.
      
      This change removes the max_tr completely, and adds a new structure
      called trace_buffer, that holds the buffer pointer, the per_cpu data
      pointers, the time_start timestamp, and the cpu where the latency occurred.
      
      The trace_array, now has two trace_buffers, one for the normal trace and
      one for the max trace or snapshot. By doing this, not only do we remove
      the bloat from the max_trace but the instances of traces can now use
      their own snapshot feature and not have just the top level global_trace have
      the snapshot feature and latency tracers for itself.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      12883efb
  25. 22 1月, 2013 1 次提交
  26. 14 1月, 2013 2 次提交
    • T
      block: add @req to bio_{front|back}_merge tracepoints · 8c1cf6bb
      Tejun Heo 提交于
      bio_{front|back}_merge tracepoints report a bio merging into an
      existing request but didn't specify which request the bio is being
      merged into.  Add @req to it.  This makes it impossible to share the
      event template with block_bio_queue - split it out.
      
      @req isn't used or exported to userland at this point and there is no
      userland visible behavior change.  Later changes will make use of the
      extra parameter.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      8c1cf6bb
    • T
      block: add missing block_bio_complete() tracepoint · 3a366e61
      Tejun Heo 提交于
      bio completion didn't kick block_bio_complete TP.  Only dm was
      explicitly triggering the TP on IO completion.  This makes
      block_bio_complete TP useless for tracers which want to know about
      bios, and all other bio based drivers skip generating blktrace
      completion events.
      
      This patch makes all bio completions via bio_endio() generate
      block_bio_complete TP.
      
      * Explicit trace_block_bio_complete() invocation removed from dm and
        the trace point is unexported.
      
      * @rq dropped from trace_block_bio_complete().  bios may fly around
        w/o queue associated.  Verifying and accessing the assocaited queue
        belongs to TP probes.
      
      * blktrace now gets both request and bio completions.  Make it ignore
        bio completions if request completion path is happening.
      
      This makes all bio based drivers generate blktrace completion events
      properly and makes the block_bio_complete TP actually useful.
      
      v2: With this change, block_bio_complete TP could be invoked on sg
          commands which have bio's with %NULL bi_bdev.  Update TP
          assignment code to check whether bio->bi_bdev is %NULL before
          dereferencing.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Original-patch-by: NNamhyung Kim <namhyung@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: dm-devel@redhat.com
      Cc: Neil Brown <neilb@suse.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      3a366e61
  27. 06 4月, 2012 1 次提交
    • S
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd 提交于
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      tree.
      
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      
      This replacement was done with the following semantic patch:
      
      <smpl>
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      @@
      -int open_f(struct inode *i, struct file *f)
      -{
      (
      -if (i->i_private)
      -f->private_data = i->i_private;
      |
      -f->private_data = i->i_private;
      )
      -return 0;
      -}
      
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...
      -.open = open_f,
      +.open = simple_open,
      ...
      };
      </smpl>
      
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      234e3405
  28. 04 1月, 2012 1 次提交
  29. 01 11月, 2011 1 次提交
  30. 11 8月, 2011 1 次提交
    • N
      blktrace: add FLUSH/FUA support · c09c47ca
      Namhyung Kim 提交于
      Add FLUSH/FUA support to blktrace. As FLUSH precedes WRITE and/or
      FUA follows WRITE, use the same 'F' flag for both cases and
      distinguish them by their (relative) position. The end results
      look like (other flags might be shown also):
      
       - WRITE:            W
       - WRITE_FLUSH:      FW
       - WRITE_FUA:        WF
       - WRITE_FLUSH_FUA:  FWF
      
      Note that we reuse TC_BARRIER due to lack of bit space of act_mask
      so that the older versions of blktrace tools will report flush
      requests as barriers from now on.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      c09c47ca
  31. 16 4月, 2011 1 次提交
  32. 12 4月, 2011 2 次提交
  33. 12 3月, 2011 1 次提交
    • T
      blktrace: Use rq->cmd_flags directly in blk_add_trace_rq. · 805f6b5e
      Tao Ma 提交于
      In blk_add_trace_rq, we only chose the minor 2 bits from
      request's cmd_flags and did some check for discard.
      so most of other flags(e.g, REQ_SYNC) are missing.
      
      For example, with a sync write after blkparse we get:
        8,16   1        1     0.001776503  7509  A  WS 1349632 + 1024 <- (8,17) 1347584
        8,16   1        2     0.001776813  7509  Q  WS 1349632 + 1024 [dd]
        8,16   1        3     0.001780395  7509  G  WS 1349632 + 1024 [dd]
        8,16   1        5     0.001783186  7509  I   W 1349632 + 1024 [dd]
        8,16   1       11     0.001816987  7509  D   W 1349632 + 1024 [dd]
        8,16   0        2     0.006218192     0  C   W 1349632 + 1024 [0]
      
      Since now we have integrated the flags of both bio and request,
      it is safe to pass rq->cmd_flags directly to __blk_add_trace.
      
      With this patch, after a sync write we get:
        8,16   1        1     0.001776900  5425  A  WS 1189888 + 1024 <- (8,17) 1187840
        8,16   1        2     0.001777179  5425  Q  WS 1189888 + 1024 [dd]
        8,16   1        3     0.001780797  5425  G  WS 1189888 + 1024 [dd]
        8,16   1        5     0.001783402  5425  I  WS 1189888 + 1024 [dd]
        8,16   1       11     0.001817468  5425  D  WS 1189888 + 1024 [dd]
        8,16   0        2     0.005640709     0  C  WS 1189888 + 1024 [0]
      Signed-off-by: NTao Ma <boyu.mt@taobao.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      805f6b5e
  34. 03 3月, 2011 1 次提交
    • T
      blktrace: Remove blk_fill_rwbs_rq. · 2d3a8497
      Tao Ma 提交于
      If we enable trace events to trace block actions, We use
      blk_fill_rwbs_rq to analyze the corresponding actions
      in request's cmd_flags, but we only choose the minor 2 bits
      from it, so most of other flags(e.g, REQ_SYNC) are missing.
      For example, with a sync write we get:
      write_test-2409  [001]   160.013869: block_rq_insert: 3,64 W 0 () 258135 + =
      8 [write_test]
      
      Since now we have integrated the flags of both bio and request,
      it is safe to pass rq->cmd_flags directly to blk_fill_rwbs and
      blk_fill_rwbs_rq isn't needed any more.
      
      With this patch, after a sync write we get:
      write_test-2417  [000]   226.603878: block_rq_insert: 3,64 WS 0 () 258135 +=
       8 [write_test]
      Signed-off-by: NTao Ma <boyu.mt@taobao.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      2d3a8497
  35. 19 1月, 2011 1 次提交
    • T
      blktrace: Don't output messages if NOTIFY isn't set. · 490da40d
      Tao Ma 提交于
      Now if we enable blktrace, cfq has too many messages output to the
      trace buffer. It is fine if we don't specify any action mask.
      But if I do like this:
      blktrace /dev/sdb -a issue -a complete -o - | blkparse -i -
      I only want to see 'D' and 'C', while with the following command
      dd if=/mnt/ocfs2/test of=/dev/null bs=4k count=1 iflag=direct
      
      I will get(with a 2.6.37 vanilla kernel):
        8,16   0        0     0.000000000     0  m   N cfq3805 alloced
        8,16   0        0     0.000004126     0  m   N cfq3805 insert_request
        8,16   0        0     0.000004884     0  m   N cfq3805 add_to_rr
        8,16   0        0     0.000008417     0  m   N cfq workload slice:300
        8,16   0        0     0.000009557     0  m   N cfq3805 set_active wl_prio:0 wl_type:2
        8,16   0        0     0.000010640     0  m   N cfq3805 fifo=          (null)
        8,16   0        0     0.000011193     0  m   N cfq3805 dispatch_insert
        8,16   0        0     0.000012221     0  m   N cfq3805 dispatched a request
        8,16   0        0     0.000012802     0  m   N cfq3805 activate rq, drv=1
        8,16   0        1     0.000013181  3805  D   R 114759 + 8 [dd]
        8,16   0        2     0.000164244     0  C   R 114759 + 8 [0]
        8,16   0        0     0.000167997     0  m   N cfq3805 complete rqnoidle 0
        8,16   0        0     0.000168782     0  m   N cfq3805 set_slice=100
        8,16   0        0     0.000169874     0  m   N cfq3805 arm_idle: 8 group_idle: 0
        8,16   0        0     0.000170189     0  m   N cfq schedule dispatch
        8,16   0        0     0.000397938     0  m   N cfq3805 slice expired t=0
        8,16   0        0     0.000399763     0  m   N cfq3805 sl_used=1 disp=1 charge=1 iops=0 sect=8
        8,16   0        0     0.000400227     0  m   N cfq3805 del_from_rr
        8,16   0        0     0.000400882     0  m   N cfq3805 put_queue
      
      See, there are 19 lines while I only need 2. I don't think it is
      appropriate for a user.
      
      So this patch will disable any messages if the BLK_TC_NOTIFY isn't set.
      Now the output for the same command will look like:
        8,16   0        1     0.000000000  4908  D   R 114759 + 8 [dd]
        8,16   0        2     0.000146827     0  C   R 114759 + 8 [0]
      
      Yes, it is what I want to see.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NTao Ma <boyu.mt@taobao.com>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      490da40d