[PATCH] [RFC/PATCH] SD/MMC: support adjust bounce buffer size dynamically in menuconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Improve IO throughput according to different controllers.
Make it configuable in menuconfig. Of course, there is another
implement of adjust bounce buffer size at run-time. Like:
echo 262144 > /sys/block/mmcblk0/device/bouncesz
This will reinit mmc queue when bounce size is changed.
Which is better?

On powerpc platform, 256KiB will get better perfromance than 64KiB.
I used Sandisk Extreme III Class 6, 4G memory card, tested on P1022DS
with IOzone. P1022DS memory is 1GBytes. Filesystem is ext4.
By default, bounce buffer size is 64KiB,
[root@p1022ds root]# iozone -Rab result -i0 -i1 -r64 -n1g -g2g -f /mnt/ff
	     KB  reclen   write rewrite    read    reread
	1048576      64   12794   13260    32330    31731
	2097152      64   12301   12382    18213    18239
use 256KiB as bounce buffer size,
[root@p1022ds root]# iozone -Rab result -i0 -i1 -r64 -n1g -g2g -f /mnt/ff
             KB  reclen   write rewrite    read    reread
	1048576      64   18533   19076    22841    23151
	2097152      64   17744   17980    18333    18342

Signed-off-by: Qiang Liu <qiang.liu@xxxxxxxxxxxxx>
---
 drivers/mmc/card/Kconfig |    9 +++++++++
 drivers/mmc/card/queue.c |    2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/Kconfig b/drivers/mmc/card/Kconfig
index 3b1f783..3390154 100644
--- a/drivers/mmc/card/Kconfig
+++ b/drivers/mmc/card/Kconfig
@@ -50,6 +50,15 @@ config MMC_BLOCK_BOUNCE

 	  If unsure, say Y here.

+config MMC_QUEUE_BOUNCESZ
+	int "MMC memory card bounce buffer size"
+	depends on MMC_BLOCK_BOUNCE
+	range 512 4194304
+	default "65536"
+	help
+	  Provide a flexible method to adjust bounce buffer size to
+	  improve the throughput according to different controller.
+
 config SDIO_UART
 	tristate "SDIO UART/GPS class support"
 	help
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index dcad59c..590723f 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -20,7 +20,7 @@
 #include <linux/mmc/host.h>
 #include "queue.h"

-#define MMC_QUEUE_BOUNCESZ	65536
+#define MMC_QUEUE_BOUNCESZ	CONFIG_MMC_QUEUE_BOUNCESZ

 #define MMC_QUEUE_SUSPENDED	(1 << 0)

--
1.6.4


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux