<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/trace/events/writeback.h, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/include/trace/events/writeback.h?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/include/trace/events/writeback.h?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-02T02:08:06Z</updated>
<entry>
<title>writeback: replace custom worker pool implementation with unbound workqueue</title>
<updated>2013-04-02T02:08:06Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-02T02:08:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=839a8e8660b6777e7fe4e80af1a048aebe2b5977'/>
<id>urn:sha1:839a8e8660b6777e7fe4e80af1a048aebe2b5977</id>
<content type='text'>
Writeback implements its own worker pool - each bdi can be associated
with a worker thread which is created and destroyed dynamically.  The
worker thread for the default bdi is always present and serves as the
"forker" thread which forks off worker threads for other bdis.

there's no reason for writeback to implement its own worker pool when
using unbound workqueue instead is much simpler and more efficient.
This patch replaces custom worker pool implementation in writeback
with an unbound workqueue.

The conversion isn't too complicated but the followings are worth
mentioning.

* bdi_writeback-&gt;last_active, task and wakeup_timer are removed.
  delayed_work -&gt;dwork is added instead.  Explicit timer handling is
  no longer necessary.  Everything works by either queueing / modding
  / flushing / canceling the delayed_work item.

* bdi_writeback_thread() becomes bdi_writeback_workfn() which runs off
  bdi_writeback-&gt;dwork.  On each execution, it processes
  bdi-&gt;work_list and reschedules itself if there are more things to
  do.

  The function also handles low-mem condition, which used to be
  handled by the forker thread.  If the function is running off a
  rescuer thread, it only writes out limited number of pages so that
  the rescuer can serve other bdis too.  This preserves the flusher
  creation failure behavior of the forker thread.

* INIT_LIST_HEAD(&amp;bdi-&gt;bdi_list) is used to tell
  bdi_writeback_workfn() about on-going bdi unregistration so that it
  always drains work_list even if it's running off the rescuer.  Note
  that the original code was broken in this regard.  Under memory
  pressure, a bdi could finish unregistration with non-empty
  work_list.

* The default bdi is no longer special.  It now is treated the same as
  any other bdi and bdi_cap_flush_forker() is removed.

* BDI_pending is no longer used.  Removed.

* Some tracepoints become non-applicable.  The following TPs are
  removed - writeback_nothread, writeback_wake_thread,
  writeback_wake_forker_thread, writeback_thread_start,
  writeback_thread_stop.

Everything, including devices coming and going away and rescuer
operation under simulated memory pressure, seems to work fine in my
test setup.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
</content>
</entry>
<entry>
<title>writeback: add more tracepoints</title>
<updated>2013-01-14T14:00:36Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-01-11T21:06:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9fb0a7da0c528d9bd49b597aa63b1fe2216c7203'/>
<id>urn:sha1:9fb0a7da0c528d9bd49b597aa63b1fe2216c7203</id>
<content type='text'>
Add tracepoints for page dirtying, writeback_single_inode start, inode
dirtying and writeback.  For the latter two inode events, a pair of
events are defined to denote start and end of the operations (the
starting one has _start suffix and the one w/o suffix happens after
the operation is complete).  These inode ops are FS specific and can
be non-trivial and having enclosing tracepoints is useful for external
tracers.

This is part of tracepoint additions to improve visiblity into
dirtying / writeback operations for io tracer and userland.

v2: writeback_dirty_inode[_start] TPs may be called for files on
    pseudo FSes w/ unregistered bdi.  Check whether bdi-&gt;dev is %NULL
    before dereferencing.

v3: buffer dirtying moved to a block TP.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>writeback: Move requeueing when I_SYNC set to writeback_sb_inodes()</title>
<updated>2012-05-06T05:43:38Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-05-03T12:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cc1676d917f32504dbadc858fa790bc524c9f0da'/>
<id>urn:sha1:cc1676d917f32504dbadc858fa790bc524c9f0da</id>
<content type='text'>
When writeback_single_inode() is called on inode which has I_SYNC already
set while doing WB_SYNC_NONE, inode is moved to b_more_io list. However
this makes sense only if the caller is flusher thread. For other callers of
writeback_single_inode() it doesn't really make sense and may be even wrong
- flusher thread may be doing WB_SYNC_ALL writeback in parallel.

So we move requeueing from writeback_single_inode() to writeback_sb_inodes().

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux</title>
<updated>2012-03-24T17:41:37Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-24T17:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=250f6715a4112d6686670c5a62ceb9305da94616'/>
<id>urn:sha1:250f6715a4112d6686670c5a62ceb9305da94616</id>
<content type='text'>
Pull &lt;linux/device.h&gt; avoidance patches from Paul Gortmaker:
 "Nearly every subsystem has some kind of header with a proto like:

	void foo(struct device *dev);

  and yet there is no reason for most of these guys to care about the
  sub fields within the device struct.  This allows us to significantly
  reduce the scope of headers including headers.  For this instance, a
  reduction of about 40% is achieved by replacing the include with the
  simple fact that the device is some kind of a struct.

  Unlike the much larger module.h cleanup, this one is simply two
  commits.  One to fix the implicit &lt;linux/device.h&gt; users, and then one
  to delete the device.h includes from the linux/include/ dir wherever
  possible."

* tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  device.h: audit and cleanup users in main include dir
  device.h: cleanup users outside of linux/include (C files)
</content>
</entry>
<entry>
<title>device.h: audit and cleanup users in main include dir</title>
<updated>2012-03-16T14:38:24Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2012-01-30T16:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=313162d0b83836e2f57e51b9b8650fb4b9c396ea'/>
<id>urn:sha1:313162d0b83836e2f57e51b9b8650fb4b9c396ea</id>
<content type='text'>
The &lt;linux/device.h&gt; header includes a lot of stuff, and
it in turn gets a lot of use just for the basic "struct device"
which appears so often.

Clean up the users as follows:

1) For those headers only needing "struct device" as a pointer
in fcn args, replace the include with exactly that.

2) For headers not really using anything from device.h, simply
delete the include altogether.

3) For headers relying on getting device.h implicitly before
being included themselves, now explicitly include device.h

4) For files in which doing #1 or #2 uncovers an implicit
dependency on some other header, fix by explicitly adding
the required header(s).

Any C files that were implicitly relying on device.h to be
present have already been dealt with in advance.

Total removals from #1 and #2: 51.  Total additions coming
from #3: 9.  Total other implicit dependencies from #4: 7.

As of 3.3-rc1, there were 110, so a net removal of 42 gives
about a 38% reduction in device.h presence in include/*

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>writeback: fix dereferencing NULL bdi-&gt;dev on trace_writeback_queue</title>
<updated>2012-02-06T03:17:25Z</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-02-05T02:54:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=977b7e3a52a7421ad33a393a38ece59f3d41c2fa'/>
<id>urn:sha1:977b7e3a52a7421ad33a393a38ece59f3d41c2fa</id>
<content type='text'>
When a SD card is hot removed without umount, del_gendisk() will call
bdi_unregister() without destroying/freeing it. This leaves the bdi in
the bdi-&gt;dev = NULL, bdi-&gt;wb.task = NULL, bdi-&gt;bdi_list removed state.

When sync(2) gets the bdi before bdi_unregister() and calls
bdi_queue_work() after the unregister, trace_writeback_queue will be
dereferencing the NULL bdi-&gt;dev. Fix it with a simple test for NULL.

LKML-reference: http://lkml.org/lkml/2012/1/18/346
Cc: stable@kernel.org
Reported-by: Rabin Vincent &lt;rabin@rab.in&gt;
Tested-by: Namjae Jeon &lt;linkinjeon@gmail.com&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>writeback: fix NULL bdi-&gt;dev in trace writeback_single_inode</title>
<updated>2012-02-01T08:53:40Z</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-01-17T17:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=15eb77a07c714ac80201abd0a9568888bcee6276'/>
<id>urn:sha1:15eb77a07c714ac80201abd0a9568888bcee6276</id>
<content type='text'>
bdi_prune_sb() resets sb-&gt;s_bdi to default_backing_dev_info when the
tearing down the original bdi. Fix trace_writeback_single_inode to
use sb-&gt;s_bdi=default_backing_dev_info rather than bdi-&gt;dev=NULL for a
teared down bdi.

Cc: &lt;stable@kernel.org&gt;
Reported-by: Rabin Vincent &lt;rabin@rab.in&gt;
Tested-by: Rabin Vincent &lt;rabin@rab.in&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>writeback: dirty ratelimit - think time compensation</title>
<updated>2011-12-18T06:20:27Z</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2011-06-12T01:25:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=83712358ba0a1497ce59a4f84ce4dd0f803fe6fc'/>
<id>urn:sha1:83712358ba0a1497ce59a4f84ce4dd0f803fe6fc</id>
<content type='text'>
Compensate the task's think time when computing the final pause time,
so that -&gt;dirty_ratelimit can be executed accurately.

        think time := time spend outside of balance_dirty_pages()

In the rare case that the task slept longer than the 200ms period time
(result in negative pause time), the sleep time will be compensated in
the following periods, too, if it's less than 1 second.

Accumulated errors are carefully avoided as long as the max pause area
is not hitted.

Pseudo code:

        period = pages_dirtied / task_ratelimit;
        think = jiffies - dirty_paused_when;
        pause = period - think;

1) normal case: period &gt; think

        pause = period - think
        dirty_paused_when = jiffies + pause
        nr_dirtied = 0

                             period time
              |===============================&gt;|
                  think time      pause time
              |===============&gt;|==============&gt;|
        ------|----------------|---------------|------------------------
        dirty_paused_when   jiffies

2) no pause case: period &lt;= think

        don't pause; reduce future pause time by:
        dirty_paused_when += period
        nr_dirtied = 0

                           period time
              |===============================&gt;|
                                  think time
              |===================================================&gt;|
        ------|--------------------------------+-------------------|----
        dirty_paused_when                                       jiffies

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>writeback: show writeback reason with __print_symbolic</title>
<updated>2011-12-18T06:20:17Z</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2011-12-08T22:53:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b3bba872ddb0320a7ecb54decae53c13ceb2ed4c'/>
<id>urn:sha1:b3bba872ddb0320a7ecb54decae53c13ceb2ed4c</id>
<content type='text'>
This makes the binary trace understandable by trace-cmd.

CC: Dave Chinner &lt;david@fromorbit.com&gt;
CC: Curt Wohlgemuth &lt;curtw@google.com&gt;
CC: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>writeback: Add a 'reason' to wb_writeback_work</title>
<updated>2011-10-30T16:33:36Z</updated>
<author>
<name>Curt Wohlgemuth</name>
<email>curtw@google.com</email>
</author>
<published>2011-10-08T03:54:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e175a1835ffc979e55787774e58ec79e41957d7'/>
<id>urn:sha1:0e175a1835ffc979e55787774e58ec79e41957d7</id>
<content type='text'>
This creates a new 'reason' field in a wb_writeback_work
structure, which unambiguously identifies who initiates
writeback activity.  A 'wb_reason' enumeration has been
added to writeback.h, to enumerate the possible reasons.

The 'writeback_work_class' and tracepoint event class and
'writeback_queue_io' tracepoints are updated to include the
symbolic 'reason' in all trace events.

And the 'writeback_inodes_sbXXX' family of routines has had
a wb_stats parameter added to them, so callers can specify
why writeback is being started.

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Curt Wohlgemuth &lt;curtw@google.com&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
</feed>
