Skip to content

Commit d3df046

Browse files
LuPoMicronstorulf
authored andcommitted
mmc: remove bondage between REQ_META and reliable write
Anytime a write operation is performed with Reliable Write flag enabled, the eMMC device is enforced to bypass the cache and do a write to the underling NVM device by Jedec specification; this causes a performance penalty since write operations can't be optimized by the device cache. In our tests, we replayed a typical mobile daily trace pattern and found ~9% overall time reduction in trace replay by using this patch. Also the write ops within 4KB~64KB chunk size range get a 40~60% performance improvement by using the patch (as this range of write chunks are the ones affected by REQ_META). This patch has been discussed in the Mobile & Embedded Linux Storage Forum and it's the results of feedbacks from many people. We also checked with fsdevl and f2fs mailing list developers that this change in the usage of REQ_META is not affecting FS behavior and we got positive feedbacks. Reporting here the feedbacks: http://comments.gmane.org/gmane.linux.file-systems/97219 http://thread.gmane.org/gmane.linux.file-systems.f2fs/3178/focus=3183 Signed-off-by: Bruce Ford <[email protected]> Signed-off-by: Luca Porzio <[email protected]> Fixes: ce39f9d ("mmc: support packed write command for eMMC4.5 devices") Signed-off-by: Ulf Hansson <[email protected]>
1 parent 3d35877 commit d3df046

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/mmc/card/block.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ MODULE_ALIAS("mmc:block");
6565
#define MMC_SANITIZE_REQ_TIMEOUT 240000
6666
#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
6767

68-
#define mmc_req_rel_wr(req) (((req->cmd_flags & REQ_FUA) || \
69-
(req->cmd_flags & REQ_META)) && \
68+
#define mmc_req_rel_wr(req) ((req->cmd_flags & REQ_FUA) && \
7069
(rq_data_dir(req) == WRITE))
7170
#define PACKED_CMD_VER 0x01
7271
#define PACKED_CMD_WR 0x02
@@ -1467,13 +1466,9 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
14671466

14681467
/*
14691468
* Reliable writes are used to implement Forced Unit Access and
1470-
* REQ_META accesses, and are supported only on MMCs.
1471-
*
1472-
* XXX: this really needs a good explanation of why REQ_META
1473-
* is treated special.
1469+
* are supported only on MMCs.
14741470
*/
1475-
bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
1476-
(req->cmd_flags & REQ_META)) &&
1471+
bool do_rel_wr = (req->cmd_flags & REQ_FUA) &&
14771472
(rq_data_dir(req) == WRITE) &&
14781473
(md->flags & MMC_BLK_REL_WR);
14791474

0 commit comments

Comments
 (0)