From: Mark Brown <broonie@kernel.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org,
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Subject: Re: [PATCH] regmap: Allocate buffers with GFP_ATOMIC when fast_io == true
Date: Fri, 11 Sep 2015 18:24:44 +0100 [thread overview]
Message-ID: <20150911172443.GN20922@sirena.org.uk> (raw)
In-Reply-To: <20150911161647.GB10328@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]
On Fri, Sep 11, 2015 at 09:16:47AM -0700, Stephen Boyd wrote:
> On 09/11, Mark Brown wrote:
> > Why is this needed? If something needs fast I/O it probably doesn't
> > want to be going down any of the code paths that result in us doing
> > allocations. I'd expect either no cache, a flat cache or setting up
> > defaults at initialisation time.
> We tripped over this with regmap_bulk_write() users on the SPMI
> bus. How about going down the same paths as !map->can_multi_write
> and map->use_single_rw if fast_io == true? Something like this
> untested patch.
Hrm, OK. Bulk writes are a reasonable use case here but we should be
able to do better... if we had a cache we could bulk write directly
from the cache but I don't think the SPMI devices tend to have caches so
that won't help.
> - map->use_single_rw = config->use_single_rw;
> - map->can_multi_write = config->can_multi_write;
> + map->use_single_rw = config->use_single_rw || config->fast_io;
> + map->can_multi_write = config->can_multi_write && !config->fast_io;
The trouble with this is that you end up doing register at a time writes
which isn't ideal for performance. Unless we can figure out a way to
reliably allocate a bigger buffer ahead of time which I can't think of a
way to do reliably without just putting a random number in the config
(that we then end up either hitting or making too big) I think this is
actually a reasonable use case.
Can you redo your patch to touch only the allocations in your data paths
(I'm thinking particularly of the async changes as being unneeded, now I
look again you didn't touch the cache code anyway) and put a comment in
there about the alloc flags being used in fast path cases please?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2015-09-11 17:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 19:27 [PATCH] regmap: Allocate buffers with GFP_ATOMIC when fast_io == true Stephen Boyd
2015-09-11 10:28 ` Mark Brown
2015-09-11 16:16 ` Stephen Boyd
2015-09-11 17:24 ` Mark Brown [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=20150911172443.GN20922@sirena.org.uk \
--to=broonie@kernel.org \
--cc=adharmap@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/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