diff options
| author | Gilad Broner <gbroner@codeaurora.org> | 2015-01-08 12:26:07 +0200 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:01:58 -0700 |
| commit | f3664f905ddcb4e7329985049e73e9b7d56e0ed1 (patch) | |
| tree | 4a74c9cf16206871e02282ef6b2366875e15c703 /include/linux | |
| parent | 60f3461f17b575ac2252d8171507791ce848b37a (diff) | |
block: test-iosched: fix bio allocation for test requests
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/test-iosched.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/test-iosched.h b/include/linux/test-iosched.h index 8036d4b682fe..2dae014dbe58 100644 --- a/include/linux/test-iosched.h +++ b/include/linux/test-iosched.h @@ -92,7 +92,7 @@ struct test_debug { /** * struct test_request - defines a test request * @queuelist: The test requests list - * @bios_buffer: Write/read requests data buffer + * @bios_buffer: Write/read requests data buffer, one page per bio * @buf_size: Write/read requests data buffer size (in * bytes) * @rq: A block request, to be dispatched @@ -110,7 +110,7 @@ struct test_debug { */ struct test_request { struct list_head queuelist; - unsigned int *bios_buffer; + void *bios_buffer[BLK_MAX_SEGMENTS]; int buf_size; struct request *rq; bool req_completed; @@ -250,6 +250,8 @@ extern struct test_request *test_iosched_create_test_req(struct test_iosched *, int is_err_expcted, int direction, int start_sec, int num_bios, int pattern, rq_end_io_fn *end_req_io); +extern void test_iosched_free_test_req_data_buffer(struct test_request *); + extern void test_iosched_set_test_result(struct test_iosched*, int test_result); extern void test_iosched_set_ignore_round(struct test_iosched *, |
