The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: linux-usb@vger.kernel.org,
	David Brownell <dbrownell@users.sourceforge.net>,
	gregkh@suse.de, linux-kernel@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH] USB: f_mass_storage: dynamic buffers for better alignment
Date: Mon, 15 Mar 2010 20:10:21 +0200	[thread overview]
Message-ID: <20100315181020.GD3857@gandalf> (raw)
In-Reply-To: <1268647795-4095-1-git-send-email-m.nazarewicz@samsung.com>

On Mon, Mar 15, 2010 at 11:09:55AM +0100, Michal Nazarewicz wrote:
> "Static" buffers in fsg_buffhd structure (ie. fields which are arrays
> rather then pointers to dynamically allocated memory) are not aligned
> to any "big" power of two which may lead to poor DMA performance

not so true as you can add __attribute__ ((aligned(32))) to those.

> @@ -2747,13 +2746,18 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
>  
>  
>  	/* Data buffers cyclic list */
> -	/* Buffers in buffhds are static -- no need for additional
> -	 * allocation. */
>  	bh = common->buffhds;
> -	i = FSG_NUM_BUFFERS - 1;
> -	do {
> +	i = FSG_NUM_BUFFERS;
> +	for (i = FSG_NUM_BUFFERS;; ++bh) {

something like

for (i = 0; i < FSG_NUM_BUFFERS; i++, ++bh) {

wouldn't it do it ??

-- 
balbi

  reply	other threads:[~2010-03-15 18:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15 10:09 [PATCH] USB: f_mass_storage: dynamic buffers for better alignment Michal Nazarewicz
2010-03-15 18:10 ` Felipe Balbi [this message]
2010-03-15 19:20   ` Michał Nazarewicz
2010-03-15 19:28     ` Felipe Balbi
2010-03-15 19:43       ` Michał Nazarewicz
2010-03-15 20:28         ` Michal Nazarewicz
2010-03-15 20:38         ` [PATCHv3] " Michal Nazarewicz

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=20100315181020.GD3857@gandalf \
    --to=me@felipebalbi.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.nazarewicz@samsung.com \
    --cc=m.szyprowski@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox