forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-3.7/core' of git://git.kernel.dk/linux-block
Pull block IO update from Jens Axboe: "Core block IO bits for 3.7. Not a huge round this time, it contains: - First series from Kent cleaning up and generalizing bio allocation and freeing. - WRITE_SAME support from Martin. - Mikulas patches to prevent O_DIRECT crashes when someone changes the block size of a device. - Make bio_split() work on data-less bio's (like trim/discards). - A few other minor fixups." Fixed up silent semantic mis-merge as per Mikulas Patocka and Andrew Morton. It is due to the VM no longer using a prio-tree (see commit 6b2dbba: "mm: replace vma prio_tree with an interval tree"). So make set_blocksize() use mapping_mapped() instead of open-coding the internal VM knowledge that has changed. * 'for-3.7/core' of git://git.kernel.dk/linux-block: (26 commits) block: makes bio_split support bio without data scatterlist: refactor the sg_nents scatterlist: add sg_nents fs: fix include/percpu-rwsem.h export error percpu-rw-semaphore: fix documentation typos fs/block_dev.c:1644:5: sparse: symbol 'blkdev_mmap' was not declared blockdev: turn a rw semaphore into a percpu rw semaphore Fix a crash when block device is read and block size is changed at the same time block: fix request_queue->flags initialization block: lift the initial queue bypass mode on blk_register_queue() instead of blk_init_allocated_queue() block: ioctl to zero block ranges block: Make blkdev_issue_zeroout use WRITE SAME block: Implement support for WRITE SAME block: Consolidate command flag and queue limit checks for merges block: Clean up special command handling logic block/blk-tag.c: Remove useless kfree block: remove the duplicated setting for congestion_threshold block: reject invalid queue attribute values block: Add bio_clone_bioset(), bio_clone_kmalloc() block: Consolidate bio_alloc_bioset(), bio_kmalloc() ...
- Loading branch information
Showing
33 changed files
with
770 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,3 +206,17 @@ Description: | |
when a discarded area is read the discard_zeroes_data | ||
parameter will be set to one. Otherwise it will be 0 and | ||
the result of reading a discarded area is undefined. | ||
|
||
What: /sys/block/<disk>/queue/write_same_max_bytes | ||
Date: January 2012 | ||
Contact: Martin K. Petersen <[email protected]> | ||
Description: | ||
Some devices support a write same operation in which a | ||
single data block can be written to a range of several | ||
contiguous blocks on storage. This can be used to wipe | ||
areas on disk or to initialize drives in a RAID | ||
configuration. write_same_max_bytes indicates how many | ||
bytes can be written in a single write same command. If | ||
write_same_max_bytes is 0, write same is not supported | ||
by the device. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Percpu rw semaphores | ||
-------------------- | ||
|
||
Percpu rw semaphores is a new read-write semaphore design that is | ||
optimized for locking for reading. | ||
|
||
The problem with traditional read-write semaphores is that when multiple | ||
cores take the lock for reading, the cache line containing the semaphore | ||
is bouncing between L1 caches of the cores, causing performance | ||
degradation. | ||
|
||
Locking for reading is very fast, it uses RCU and it avoids any atomic | ||
instruction in the lock and unlock path. On the other hand, locking for | ||
writing is very expensive, it calls synchronize_rcu() that can take | ||
hundreds of milliseconds. | ||
|
||
The lock is declared with "struct percpu_rw_semaphore" type. | ||
The lock is initialized percpu_init_rwsem, it returns 0 on success and | ||
-ENOMEM on allocation failure. | ||
The lock must be freed with percpu_free_rwsem to avoid memory leak. | ||
|
||
The lock is locked for read with percpu_down_read, percpu_up_read and | ||
for write with percpu_down_write, percpu_up_write. | ||
|
||
The idea of using RCU for optimized rw-lock was introduced by | ||
Eric Dumazet <[email protected]>. | ||
The code was written by Mikulas Patocka <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.