Jens Axboe
1e42807918
block: reduce stack footprint of blk_recount_segments()
blk_recalc_rq_segments() requires a request structure passed in, which
we don't have from blk_recount_segments(). So the latter allocates one on
the stack, using > 400 bytes of stack for that. This can cause us to spill
over one page of stack from ext4 at least:
0) 4560 400 blk_recount_segments+0x43/0x62
1) 4160 32 bio_phys_segments+0x1c/0x24
2) 4128 32 blk_rq_bio_prep+0x2a/0xf9
3) 4096 32 init_request_from_bio+0xf9/0xfe
4) 4064 112 __make_request+0x33c/0x3f6
5) 3952 144 generic_make_request+0x2d1/0x321
6) 3808 64 submit_bio+0xb9/0xc3
7) 3744 48 submit_bh+0xea/0x10e
8) 3696 368 ext4_mb_init_cache+0x257/0xa6a [ext4]
9) 3328 288 ext4_mb_regular_allocator+0x421/0xcd9 [ext4]
10) 3040 160 ext4_mb_new_blocks+0x211/0x4b4 [ext4]
11) 2880 336 ext4_ext_get_blocks+0xb61/0xd45 [ext4]
12) 2544 96 ext4_get_blocks_wrap+0xf2/0x200 [ext4]
13) 2448 80 ext4_da_get_block_write+0x6e/0x16b [ext4]
14) 2368 352 mpage_da_map_blocks+0x7e/0x4b3 [ext4]
15) 2016 352 ext4_da_writepages+0x2ce/0x43c [ext4]
16) 1664 32 do_writepages+0x2d/0x3c
17) 1632 144 __writeback_single_inode+0x162/0x2cd
18) 1488 96 generic_sync_sb_inodes+0x1e3/0x32b
19) 1392 16 sync_sb_inodes+0xe/0x10
20) 1376 48 writeback_inodes+0x69/0xb3
21) 1328 208 balance_dirty_pages_ratelimited_nr+0x187/0x2f9
22) 1120 224 generic_file_buffered_write+0x1d4/0x2c4
23) 896 176 __generic_file_aio_write_nolock+0x35f/0x393
24) 720 80 generic_file_aio_write+0x6c/0xc8
25) 640 80 ext4_file_write+0xa9/0x137 [ext4]
26) 560 320 do_sync_write+0xf0/0x137
27) 240 48 vfs_write+0xb3/0x13c
28) 192 64 sys_write+0x4c/0x74
29) 128 128 system_call_fastpath+0x16/0x1b
Split the segment counting out into a __blk_recalc_rq_segments() helper
to avoid allocating an onstack request just for checking the physical
segment count.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-02-26 10:45:48 +01:00
..
2009-02-20 17:57:49 -08:00
2009-01-30 23:36:36 +05:30
2009-01-30 23:37:37 +05:30
2009-01-30 23:38:03 +05:30
2009-02-08 09:56:11 -08:00
2009-02-02 22:45:10 -05:00
2009-01-30 23:38:37 +05:30
2009-01-30 23:39:08 +05:30
2009-01-30 23:39:42 +05:30
2009-01-30 23:40:06 +05:30
2009-02-18 10:32:00 +01:00
2009-02-26 10:45:48 +01:00
2009-02-18 10:32:00 +01:00
2009-01-30 23:41:27 +05:30
2009-01-30 23:44:08 +05:30
2009-02-11 14:25:36 -08:00
2009-01-30 23:44:41 +05:30
2009-01-30 22:35:29 +01:00
2009-02-05 16:48:53 +11:00
2009-02-21 14:17:17 -08:00
2009-01-30 23:45:32 +05:30
2009-02-18 15:37:55 -08:00
2009-01-30 23:46:03 +05:30
2009-01-30 23:46:40 +05:30
2009-01-30 23:47:07 +05:30
2009-01-30 23:47:59 +05:30
2009-01-30 23:48:33 +05:30
2009-01-30 23:49:07 +05:30
2009-02-05 12:56:46 -08:00
2009-02-18 15:37:56 -08:00
2009-02-18 18:33:04 -08:00
2009-01-30 23:49:39 +05:30
2009-01-30 23:50:12 +05:30
2009-01-30 23:50:37 +05:30
2009-01-30 23:51:17 +05:30
2009-02-10 14:56:59 -08:00
2009-02-24 19:19:49 +01:00
2009-02-24 19:19:49 +01:00
2009-01-30 23:51:41 +05:30
2009-02-25 20:28:24 +01:00
2009-01-30 23:52:16 +05:30
2009-01-30 23:52:41 +05:30
2009-01-30 23:53:12 +05:30
2009-01-30 23:53:40 +05:30
2009-01-30 23:54:53 +05:30
2009-01-30 23:55:45 +05:30
2009-01-30 23:56:13 +05:30
2009-01-30 23:56:48 +05:30
2009-02-02 13:27:44 -08:00
2009-02-18 23:31:11 -08:00
2009-01-30 23:57:16 +05:30
2009-01-30 23:57:43 +05:30
2009-02-05 13:04:33 +01:00
2009-02-09 11:03:17 +00:00
2009-01-30 23:58:12 +05:30
2009-01-30 23:59:12 +05:30
2009-01-30 23:58:41 +05:30
2009-01-30 23:59:44 +05:30
2009-01-31 00:00:06 +05:30
2009-02-10 11:15:34 -05:00
2009-02-02 23:55:27 -08:00
2009-02-05 12:56:46 -08:00
2009-02-15 02:47:36 +02:00
2009-02-15 02:47:35 +02:00
2009-02-02 23:04:31 -05:00
2009-01-31 00:00:35 +05:30
2009-02-18 15:37:55 -08:00
2009-02-18 15:37:55 -08:00
2009-02-07 08:33:01 -08:00
2009-01-31 00:01:11 +05:30
2009-01-31 00:01:42 +05:30
2009-01-31 00:02:27 +05:30
2009-01-31 00:15:24 +05:30
2009-02-20 17:57:50 -08:00
2009-02-04 16:58:41 -08:00
2009-01-31 00:02:54 +05:30
2009-01-31 00:03:40 +05:30
2009-02-10 17:18:17 -08:00
2009-02-22 10:33:44 -08:00
2009-01-31 00:05:30 +05:30
2009-01-31 00:05:59 +05:30
2009-01-31 00:15:57 +05:30
2009-02-11 14:04:21 +01:00
2009-02-18 15:37:53 -08:00
2009-02-20 17:57:50 -08:00
2009-01-31 00:06:33 +05:30
2009-02-17 21:24:05 -08:00
2009-02-20 17:57:48 -08:00
2009-01-31 00:07:00 +05:30
2009-02-10 00:02:54 +01:00
2009-02-09 08:15:39 -08:00
2009-01-31 00:07:31 +05:30
2009-02-11 14:25:36 -08:00
2009-01-31 00:08:18 +05:30
2009-02-18 15:37:53 -08:00
2009-01-31 00:09:13 +05:30
2009-01-31 00:10:11 +05:30
2009-01-31 00:10:59 +05:30
2009-01-31 00:11:25 +05:30
2009-01-31 00:12:44 +05:30
2009-01-31 00:13:08 +05:30
2009-02-18 15:37:53 -08:00
2009-02-05 12:56:48 -08:00