From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] raw read performance improvement
Date: Sat, 28 Jun 2014 09:46:12 -0700 [thread overview]
Message-ID: <53AEF154.6010303@linux.intel.com> (raw)
In-Reply-To: <53AECDC4.7070407@kernel.org>
On 06/28/2014 07:14 AM, Jonathan Cameron wrote:
> On 28/06/14 14:16, Srinivas Pandruvada wrote:
>>
>> On 06/28/2014 01:49 AM, Jonathan Cameron wrote:
>>> On 27/06/14 01:40, Srinivas Pandruvada wrote:
>>>> We see several performance issues reading individual axis, when
>>>> raw read is the only option. Since most of the time user space
>>>> reads x, y
>>>> and z, one after other, this results in three sysfs reads, and
>>>> based on
>>>> chipset we have to power up or set up measurement mode and wait for
>>>> response.
>>> That's probably a case for a change in the driver to schedule the power
>>> down for a little period after the read rather than immediately...
>> Agree, if we can do that. But some chips have a single measurement mode,
>> after measurement is done they go to sleep mode, like AK8975 (they
>> do have other modes with power penalty).
>>>> For example reading x,y and z takes 160ms for ak8975, it is true for
>>>> other too. But reading together takes only 80ms.
>>>>
>>>> IIO types already defined a modifier for X_AND_Y_AND_Z, which is used
>>>> by one driver to send event code. This modifier has no value assigned
>>>> so (null) appears in sysfs. If this is not correct then we may need
>>>> another modifier.
>>>>
>>>> Since we have now raw_read with capability to read multiple values,
>>>> we can use this callback to return values to iio core.
>>>>
>>> I've actually argued fairly strongly against this sort of multiple
>>> channel simply because it means there are multiple ways of
>>> presenting the
>>> same data in the ABI. The big difference with the Quaternion case is
>>> that
>>> the elements of that have no meaning whatsoever if you don't have them
>>> all.
>>>
>>> Previously any indication that people wanted higher performance reads
>>> would mean that I'd just tell them that is what the chardev interface
>>> is for. Here a simple sysfs trigger and a couple of extra lines in the
>>> driver and you'd have what you want with considerably less overhead.
>> But using these I/F, you loose IIO ABI advantage for user space. This
>> was
>> the model followed and still followed by, but requires special user
>> space changes
>> for every sensor driver. With IIO model, we let vendors pick their
>> components
>> as long as they have an IIO driver, with no change in user space.
> I'm unclear by why this needs special purpose userspace.
> Generally it's trivial to establish if a part supplies it's own
> trigger (data ready for example). If not then a sysfs trigger
> or similar is needed and can be instantiated just fine by
> generic userspace.
I misunderstood your comment. We always provide the buffer I/F, where we
have
some data ready interrupts. In this case we are fine. We don't have
sysfs triggers,
which, I should try to check how much time I can save.
>>>
>>> Hence my initial thought to this patch is that I'm not keen. However,
>>> lets let it sit for a while and see what other comments people have.
>>> Perhaps if there is enough demand I might rethink my position.
>>>
>> Let's see, I feel that it will help for phone/tablet like power
>> sensitive devices but doemands performance.
> Sure - though you are never going to get significant performance through
> sysfs interfaces... They just aren't intended for that purpose. Last
> thing we want to do is convert back and forwards from a string for
> starters!
I am not talking about bandwidth limitation from user/kernel interface,
which sysfs is not designed for.
We have better options than even char-dev for that purpose.
I understand your point of providing a single way to present data. This
change breaks this assumption. If someone else needs,
we can discuss again.
Thanks,
Srinivas
>
> J
>>
>> Thanks,
>> Srinivas
>>
>>> Jonathan
>>>> Srinivas Pandruvada (2):
>>>> iio: core: add xyz modifier value
>>>> iio: magnetometer: ak8975: Improve performance of raw reads
>>>>
>>>> drivers/iio/industrialio-core.c | 1 +
>>>> drivers/iio/magnetometer/ak8975.c | 58
>>>> ++++++++++++++++++++++++++-------------
>>>> 2 files changed, 40 insertions(+), 19 deletions(-)
>>>>
>>>
>>>
>>
>
>
prev parent reply other threads:[~2014-06-28 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 0:40 [RFC PATCH 0/2] raw read performance improvement Srinivas Pandruvada
2014-06-27 0:40 ` [RFC PATCH 1/2] iio: core: add xyz modifier value Srinivas Pandruvada
2014-06-27 7:44 ` Daniel Baluta
2014-06-28 8:35 ` Jonathan Cameron
2014-06-27 0:40 ` [RFC PATCH 2/2] iio: magnetometer: ak8975: Improve performance of raw reads Srinivas Pandruvada
2014-06-28 8:49 ` [RFC PATCH 0/2] raw read performance improvement Jonathan Cameron
2014-06-28 13:16 ` Srinivas Pandruvada
2014-06-28 14:14 ` Jonathan Cameron
2014-06-28 16:46 ` Srinivas Pandruvada [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=53AEF154.6010303@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.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 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.