<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/drbd/drbd_bitmap.c, branch v3.0.82</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/block/drbd/drbd_bitmap.c?h=v3.0.82</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/block/drbd/drbd_bitmap.c?h=v3.0.82'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-06-30T07:23:43Z</updated>
<entry>
<title>drbd: account bitmap IO during resync as resync-(related-)-io</title>
<updated>2011-06-30T07:23:43Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2011-06-14T12:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a8b424276f7ba50c51e7caf485b2be23739e5b8'/>
<id>urn:sha1:5a8b424276f7ba50c51e7caf485b2be23739e5b8</id>
<content type='text'>
If we have a good resync rate, we will frequently update the on-disk
bitmap, which, if not accounted for as resync io, may let an otherwise
idle device appear to be "busy", and cause us to throttle resync.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: don't cond_resched_lock with IRQs disabled</title>
<updated>2011-06-30T07:23:42Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2011-06-06T09:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8ccee20e3ef4e12dbf02a18f17d386569b1f73ee'/>
<id>urn:sha1:8ccee20e3ef4e12dbf02a18f17d386569b1f73ee</id>
<content type='text'>
The last commit, drbd: add missing spinlock to bitmap receive,
introduced a cond_resched_lock(), where the lock in question is taken
with irqs disabled.

As we must not schedule with IRQs disabled,
and cond_resched_lock_irq() does not exist, yet,
we re-aquire the spin_lock_irq() for each bitmap page processed in turn.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: add missing spinlock to bitmap receive</title>
<updated>2011-06-30T07:23:41Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2011-06-03T19:18:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=829c60878626be290a4c248e8f1b86a0d5cbd38b'/>
<id>urn:sha1:829c60878626be290a4c248e8f1b86a0d5cbd38b</id>
<content type='text'>
During bitmap exchange, when using the RLE bitmap compression scheme,
we have a code path that can set the whole bitmap at once.

To avoid holding spin_lock_irq() for too long, we used to lock out other
bitmap modifications during bitmap exchange by other means, and then,
knowing we have exclusive access to the bitmap, modify it without
the spinlock, and with IRQs enabled.

Since we now allow local IO to continue, potentially setting additional
bits during the bitmap receive phase, this is no longer true, and we get
uncoordinated updates of bitmap members, causing bm_set to no longer
accurately reflect the total number of set bits.

To actually see this, you'd need to have a large bitmap, use RLE bitmap
compression, and have busy IO during sync handshake and bitmap exchange.

Fix this by taking the spin_lock_irq() in this code path as well, but
calling cond_resched_lock() after each page worth of bits processed.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: Fix spelling</title>
<updated>2011-05-24T08:21:29Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2011-05-21T16:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=24c4830c8ec3cbc904d84c213126a35f41a4e455'/>
<id>urn:sha1:24c4830c8ec3cbc904d84c213126a35f41a4e455</id>
<content type='text'>
Found these with the help of ispell -l.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: fix up merge error</title>
<updated>2011-03-28T14:42:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-03-28T14:42:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7e599e6e62759e057e902fcf9a05ba24f6155bcd'/>
<id>urn:sha1:7e599e6e62759e057e902fcf9a05ba24f6155bcd</id>
<content type='text'>
In commit 95a0f10cddbf ("drbd: store in-core bitmap little endian,
regardless of architecture") drbd had made the sane choice to use
little-endian bitmap functions everywhere.  However, it used the
horrible old functions names from &lt;asm-generic/bitops/le.h&gt;, that were
never really meant to be exported.

In the meantime, things got cleaned up, and in commit c4945b9ed472
("asm-generic: rename generic little-endian bitops functions") we
renamed the LE bitops to something sane, exactly so that they could be
used in random code without people gouging their eyes out when seeing
the crazy jumble of letters that were the old internal names.

As a result the drbd thing merged cleanly (commit 8d49a77568d1: "Merge
branch 'for-2.6.39/drivers' of git://git.kernel.dk/linux-2.6-block"),
since there was no data conflict - but the end result obviously doesn't
actually compile.

Reported-and-tested-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jens Axboe &lt;jaxboe@fusionio.com&gt;
Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drbd: need include for bitops functions declarations</title>
<updated>2011-03-17T14:02:51Z</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2011-03-17T14:02:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f0ff1357ce391265edbf844792da7da9a694f4bd'/>
<id>urn:sha1:f0ff1357ce391265edbf844792da7da9a694f4bd</id>
<content type='text'>
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>drbd: describe bitmap locking for bulk operation in finer detail</title>
<updated>2011-03-10T10:48:02Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2011-01-21T09:56:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=20ceb2b22edaf51e59e76087efdc71a16a2858de'/>
<id>urn:sha1:20ceb2b22edaf51e59e76087efdc71a16a2858de</id>
<content type='text'>
Now that we do no longer in-place endian-swap the bitmap, we allow
selected bitmap operations (testing bits, sometimes even settting bits)
during some bulk operations.

This caused us to hit a lot of FIXME asserts similar to
	FIXME asender in drbd_bm_count_bits,
	bitmap locked for 'write from resync_finished' by worker
Which now is nonsense: looking at the bitmap is perfectly legal
as long as it is not being resized.

This cosmetic patch defines some flags to describe expectations in finer
detail, so the asserts in e.g. bm_change_bits_to() can be skipped if
appropriate.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: fix potential access of on-stack wait_queue_head_t after return</title>
<updated>2011-03-10T10:45:08Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2010-12-19T10:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=725a97e43ee945cc813fffd9e628e50d703b973b'/>
<id>urn:sha1:725a97e43ee945cc813fffd9e628e50d703b973b</id>
<content type='text'>
I run into something declaring itself as "spinlock deadlock",
 BUG: spinlock lockup on CPU#1, kjournald/27816, ffff88000ad6bca0
 Pid: 27816, comm: kjournald Tainted: G        W 2.6.34.6 #2
 Call Trace:
  &lt;IRQ&gt;  [&lt;ffffffff811ba0aa&gt;] do_raw_spin_lock+0x11e/0x14d
  [&lt;ffffffff81340fde&gt;] _raw_spin_lock_irqsave+0x6a/0x81
  [&lt;ffffffff8103b694&gt;] ? __wake_up+0x22/0x50
  [&lt;ffffffff8103b694&gt;] __wake_up+0x22/0x50
  [&lt;ffffffffa07ff661&gt;] bm_async_io_complete+0x258/0x299 [drbd]
but the call traces do not fit at all,
all other cpus are cpu_idle.

I think it may be this race:

drbd_bm_write_page
 wait_queue_head_t io_wait;
 atomic_t in_flight;
 bm_async_io
  submit_bio
					bm_async_io_complete
					  if (atomic_dec_and_test(in_flight))
 wait_event(io_wait,
	atomic_read(in_flight) == 0)
 return
					    wake_up(io_wait)

The wake_up now accesses the wait_queue_head_t spinlock, which is no
longer valid, since the stack frame of drbd_bm_write_page has been
clobbered now.

Fix this by using struct completion, which does both the condition test
as well as the wake_up inside its spinlock, so this race cannot happen.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: be less noisy with some log messages</title>
<updated>2011-03-10T10:43:37Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2010-12-17T22:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7648cdfe52daf0ca4fa9489879dea9e089b0dfe1'/>
<id>urn:sha1:7648cdfe52daf0ca4fa9489879dea9e089b0dfe1</id>
<content type='text'>
We expect changes to a bitmap page in drbd_bm_write_page,
that's why we submit a copy page.

If a page changes during global writeout, that would be unexpected,
and reason to warn, though.

Also, often page writeout can be skipped (on activity log transactions
during normal operation, for example), no need to log that everytime.

Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
<entry>
<title>drbd: Removed a reference to debug macros removed long time ago</title>
<updated>2011-03-10T10:43:27Z</updated>
<author>
<name>Lars Ellenberg</name>
<email>lars.ellenberg@linbit.com</email>
</author>
<published>2010-12-15T23:37:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=84e7c0f7d123d64d97e1f789ad2f23a72fe8981f'/>
<id>urn:sha1:84e7c0f7d123d64d97e1f789ad2f23a72fe8981f</id>
<content type='text'>
Signed-off-by: Philipp Reisner &lt;philipp.reisner@linbit.com&gt;
Signed-off-by: Lars Ellenberg &lt;lars.ellenberg@linbit.com&gt;
</content>
</entry>
</feed>
