mei: me: set internal pg flag to off on hardware reset
Sasha Levin
maintainerPATCH 1/3 mei: me: set internal pg flag to off on hardware reset
From: Alexander Usyskin <[email protected]>
[ Upstream commit 9f4639373e6756e1ccf0029f861f1061db3c3616 ]
Link reset flow is always performed in the runtime resumed state. The internal PG state may be left as ON after the suspend and will not be updated upon the resume if the D0i3 is not supported.
Ensure that the internal PG state is set to the right value on the flow entrance in case the firmware does not support D0i3.
--- drivers/misc/mei/hw-me.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/misc/mei/hw-me.c +2 -0
@@ -1061,6 +1061,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) ret =mei_me_d0i3_exit_sync (dev);if (ret)return ret; + }else { + hw->pg_state =MEI_PG_OFF ; } }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/3 ext4: improve write performance with disabled delalloc
From: Jan Kara <[email protected]>
[ Upstream commit 8d5459c11f548131ce48b2fbf45cccc5c382558f ]
When delayed allocation is disabled (either through mount option or because we are running low on free space), ext4_write_begin() allocates blocks with EXT4_GET_BLOCKS_IO_CREATE_EXT flag. With this flag extent merging is disabled and since ext4_write_begin() is called for each page separately, we end up with a *lot* of 1 block extents in the extent tree and following writeback is writing 1 block at a time which results in very poor write throughput (4 MB/s instead of 200 MB/s). These days when ext4_get_block_unwritten() is used only by ext4_write_begin(), ext4_page_mkwrite() and inline data conversion, we can safely allow extent merging to happen from these paths since following writeback will happen on different boundaries anyway. So use EXT4_GET_BLOCKS_CREATE_UNRIT_EXT instead which restores the performance.
--- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/inode.c +1 -1
@@ -791,7 +791,7 @@ int ext4_get_block_unwritten(struct inode *inode, sector_t iblock,ext4_debug ("ext4_get_block_unwritten: inode %lu, create flag %d\n" , inode->i_ino, create);return _ext4_get_block (inode, iblock, bh_result, -EXT4_GET_BLOCKS_IO_CREATE_EXT ); +EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT ); }/* Maximum number of blocks we map for direct IO at once. */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/3 ext4: correct the judgment of BUG in ext4_mb_normalize_request
In reply to Sasha LevinFrom: Baokun Li <[email protected]>
[ Upstream commit cf4ff938b47fc5c00b0ccce53a3b50eca9b32281 ]
ext4_mb_normalize_request() can move logical start of allocated blocks to reduce fragmentation and better utilize preallocation. However logical block requested as a start of allocation (ac->ac_o_ex.fe_logical) should always be covered by allocated blocks so we should check that by modifying and to or in the assertion.
--- fs/ext4/mballoc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
fs/ext4/mballoc.c +16 -1
@@ -3214,7 +3214,22 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac, }rcu_read_unlock (); -if (start + size <= ac->ac_o_ex.fe_logical && +/* +* In this function "start" and "size" are normalized for better +* alignment and length such that we could preallocate more blocks. +* This normalization is done such that original request of +* ac->ac_o_ex.fe_logical & fe_len should always lie within "start" and +* "size" boundaries. +* (Note fe_len can be relaxed since FS block allocation API does not +* provide gurantee on number of contiguous blocks allocation since that +* depends upon free space left, etc). +* In case of inode pa, later we use the allocated blocks +* [pa_start + fe_logical - pa_lstart, fe_len/size] from the preallocated +* range of goal/best blocks [start, size] to put it at the +* ac_o_ex.fe_logical extent of this inode. +* (See ext4_mb_use_inode_pa() for more details) +*/ +if (start + size <= ac->ac_o_ex.fe_logical || start > ac->ac_o_ex.fe_logical) { ext4_msg(ac->ac_sb, KERN_ERR, "start %lu, size %lu, fe_logical %lu",
Signature · 1 line
2.35.1