589973a7042f5a91a5b8bf78a32c97ae073e2c72 |
|
25-Nov-2011 |
Cong Wang <amwang@redhat.com> |
drbd: remove the second argument of k[un]map_atomic() Signed-off-by: Cong Wang <amwang@redhat.com>
/drivers/block/drbd/drbd_bitmap.c
|
cfd8005c99c68882e962807d36603791adddfb9f |
|
25-Nov-2011 |
Cong Wang <amwang@redhat.com> |
block: remove the second argument of k[un]map_atomic() Signed-off-by: Cong Wang <amwang@redhat.com>
/drivers/block/drbd/drbd_bitmap.c
|
57f3224c3f838844cdae5e4a9d63e03152013f9a |
|
28-May-2011 |
Joe Perches <joe@perches.com> |
drbd: Convert vmalloc/memset to vzalloc Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
/drivers/block/drbd/drbd_bitmap.c
|
5a8b424276f7ba50c51e7caf485b2be23739e5b8 |
|
14-Jun-2011 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: account bitmap IO during resync as resync-(related-)-io 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
8ccee20e3ef4e12dbf02a18f17d386569b1f73ee |
|
06-Jun-2011 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: don't cond_resched_lock with IRQs disabled 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
829c60878626be290a4c248e8f1b86a0d5cbd38b |
|
03-Jun-2011 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: add missing spinlock to bitmap receive 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
24c4830c8ec3cbc904d84c213126a35f41a4e455 |
|
21-May-2011 |
Bart Van Assche <bvanassche@acm.org> |
drbd: Fix spelling Found these with the help of ispell -l. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
7e599e6e62759e057e902fcf9a05ba24f6155bcd |
|
28-Mar-2011 |
Linus Torvalds <torvalds@linux-foundation.org> |
drbd: fix up merge error 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 <asm-generic/bitops/le.h>, 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 <mingo@elte.hu> Cc: Jens Axboe <jaxboe@fusionio.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/block/drbd/drbd_bitmap.c
|
f0ff1357ce391265edbf844792da7da9a694f4bd |
|
17-Mar-2011 |
Stephen Rothwell <sfr@canb.auug.org.au> |
drbd: need include for bitops functions declarations Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
/drivers/block/drbd/drbd_bitmap.c
|
20ceb2b22edaf51e59e76087efdc71a16a2858de |
|
21-Jan-2011 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: describe bitmap locking for bulk operation in finer detail 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
725a97e43ee945cc813fffd9e628e50d703b973b |
|
19-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: fix potential access of on-stack wait_queue_head_t after return 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: <IRQ> [<ffffffff811ba0aa>] do_raw_spin_lock+0x11e/0x14d [<ffffffff81340fde>] _raw_spin_lock_irqsave+0x6a/0x81 [<ffffffff8103b694>] ? __wake_up+0x22/0x50 [<ffffffff8103b694>] __wake_up+0x22/0x50 [<ffffffffa07ff661>] 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
7648cdfe52daf0ca4fa9489879dea9e089b0dfe1 |
|
17-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: be less noisy with some log messages 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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
84e7c0f7d123d64d97e1f789ad2f23a72fe8981f |
|
16-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: Removed a reference to debug macros removed long time ago Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
6850c4421481139dc2cf982358e79c833a50d73c |
|
16-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: get rid of unused debug code Long time ago, we had paranoia code in the bitmap that allocated one extra word, assigned a magic value, and checked on every occasion that the magic value was still unchanged. That debug code is unused, the extra long word complicates code a bit. Get rid of it. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
4b0715f09655e76ca24c35a9e25e7c464c2f7346 |
|
14-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: allow petabyte storage on 64bit arch Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
19f843aa08e2d8f87a09b4c2edc43b00638423a8 |
|
15-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: bitmap keep track of changes vs on-disk bitmap When we set or clear bits in a bitmap page, also set a flag in the page->private pointer. This allows us to skip writes of unchanged pages. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
95a0f10cddbf93ce89c175ac1c53dad2d20ad309 |
|
15-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: store in-core bitmap little endian, regardless of architecture Our on-disk bitmap is a little endian bitstream. Up to now, we have stored the in-core copy of that in native endian, applying byte order conversion when necessary. Instead, keep the bitmap pages little endian, as they are read from disk, and use the generic_*_le_bit family of functions. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
7777a8ba1fc980e5edfe492ebf5a1676497b8db2 |
|
15-Dec-2010 |
Lars Ellenberg <lars.ellenberg@linbit.com> |
drbd: bitmap: don't count unused bits (fix non-terminating resync) We trusted the on-disk bitmap to have unused bits cleared. In case that is not true for whatever reason, and we take a code path where the unused bits don't get cleared elsewhere (bm_clear_surplus is not called), we may miscount the bits, and get confused during resync, waiting for bits to get cleared that we don't even use: the resync process would not terminate. Fix this by masking out unused bits in __bm_count_bits. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
81e84650c200de0695372461964dd960365696db |
|
09-Dec-2010 |
Andreas Gruenbacher <agruen@linbit.com> |
drbd: Use the standard bool, true, and false keywords Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
0cf9d27e38447efe5e5edce155a66a782a5aac4a |
|
07-Dec-2010 |
Andreas Gruenbacher <agruen@linbit.com> |
drbd: Get rid of unnecessary macros (2) The FAULT_ACTIVE macro just wraps the drbd_insert_fault macro for no apparent reason. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
7eaceaccab5f40bbfda044629a6298616aeaed50 |
|
10-Mar-2011 |
Jens Axboe <jaxboe@fusionio.com> |
block: remove per-queue plugging Code has been converted over to the new explicit on-stack plugging, and delay users have been converted to use the new API for that. So lets kill off the old plugging along with aops->sync_page(). Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
/drivers/block/drbd/drbd_bitmap.c
|
0778286a133d2d3f81861a4e5db308e359583006 |
|
31-Aug-2010 |
Philipp Reisner <philipp.reisner@linbit.com> |
drbd: Disable activity log updates when the whole device is out of sync When the complete device is marked as out of sync, we can disable updates of the on disk AL. Currently AL updates are only disabled if one uses the "invalidate-remote" command on an unconnected, primary device, or when at attach time all bits in the bitmap are set. As of now, AL updated do not get disabled when a all bits becomes set due to application writes to an unconnected DRBD device. While this is a missing feature, it is not considered important, and might get added later. BTW, after initializing a "one legged" DRBD device drbdadm create-md resX drbdadm -- --force primary resX AL updates also get disabled, until the first connect. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
5223671bb0315d83f9ad7becbbb9e703aa735bbe |
|
28-Apr-2010 |
Philipp Reisner <philipp.reisner@linbit.com> |
drbd: Fixed bitmap in case of online-grow without resync The "surplus" bits of the old (smaller) bitmap must be clean in case of online-grow without resync. Note: Reverted 67ae8b80d4a116ab3b7094eb3723506b20c06dff as well, since the lines added by this patch are redundant. The bits get set by the bm_set_surplus(b) call before that. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
b4ee79dac3bddc468e21cae0deb00b80ec4ac051 |
|
01-Apr-2010 |
Philipp Reisner <philipp.reisner@linbit.com> |
drbd: Added some missing statics Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
fd76438c2421324fa2fb9303e760ec5332ff0b58 |
|
01-Apr-2010 |
Philipp Reisner <philipp.reisner@linbit.com> |
drbd: Make sure to resync all of the new storage upon online resize Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
02d9a94bbb0d4e0fec8db6735bdc4ccfaac8f0ce |
|
24-Mar-2010 |
Philipp Reisner <philipp.reisner@linbit.com> |
drbd: Implemented the set_new_bits parameter for drbd_bm_resize() Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
2f4084209adc77f9a1c9f38db3019a509e167882 |
|
09-Apr-2010 |
Linus Torvalds <torvalds@linux-foundation.org> |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block * 'for-linus' of git://git.kernel.dk/linux-2.6-block: (34 commits) cfq-iosched: Fix the incorrect timeslice accounting with forced_dispatch loop: Update mtime when writing using aops block: expose the statistics in blkio.time and blkio.sectors for the root cgroup backing-dev: Handle class_create() failure Block: Fix block/elevator.c elevator_get() off-by-one error drbd: lc_element_by_index() never returns NULL cciss: unlock on error path cfq-iosched: Do not merge queues of BE and IDLE classes cfq-iosched: Add additional blktrace log messages in CFQ for easier debugging i2o: Remove the dangerous kobj_to_i2o_device macro block: remove 16 bytes of padding from struct request on 64bits cfq-iosched: fix a kbuild regression block: make CONFIG_BLK_CGROUP visible Remove GENHD_FL_DRIVERFS block: Export max number of segments and max segment size in sysfs block: Finalize conversion of block limits functions block: Fix overrun in lcm() and move it to lib vfs: improve writeback_inodes_wb() paride: fix off-by-one test drbd: fix al-to-on-disk-bitmap for 4k logical_block_size ...
|
5a0e3ad6af8660be21ca98a971cd00f331318c05 |
|
24-Mar-2010 |
Tejun Heo <tj@kernel.org> |
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/block/drbd/drbd_bitmap.c
|
8a03ae2a5baed3df09e5643615bdd853fc142a09 |
|
29-Jan-2010 |
Thomas Gleixner <tglx@linutronix.de> |
block: drbd: Convert semaphore to mutex The bm_change semaphore is semantically a mutex. Convert it to a real mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|
b411b3637fa71fce9cf2acf0639009500f5892fe |
|
26-Sep-2009 |
Philipp Reisner <philipp.reisner@linbit.com> |
The DRBD driver Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
/drivers/block/drbd/drbd_bitmap.c
|