Files
android_kernel_xiaomi_sm8450/include/linux
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-01-30 19:50:25 +05:30
2009-01-30 19:59:53 +05:30
2009-01-11 01:34:25 +01:00
2009-01-09 12:37:15 -08:00
2009-01-30 23:30:42 +05:30
2009-01-30 23:32:45 +05:30
2009-01-30 23:37:37 +05:30
2008-07-01 11:28:06 +10:00
2008-10-20 11:01:52 -07:00
2008-08-12 10:13:38 +10:00
2009-01-30 23:38:03 +05:30
2008-12-29 08:29:50 +01:00
2009-02-02 22:45:10 -05:00
2009-01-30 23:38:37 +05:30
2008-12-03 22:12:38 -08:00
2008-12-03 22:12:38 -08:00
2009-01-30 23:39:42 +05:30
2008-10-20 08:52:42 -07:00
2009-01-30 23:40:06 +05:30
2009-01-06 15:59:29 -08:00
2009-02-18 10:32:00 +01:00
2009-01-01 10:12:19 +10:30
2008-06-06 11:29:10 -07:00
2009-01-04 13:33:20 -08:00
2008-05-29 01:38:46 -07:00
2008-11-12 17:17:18 -08:00
2009-01-30 23:44:08 +05:30
2008-07-04 10:40:05 -07:00
2008-10-16 11:21:32 -07:00
2008-07-25 10:53:33 -07:00
2009-01-02 12:19:34 -08:00
2008-12-29 17:47:23 +10:00
2008-12-25 11:01:43 +11:00
2008-11-24 18:57:41 -05:00
2009-02-05 16:48:53 +11:00
2008-07-22 17:30:57 -07:00
2008-12-31 18:07:38 -05:00
2008-08-28 11:49:15 -05:00
2008-07-21 12:00:37 +01:00
2009-01-28 07:50:14 -08:00
2009-01-30 23:46:03 +05:30
2009-01-30 23:46:40 +05:30
2008-10-16 16:53:13 +02:00
2009-01-30 23:48:33 +05:30
2009-01-30 23:49:07 +05:30
2008-12-15 23:44:31 -08:00
2008-07-24 10:47:29 -07:00
2008-08-20 13:19:51 -07:00
2008-12-29 11:27:46 +02:00
2008-10-08 19:44:18 -04:00
2009-02-18 15:37:56 -08:00
2008-12-31 18:07:42 -05:00
2008-12-01 19:14:02 +01:00
2009-01-06 15:59:01 -08:00
2008-10-16 11:21:40 -07:00
2008-07-20 17:12:36 -07:00
2008-12-08 01:14:16 -08:00
2009-01-30 23:50:37 +05:30
2009-01-30 23:51:17 +05:30
2008-07-31 18:45:41 +02:00
2009-01-26 21:19:52 +01:00
2008-08-08 15:13:27 +01:00
2008-10-16 11:21:38 -07: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
2008-06-11 21:00:38 -07:00
2009-01-30 23:53:12 +05:30
2009-01-30 23:53:40 +05:30
2009-01-30 23:54:53 +05:30
2008-07-18 18:05:19 -07:00
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-01-30 23:57:16 +05:30
2008-08-02 18:36:10 +01:00
2008-10-07 15:34:37 -07:00
2008-10-29 22:02:09 +01:00
2008-11-03 18:21:45 +01:00
2008-10-15 14:24:08 +02:00
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-01-15 16:39:37 -08:00
2008-06-04 17:50:17 +01:00
2009-01-05 08:40:30 -08:00
2008-12-31 15:11:46 +01:00
2008-07-24 10:47:17 -07:00
2008-07-04 10:40:05 -07:00
2008-09-01 09:47:16 +02:00
2008-10-09 08:56:06 +02:00
2009-01-31 00:00:35 +05:30
2008-07-27 01:56:38 +02:00
2009-02-18 15:37:55 -08:00
2008-07-28 16:30:21 -07:00
2009-01-31 00:01:11 +05:30
2008-06-06 11:29:12 -07:00
2008-12-08 14:31:59 +01:00
2008-11-19 18:49:57 -08:00
2009-01-07 17:38:31 -05:00
2008-12-23 15:21:45 -05:00
2008-12-19 15:22:54 -05:00
2009-01-31 00:15:24 +05:30
2008-12-21 14:21:14 +11:00
2009-01-08 08:31:05 -08:00
2008-10-16 11:21:49 -07:00
2009-01-31 00:02:54 +05:30
2008-11-28 16:24:56 -08:00
2009-01-08 08:31:12 -08:00
2009-01-31 00:03:40 +05:30
2008-08-05 14:33:50 -07:00
2008-10-23 00:11:07 -04:00
2009-01-06 15:59:12 -08:00
2009-01-31 00:05:30 +05:30
2008-06-11 21:00:38 -07:00
2008-10-23 18:54:05 +04:00
2008-12-20 09:15:46 +01:00
2008-05-19 16:25:39 +01:00
2009-01-16 18:02:10 +01:00
2009-01-05 18:31:12 -08:00
2008-10-02 15:53:13 -07:00
2009-01-31 00:05:59 +05:30
2008-11-12 17:17:17 -08:00
2008-11-16 19:39:21 -08:00
2008-05-25 07:09:47 +02:00
2009-01-04 13:33:20 -08:00
2009-01-07 09:58:22 +11:00
2008-07-25 10:53:42 -07:00
2008-07-24 08:31:21 -04:00
2009-02-18 15:37:53 -08:00
2009-01-31 00:06:33 +05:30
2009-02-20 17:57:48 -08:00
2008-08-05 09:28:47 +03:00
2008-07-25 10:53:30 -07:00
2008-09-09 17:41:42 +02:00
2008-06-20 14:05:53 -06:00
2008-11-24 21:27:22 -08:00
2009-01-31 00:07:00 +05:30
2008-07-20 17:12:37 -07:00
2008-11-02 10:15:07 -08:00
2009-01-08 08:31:10 -08:00
2009-01-31 00:07:31 +05:30
2009-02-11 14:25:36 -08:00
2008-10-16 11:21:47 -07:00
2008-10-07 14:43:06 -07:00
2008-10-13 09:51:40 -07:00
2009-01-01 10:12:25 +10:30
2009-02-18 15:37:53 -08:00
2008-12-12 17:01:38 +01:00
2008-09-05 14:39:38 -07:00
2009-01-02 10:19:36 -08:00
2008-07-20 17:12:34 -07:00
2008-07-21 15:15:55 -07:00
2009-01-31 00:10:59 +05:30
2009-02-18 15:37:53 -08:00
2009-01-06 15:59:09 -08:00