All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
	<richard.weinberger@gmail.com>, <linux-mtd@lists.infradead.org>,
	Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Subject: Re: [PATCH v1 0/7] Add a mtd raid layer
Date: Wed, 2 Dec 2015 09:09:36 +0800	[thread overview]
Message-ID: <565E44D0.8000708@cn.fujitsu.com> (raw)
In-Reply-To: <1448967157-17423-1-git-send-email-yangds.fnst@cn.fujitsu.com>

Adding Boris...

Hi Boris,
	I found you are working on the problem of
data lose in MLC, there is another idea to protect
the our data, by raid5. What do you think?

https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5

Yang

On 12/01/2015 06:52 PM, Dongsheng Yang wrote:
> Hi guys,
> 	I am here to release v1 of the mtd raid layer. It's a layer
> shown as below:
>
> ---------      -------------
> |  ubi  |      |  mtdchar  |
> ---------      -------------
>     |                |
>     v                v
> ----------------------------
> |        MTD RAID          |    <----- a new layer here (drivers/mtd/mtd_raid/*)
> ----------------------------
>             |
>             v
>     ----------------
>     |   mtd driver |
>     ----------------
>
> Of course, that's optional.
>
> There are two ways to use mtd raid.
> (1). For multi-chips driver:
>
> 	   /dev/mtd0
> |--------------------------------|
> |  ----------------------------  |
> |  |        MTD RAID          |  |
> |  ----------------------------  |
> |      |             |           |
> |      v             v           |
> |  -----------   -----------     |
> |  | mtd_info|   | mtd_info|     |
> |  -----------   -----------     |
> |--------------------------------|
>
> When a driver have multiple chips, we can use mtd raid framework to build
> them into a raid array and expose a mtd device. There are some drivers
> are using mtd_concat, we can do the same thing with mtd_single. At the same
> time, mtd raid provides more choices to them, such as raid0 or raid1.
>
> (2). For user:
>
>             /dev/mtd2
> |--------------------------------|
> |  ----------------------------  |
> |  |        MTD RAID          |  |
> |  ----------------------------  |
> |      |             |           |
> |      v             v           |
> |  -----------   -----------     |
> |  |/dev/mtd0|   |/dev/mtd1|     |
> |  -----------   -----------     |
> |--------------------------------|
>
> we have a user tool for mtd raid, and user can use it to build raid array.
>
> Example:
> 	# mtd_raid create --level=0 /dev/mtd0 /dev/mtd1 /dev/mtd2 /dev/mtd3
> 	# mtdinfo /dev/mtd4
> 	mtd4
> 	Name:                           mtdraid0-1
> 	Type:                           nand
> 	Eraseblock size:                65536 bytes, 64.0 KiB
> 	Amount of eraseblocks:          8192 (536870912 bytes, 512.0 MiB)
> 	Minimum input/output unit size: 512 bytes
> 	Sub-page size:                  256 bytes
> 	OOB size:                       16 bytes
> 	Character device major/minor:   90:8
> 	Bad blocks are allowed:         true
> 	Device is writable:             true
>
> There are 4 mtd devices simulated by nandsim, then we create a raid0 with
> them.
> ---------------------------------------------------------------------------
> | device| size |  throughput (dd if=/dev/mtdX of=/dev/null bs=1M count=10)|
> |--------------------------------------------------------------------------
> | mtd0  | 128M |  14.0 MB/s						  |
> |--------------------------------------------------------------------------
> | mtd1  | 128M |  14.0 MB/s						  |
> |--------------------------------------------------------------------------
> | mtd2  | 128M |  14.0 MB/s						  |
> |--------------------------------------------------------------------------
> | mtd3  | 128M |  14.0 MB/s						  |
> |--------------------------------------------------------------------------
> | mtd4  | 512M |  51.1 MB/s						  |
> ---------------------------------------------------------------------------
>
> Also we can use raid1 to get a mirror for robustness.
>
> TODO:
> 	In this framework, we can implement more raid levels. The most useful
> one I think is raid5/6, which would do a parity and fixup work in reading. That's
> important for MLC or TLC. Raid-level is refered to:
>
> https://en.wikipedia.org/wiki/Standard_RAID_levels
>
>
> Code:
> 	kernel:  https://github.com/yangdongsheng/linux  mtd_raid_v1
> 	user  :  https://github.com/yangdongsheng/mtd-utils mtd_raid_v1
>
> Thanx
> Yang
>
> Dongsheng Yang (7):
>    mtd: nandsim: remove the abuse of reference to globle variable.
>    mtd: nansim: add support of multi devices.
>    mtd: mtd_raid: Init a new layer of MTD RAID
>    mtd: mtd_raid: introduce raid single implementation
>    mtd: mtd_raid: introduce raid0 implementation
>    mtd: mtd_raid: introduce raid1 implementation
>    mtd: mtd_raid: implement ioctl for mtd raid
>
>   Documentation/ioctl/ioctl-number.txt |    1 +
>   drivers/mtd/Kconfig                  |    2 +
>   drivers/mtd/Makefile                 |    1 +
>   drivers/mtd/mtd_raid/Kconfig         |   12 +
>   drivers/mtd/mtd_raid/Makefile        |    3 +
>   drivers/mtd/mtd_raid/core.c          | 1000 ++++++++++++++++++++++++++++++++++
>   drivers/mtd/mtd_raid/ioctl.c         |  137 +++++
>   drivers/mtd/mtd_raid/mtd_raid.h      |  264 +++++++++
>   drivers/mtd/mtd_raid/raid0.c         |  136 +++++
>   drivers/mtd/mtd_raid/raid1.c         |  156 ++++++
>   drivers/mtd/mtd_raid/raid_io.c       |  449 +++++++++++++++
>   drivers/mtd/mtd_raid/raid_single.c   |  156 ++++++
>   drivers/mtd/nand/nandsim.c           |  312 ++++++-----
>   include/uapi/mtd/mtd-raid-user.h     |   33 ++
>   14 files changed, 2518 insertions(+), 144 deletions(-)
>   create mode 100644 drivers/mtd/mtd_raid/Kconfig
>   create mode 100644 drivers/mtd/mtd_raid/Makefile
>   create mode 100644 drivers/mtd/mtd_raid/core.c
>   create mode 100644 drivers/mtd/mtd_raid/ioctl.c
>   create mode 100644 drivers/mtd/mtd_raid/mtd_raid.h
>   create mode 100644 drivers/mtd/mtd_raid/raid0.c
>   create mode 100644 drivers/mtd/mtd_raid/raid1.c
>   create mode 100644 drivers/mtd/mtd_raid/raid_io.c
>   create mode 100644 drivers/mtd/mtd_raid/raid_single.c
>   create mode 100644 include/uapi/mtd/mtd-raid-user.h
>

      parent reply	other threads:[~2015-12-02  1:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 10:52 [PATCH v1 0/7] Add a mtd raid layer Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 1/7] mtd: nandsim: remove the abuse of reference to globle variable Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 2/7] mtd: nansim: add support of multi devices Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 3/7] mtd: mtd_raid: Init a new layer of MTD RAID Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 4/7] mtd: mtd_raid: introduce raid single implementation Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 5/7] mtd: mtd_raid: introduce raid0 implementation Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 6/7] mtd: mtd_raid: introduce raid1 implementation Dongsheng Yang
2015-12-01 10:52 ` [PATCH v1 7/7] mtd: mtd_raid: implement ioctl for mtd raid Dongsheng Yang
2015-12-01 10:53 ` [PATCH] mtd-utils: introduce mtd_raid tool Dongsheng Yang
2015-12-02  1:09 ` Dongsheng Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565E44D0.8000708@cn.fujitsu.com \
    --to=yangds.fnst@cn.fujitsu.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.weinberger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.