aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe2010-06-09 03:42:09 -0500
committerJens Axboe2010-08-07 11:13:00 -0500
commite2e1a148bc45855816ae6b4692ce29d0020fa22e (patch)
treefd5ec8a580d4333b471acfe50f6f92b4cc880087 /block/blk-core.c
parent841fdffdd382722d33579a6aa1487e8a4e526dbd (diff)
downloadkernel-common-e2e1a148bc45855816ae6b4692ce29d0020fa22e.tar.gz
kernel-common-e2e1a148bc45855816ae6b4692ce29d0020fa22e.tar.xz
kernel-common-e2e1a148bc45855816ae6b4692ce29d0020fa22e.zip
block: add sysfs knob for turning off disk entropy contributions
There are two reasons for doing this: - On SSD disks, the completion times aren't as random as they are for rotational drives. So it's questionable whether they should contribute to the random pool in the first place. - Calling add_disk_randomness() has a lot of overhead. This adds /sys/block/<dev>/queue/add_random that will allow you to switch off on a per-device basis. The default setting is on, so there should be no functional changes from this patch. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index f0640d7f800..b4131d29148 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2111,7 +2111,8 @@ static bool blk_update_bidi_request(struct request *rq, int error,
2111 blk_update_request(rq->next_rq, error, bidi_bytes)) 2111 blk_update_request(rq->next_rq, error, bidi_bytes))
2112 return true; 2112 return true;
2113 2113
2114 add_disk_randomness(rq->rq_disk); 2114 if (blk_queue_add_random(rq->q))
2115 add_disk_randomness(rq->rq_disk);
2115 2116
2116 return false; 2117 return false;
2117} 2118}