From: Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Lee Jones <lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/3] spi: added spi_resource management
Date: Wed, 2 Dec 2015 14:04:24 +0100 [thread overview]
Message-ID: <565EEC58.4040006@martin.sperl.org> (raw)
In-Reply-To: <20151202122953.GG1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On 02.12.2015 13:29, Mark Brown wrote:
> On Wed, Dec 02, 2015 at 08:30:51AM +0100, Martin Sperl wrote:
>
>>> This has exactly one (tiny) user. Why is it a separate function?
>
>> Readability, mimicking devres code and the option of adding
>> object caching/reuse here later...
>
> This is *not* helping readability.
Originally it contained a bit more code to avoid repeated allocations,
which was cut out for the initial version of the patch.
>> There is a much higher likelihood that spi_resources will be
>> allocated and then freed several times per second, so this
>> can save cpu cycles and avoid locks...
>
> In what way does splitting this over two functions helping improve
> performance? If there were multiple users or something perhaps but
> there don't appear to be.
>
It does not help performance per se, but it allows adding more
code in that location that would allow to reuse allocated objects.
As of now I will merge those 2 functions.
The bigger question (based on your comments to Patch 2/3) is:
Do you want to follow the devres approach (i.e: hiding
"struct spi_res" after allocation and returning "void *"
to the data-payload only in spi_res_alloc)?
Or do you prefer to have "struct spi_res" as an explicit member of
a structure (i.e. in Patch 2/3 "struct spi_res_replaced_transfers")?
I want to get this settled before submitting newer versions of the
other patches that address other concerns, because any changes to
spi_res design directly impact these other patches.
Thanks,
Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-12-02 13:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 13:04 [PATCH 0/3] spi: spi-message transformation framework kernel-TqfNSX0MhmxHKSADF0wUEw
[not found] ` <1448888695-2260-1-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-11-30 13:04 ` [PATCH 1/3] spi: added spi_resource management kernel-TqfNSX0MhmxHKSADF0wUEw
[not found] ` <1448888695-2260-2-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-01 21:04 ` Mark Brown
[not found] ` <20151201210410.GU1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 7:30 ` Martin Sperl
[not found] ` <56C9120A-8979-4156-B3C4-5851D695BDF0-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-02 12:29 ` Mark Brown
[not found] ` <20151202122953.GG1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 13:04 ` Martin Sperl [this message]
[not found] ` <565EEC58.4040006-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-02 13:32 ` Mark Brown
[not found] ` <20151202133232.GK1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 13:53 ` Martin Sperl
2015-11-30 13:04 ` [PATCH 2/3] spi: add initial set of spi_transfer transformation methods kernel-TqfNSX0MhmxHKSADF0wUEw
[not found] ` <1448888695-2260-3-git-send-email-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-01 21:29 ` Mark Brown
[not found] ` <20151201212929.GV1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-02 7:25 ` Martin Sperl
[not found] ` <35C5C134-8291-4856-8916-7EDDFB07A0A9-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03 0:36 ` Mark Brown
[not found] ` <20151203003618.GQ1929-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-03 6:22 ` Martin Sperl
[not found] ` <91B0D66C-97E5-4683-8896-091C4BD7FCAF-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03 14:34 ` Mark Brown
[not found] ` <20151203143417.GE5727-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-12-03 15:33 ` Martin Sperl
[not found] ` <9DF774BE-EA2B-40E8-9CBF-E0A06AB5A751-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2015-12-03 18:04 ` Mark Brown
2015-11-30 13:04 ` [PATCH 3/3] spi: bcm2835: moved to the spi_transfer transformation to avoid HW restrictions kernel-TqfNSX0MhmxHKSADF0wUEw
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=565EEC58.4040006@martin.sperl.org \
--to=kernel-tqfnsx0mhmxhksadf0wuew@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org \
--cc=lee-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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;
as well as URLs for NNTP newsgroup(s).