Revert "ANDROID: dm verity: add minimum prefetch size"
authorSami Tolvanen <samitolvanen@google.com>
Fri, 11 Jan 2019 00:07:19 +0000 (16:07 -0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:32:11 +0000 (17:32 +0800)
This reverts commit ace74ccf82cfb2b73ce1df2e698d20c2fbc559dd.

Mot-CRs-fixed: (CR)

Bug: 71728490
Change-Id: Iebcb0cd9982f36c4bd2552811f9147325a291db0
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-on: https://gerrit.mot.com/1427695
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/md/Kconfig
drivers/md/dm-verity-target.c

index ec359e16525b2d8f9b4654c069e4e8a5e0886813..e458bd8519e801a652eb94d9cd6578af984a16db 100644 (file)
@@ -460,21 +460,6 @@ config DM_VERITY
 
          If unsure, say N.
 
-config DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
-       bool "Prefetch size 128"
-
-config DM_VERITY_HASH_PREFETCH_MIN_SIZE
-       int "Verity hash prefetch minimum size"
-       depends on DM_VERITY
-       range 1 4096
-       default 128 if DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
-       default 1
-       ---help---
-         This sets minimum number of hash blocks to prefetch for dm-verity.
-         For devices like eMMC, having larger prefetch size like 128 can improve
-         performance with increased memory consumption for keeping more hashes
-         in RAM.
-
 config DM_VERITY_FEC
        bool "Verity forward error correction support"
        depends on DM_VERITY
@@ -574,7 +559,6 @@ config DM_ANDROID_VERITY
        depends on KEYS
        depends on ASYMMETRIC_KEY_TYPE
        depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE
-       select DM_VERITY_HASH_PREFETCH_MIN_SIZE_128
        ---help---
          This device-mapper target is virtually a VERITY target. This
          target is setup by reading the metadata contents piggybacked
index 9ace1c8401be96480e98aefe00f00fc8d8093b75..23600f24faffa36cd9cbf42899c8f46d8fe7d50b 100644 (file)
@@ -625,7 +625,6 @@ static void verity_prefetch_io(struct work_struct *work)
                container_of(work, struct dm_verity_prefetch_work, work);
        struct dm_verity *v = pw->v;
        int i;
-       sector_t prefetch_size;
 
        for (i = v->levels - 2; i >= 0; i--) {
                sector_t hash_block_start;
@@ -648,14 +647,8 @@ static void verity_prefetch_io(struct work_struct *work)
                                hash_block_end = v->hash_blocks - 1;
                }
 no_prefetch_cluster:
-               // for emmc, it is more efficient to send bigger read
-               prefetch_size = max((sector_t)CONFIG_DM_VERITY_HASH_PREFETCH_MIN_SIZE,
-                       hash_block_end - hash_block_start + 1);
-               if ((hash_block_start + prefetch_size) >= (v->hash_start + v->hash_blocks)) {
-                       prefetch_size = hash_block_end - hash_block_start + 1;
-               }
                dm_bufio_prefetch(v->bufio, hash_block_start,
-                                 prefetch_size);
+                                 hash_block_end - hash_block_start + 1);
        }
 
        kfree(pw);