All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Fabio Estevam <Fabio.Estevam@freescale.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	linux-mtd@lists.infradead.org,
	Sascha Hauer <kernel@pengutronix.de>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/4] mtd: mxc_nand: fix truncate of unaligned oob copying
Date: Wed, 13 May 2015 09:44:04 +0300	[thread overview]
Message-ID: <20150513064404.GM2558@tarshish> (raw)
In-Reply-To: <20150513063903.GC28888@pengutronix.de>

Hi Uwe,

On Wed, May 13, 2015 at 08:39:03AM +0200, Uwe Kleine-König wrote:
> On Wed, May 13, 2015 at 08:12:02AM +0300, Baruch Siach wrote:
> > On Fri, May 08, 2015 at 09:24:32AM +0200, Uwe Kleine-König wrote:
> > > On Sun, May 03, 2015 at 10:18:53AM +0300, Baruch Siach wrote:
> > > > Copy to/from oob io area might not be aligned to 4 bytes. When 8 bit ECC is
> > > > used, the buffer size is 26. Add memcpy16_{to,from}io, and use them to avoid
> > > > truncating the buffer. Prefer memcpy32_{to,from}io when the buffer is properly
> > > > aligned for better performance.
> > > Did you measure this performance difference? I doubt it's worth the
> > > complexity given that we're talking about buffers with a size of up to
> > > 26 bytes.
> > 
> > We'll need both memcpy16_{to,from}io and memcpy32_{to,from}io anyway. So by 
> > "complexity" you refer to the additional alignment check and memcpy32 
> > fallback?
> I thought we could get rid of the memcpy32 variants. Where do we need
> memcpy32_* where memcpy16 wouldn't work?

memcpy16 should work, but would take twice as much IO/memory accesses. That 
would definitely affect performance, as this is the flash data read/write hot 
path. I didn't test, though.

Are you sure we want to do that?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

WARNING: multiple messages have this Message-ID (diff)
From: baruch@tkos.co.il (Baruch Siach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/4] mtd: mxc_nand: fix truncate of unaligned oob copying
Date: Wed, 13 May 2015 09:44:04 +0300	[thread overview]
Message-ID: <20150513064404.GM2558@tarshish> (raw)
In-Reply-To: <20150513063903.GC28888@pengutronix.de>

Hi Uwe,

On Wed, May 13, 2015 at 08:39:03AM +0200, Uwe Kleine-K?nig wrote:
> On Wed, May 13, 2015 at 08:12:02AM +0300, Baruch Siach wrote:
> > On Fri, May 08, 2015 at 09:24:32AM +0200, Uwe Kleine-K?nig wrote:
> > > On Sun, May 03, 2015 at 10:18:53AM +0300, Baruch Siach wrote:
> > > > Copy to/from oob io area might not be aligned to 4 bytes. When 8 bit ECC is
> > > > used, the buffer size is 26. Add memcpy16_{to,from}io, and use them to avoid
> > > > truncating the buffer. Prefer memcpy32_{to,from}io when the buffer is properly
> > > > aligned for better performance.
> > > Did you measure this performance difference? I doubt it's worth the
> > > complexity given that we're talking about buffers with a size of up to
> > > 26 bytes.
> > 
> > We'll need both memcpy16_{to,from}io and memcpy32_{to,from}io anyway. So by 
> > "complexity" you refer to the additional alignment check and memcpy32 
> > fallback?
> I thought we could get rid of the memcpy32 variants. Where do we need
> memcpy32_* where memcpy16 wouldn't work?

memcpy16 should work, but would take twice as much IO/memory accesses. That 
would definitely affect performance, as this is the flash data read/write hot 
path. I didn't test, though.

Are you sure we want to do that?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

  reply	other threads:[~2015-05-13  6:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03  7:18 [PATCH v2 0/4] mtd: mxc_nand: fix 8 bit ECC and large oob Baruch Siach
2015-05-03  7:18 ` Baruch Siach
2015-05-03  7:18 ` [PATCH v2 1/4] mtd: nand: mxc_nand: cleanup copy_spare function Baruch Siach
2015-05-03  7:18   ` Baruch Siach
2015-05-03  7:18 ` [PATCH v2 2/4] mtd: mxc_nand: limit the size of used oob Baruch Siach
2015-05-03  7:18   ` Baruch Siach
2015-05-03  7:18 ` [PATCH v2 3/4] mtd: mxc_nand: fix truncate of unaligned oob copying Baruch Siach
2015-05-03  7:18   ` Baruch Siach
2015-05-08  7:24   ` Uwe Kleine-König
2015-05-08  7:24     ` Uwe Kleine-König
2015-05-13  5:12     ` Baruch Siach
2015-05-13  5:12       ` Baruch Siach
2015-05-13  6:39       ` Uwe Kleine-König
2015-05-13  6:39         ` Uwe Kleine-König
2015-05-13  6:44         ` Baruch Siach [this message]
2015-05-13  6:44           ` Baruch Siach
2015-05-13  6:47           ` Uwe Kleine-König
2015-05-13  6:47             ` Uwe Kleine-König
2015-05-13  6:59             ` Baruch Siach
2015-05-13  6:59               ` Baruch Siach
2015-05-13  7:01               ` Uwe Kleine-König
2015-05-13  7:01                 ` Uwe Kleine-König
2015-05-13  7:12                 ` Baruch Siach
2015-05-13  7:12                   ` Baruch Siach
2015-05-13  7:18                   ` Uwe Kleine-König
2015-05-13  7:18                     ` Uwe Kleine-König
2015-05-03  7:18 ` [PATCH v2 4/4] mtd: mxc_nand: generate nand_ecclayout for 8 bit ECC Baruch Siach
2015-05-03  7:18   ` Baruch Siach
2015-05-08  7:21   ` Uwe Kleine-König
2015-05-08  7:21     ` Uwe Kleine-König
2015-05-08  5:15 ` [PATCH v2 0/4] mtd: mxc_nand: fix 8 bit ECC and large oob Sascha Hauer
2015-05-08  5:15   ` Sascha Hauer
2015-05-13  5:22   ` Baruch Siach
2015-05-13  5:22     ` Baruch Siach

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=20150513064404.GM2558@tarshish \
    --to=baruch@tkos.co.il \
    --cc=Fabio.Estevam@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=shawn.guo@linaro.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.