summaryrefslogtreecommitdiff
path: root/block/test-iosched.c
AgeCommit message (Collapse)Author
2016-03-22block: test-iosched: Fix compilation error in end_test_bioVenkat Gopalakrishnan
The function signature of bio_end_io_t is changed in 4.4 kernel and the error value is assigned in bi_error field of the bio struct, so just free the bio after bio completion. Change-Id: I08f64d8d51ae401fa608351b90b1120d8b84605f Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: fix spinlock recursionGilad Broner
spin_lock_irq() / spin_unlock_irq() is used so interrupts are enabled after unlocking the spinlock. However, it is not guaranteed they were enabled before. This change uses the proper irqsave / irqrestore variants instead. Without it, a spinlock recursion on the scsi request completion path is possible if completion interrupt occurs when used for UFS testing. Change-Id: I25a9bf6faaa2bbfedc807111fbcb32276cccea2f Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22block: test-iosched: expose sector_range variable to userLee Susman
Expose "sector_range", which will indicate to the low-level driver unit-tests the size (in sectors, starting from "start_sector") of the address space in which they can perform I/O operations. This user-defined variable can be used to change the address space size from the default 512MiB. Change-Id: I515a6849eb39b78e653f4018993a2c8e64e2a77f Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22block: test-iosched: fix bio allocation for test requestsGilad Broner
Unit tests submit large requests of 512KB made of 128 bios. Current allocation was done via kmalloc which may not be able to allocate such a large buffer which is also physically contiguous. Using kmalloc to allocate each bio separately is also problematic as it might not be page aligned. Some bio may end up using more than a single memory segment which will fail the mapping of the bios to the request which supports up to 128 physical segments. To avoid such failure, allocate a separate page for each bio (bio size is single page size). Change-Id: Id0da394d458942e093d924bc7aa23aa3231cdca7 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: enable running of simultaneous testsGilad Broner
Current test-iosched design enables running only a single test for a single block device. This change modifies the test-iosched framework to allow running several tests on several block devices. Change-Id: I051d842733873488b64e89053d9c4e30e1249870 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> [merez@codeaurora.org: fix conflicts due to removal of BKOPs UT] Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [venkatg@codeaurora.org: Drop changes to ufs_test.c and mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: fix spinlock recursionGilad Broner
blk_run_queue() takes the queue spinlock and disabled irqs. Consider the following callstack: blk_run_queue ->__blk_run_queue -> scsi_request_fn -> blk_peek_request -> __elv_next_request -> elevator_dispatch_fn -> test_dispatch_requests -> test_dispatch_from test_dispatch_from() will release the test-iosched spinlock using spin_unlock_irq which will enable interrupts, however, caller is assuming interrupts are disabled. An interrupt can occur now and scsi soft-irq may be scheduled with the following call stack: scsi_softirq_done -> scsi_finish_command -> scsi_device_unbusy scsi_device_unbusy() tries to lock the queue spinlock which was previously locked when blk_run_queue was called, resulting in a spinlock recursion. Change test_dispatch_from() to use the spinlock irq save/restore variants to prevent enabling the irq in case they were previously disabled. Change-Id: Icaea4f9ba54771edb0302c6005047fcc5478ce8d Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22block: test-iosched: remove test timeout timerGilad Broner
When running a test, a timer was set to detect test timeout and to unblock the wait_event() function which is waiting for the test to finish. This is redundant as wait_event timeout variant gives the same functionality without the overhead of managing a timer for this purpose and improve code readability. Change-Id: Icbd3cb0f3fcb5854673f4506b102b0c80e97d6bb Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2016-03-22block: test-iosched: expose APIs to allow compiling ufs_test as a moduleMaya Erez
The UFS tests are used for testing the functionality and performance of the UFS driver. Some of the tests call compare_buffer_to_pattern for data integrity checking. This function should be exposed in order to allow compilation of ufs_test as a module. Change-Id: I2279b0ae9dbdf4ecad073fab2b15116be2ea1713 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22scsi: ufs: mixed long sequentialDolev Raviv
The test will verify correctness of sequential data pattern written to the device while new data (with same pattern) is written simultaneously. First this test will run a long sequential write scenario. This first stage will write the pattern that will be read later. Second, sequential read requests will read and compare the same data. The second stage reads, will issue in Parallel to write requests with the same LBA and size. NOTE: The test requires a long timeout. The purpose of this test is to mix read and write requests on the same LBA while checking for the read data correctness. Change-Id: I6a437ce689b66233af3055d07a7f62f1e7b40765 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs: add support for test specific completion checkDolev Raviv
Introduce a new callback 'check_test_completion_fn' to test-iosched framework. This callback is necessary to determine if a test has completed or not in situation where the request queue is empty, but the test was not completed. Change-Id: I60bd8cccffacab11a5a7cba78caccf53fea3e1d8 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22scsi: ufs: long sequential read/write testsLee Susman
This test adds the ability to test the UFS task management feature in the driver. It loads the queue with requests in order to allow the task management to operate in full capacity. Modify test-iosched infrastructure to support the new tests: - expose check_test_completion() Note: we submit 16-bio requests since the current HW is very slow and we don't want to exceed the timeout duration. Change-Id: I8ee752cba3c6838d8edc05747fa0288c4b347ef6 Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fix trivial conflicts in ufs_test.c] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Changes to ufs_test.c are already present as part of earlier commit, hence drop them here] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: fix test-iosched compilationMaya Erez
Fix test-iosched compilation issues due to differences in data structures in kernel-3.14. Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22block: add test bio size define to test-ioschedLee Susman
Add a define for the test bio size (which is the size of a page), this is used for allocating the right sized buffer for the bio during test request creation. Change-Id: I9505c85c4352009bdee442172eb8ae8f4254cfb0 Signed-off-by: Lee Susman <lsusman@codeaurora.org>
2016-03-22mmc: Unit test fix for loggingMaya Erez
Update logging with: - prefix with module name - add '\n' in the end - test_pr_* removed Change-Id: I465c9809def9d294dcbb3f7cf7f474c189f5fdbf Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> [merez@codeaurora.org: fix conflicts due to removal of bkops tests] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: disable statistic flag on requestDolev Raviv
The flag REQ_IO_STAT is enabled by default this assumes statistics are initialized and might cause NULL references in the kernel. To avoid it this flag is cleared in the request and stats are not updated. Change-Id: I6a1890dde51dfa8ffdd376b13f4466c9db0ae05b Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22mmc: card: change long_sequential_test time measurements to ktimeLee Susman
Change time measurements in long_sequential_test from jiffies to ktime, and make the relevant change in test-iosched infrastructure. In long_sequential_test we measure throughput, and the jiffies resolution is not sensitive enough for this calculation. Change-Id: If7c9a03c687f61996609c014e056bcd7132b9012 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: fix test crashing due to synchronization issueDolev Raviv
The __blk_run_queue function is called from several contexts. The fix is replacing it with blk_run_queue function, this function is guarded with a lock, thus making it thread safe and prevents the crashing. Change-Id: I3e12fa9c8b9e161375fffa3570abfa46b223a60b Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22mmc: enhance long_sequential_test for higher throughputLee Susman
Change the test design so that requests are dynamically created and freed. This enables running tests with more than 128 requests, therefore more than 50MiB can be written/read and makes it possible to measure driver write/read throughput more accurately. Change-Id: I56c9d6c1afba5c91a0621a16d97feafd4689521d Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fix conflicts due to BKOPS tests removal] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: Add support for setting rq_diskDolev Raviv
Some block devices requires the rq_disk field to be assigned. This patch exposes a new API to the block device test utility for getting the rq_disk assigned, in the created request. Change-Id: I61dc4dad50eb7600728156a6cd08bb1ee134df0d Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
2016-03-22block: test-iosched infrastructure enhancementLee Susman
Add functionality to test-iosched so that it could simulate the ROW scheduler behaviour. The main additions are: - 3 distinct requests queue with counters - support for urgent request pending - reinsert request implementation (callback + dispatch behavior) Change-Id: I83b5d9e3d2b8cd9a2353afa6a3e6a4cbc83b0cd4 Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fixed conflicts due to bkops tests removal] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Dropping elevator is_urgent_fn and reinsert_req_fn ops fn as they are not present in 3.18 kernel] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22mmc: improve mmc_block_test printoutsLee Susman
Change the printout format to be more readable. Specifically, add quotes around the test case name strings. Change-Id: I51b0c1b94389e4b51af84c5e993207b18efc2226 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: fix conflicts as BKOPS tests were removed] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22mmc: card: Add long sequential read test to test-ioschedLee Susman
Long sequential read test measures read throughput at the driver level by reading large requests sequentially. Change-Id: I3b6d685930e1d0faceabbc7d20489111734cc9d4 Signed-off-by: Lee Susman <lsusman@codeaurora.org> [merez@codeaurora.org: Fix conflicts as BKOPS tests were removed] Signed-off-by: Maya Erez <merez@codeaurora.org> [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-03-22block: test-iosched: Sleep before each testTatyana Brokhman
In order to be sure that the packing statistics collected after the test reflect *only* requests issued by the test (and not real request from FS) - sleep before each test in order to give an already dispatched requests time to complete. Change-Id: If2f40efad1d79084a8ea85afe93cce58e49ff698 CRs-Fixed: 453712 Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
2016-03-22block: test-iosched error handling fixesMaya Erez
- Fix test-iosched crash when running multiple tests - Free the BIOs memory when a request is not completed Change-Id: I1baa916c04ae73c809dee7e67ec63f4546dc71aa Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-03-22block: Add test-iosched schedulerMaya Erez
The test scheduler allows testing a block device by dispatching specific requests according to the test case and declare PASS/FAIL according to the requests completion error code Change-Id: Ief91f9fed6e3c3c75627d27264d5252ea14f10ad Signed-off-by: Maya Erez <merez@codeaurora.org>