From: Marc Dietrich <marvin24@gmx.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-tegra@vger.kernel.org, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Sakshi Bansal <sakshi.april5@gmail.com>
Subject: Re: [PATCH] staging: nvec: fixed few coding style warnings
Date: Thu, 15 Oct 2015 11:15:07 +0200 [thread overview]
Message-ID: <3046503.lL92KFT0lm@fb07-iapwap2> (raw)
In-Reply-To: <20151015084812.GP7289@mwanda>
[-- Attachment #1.1: Type: text/plain, Size: 1239 bytes --]
Am Donnerstag, 15. Oktober 2015, 11:48:12 schrieb Dan Carpenter:
> On Thu, Oct 15, 2015 at 10:39:02AM +0200, Marc Dietrich wrote:
> > > > - if (unlikely(nvec->rx == NULL)) {
> > > > + if (!unlikely(nvec->rx)) {
> > >
> > > This isn't right. You intented to say:
> > > if (unlikely(!nvec->rx)) {
> > >
> > > But even better to just remove the unlikely entirely.
> > >
> > > if (!nvec->rx) {
> >
> > why? the "unlikely" is there to optimize a critical interrupt path.
>
> The rule is that drivers should not use likely/unlikely() unless there
> is a difference in benchmark numbers.
well, we know that additional cpu cycles in this path break transfer for
unknown reasons. However, the unlikely here may be overkill. On the other
hand, I prefer not to change something here until these timing effects are
better understood.
> How critical can it be when it's
> always followed by a udelay(100)???
yes, this delay shouldn't be there at all. This is one of the timing mysteries
we still have to resolve.
> There are more important optimizations needed here.
sure. We are currently trying to move all this out into the tegra-i2c driver,
so this code block will get a major review/rewrite in the near future anyway.
Marc
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 169 bytes --]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
WARNING: multiple messages have this Message-ID (diff)
From: Marc Dietrich <marvin24@gmx.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, linux-tegra@vger.kernel.org,
Sakshi Bansal <sakshi.april5@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: nvec: fixed few coding style warnings
Date: Thu, 15 Oct 2015 11:15:07 +0200 [thread overview]
Message-ID: <3046503.lL92KFT0lm@fb07-iapwap2> (raw)
In-Reply-To: <20151015084812.GP7289@mwanda>
[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]
Am Donnerstag, 15. Oktober 2015, 11:48:12 schrieb Dan Carpenter:
> On Thu, Oct 15, 2015 at 10:39:02AM +0200, Marc Dietrich wrote:
> > > > - if (unlikely(nvec->rx == NULL)) {
> > > > + if (!unlikely(nvec->rx)) {
> > >
> > > This isn't right. You intented to say:
> > > if (unlikely(!nvec->rx)) {
> > >
> > > But even better to just remove the unlikely entirely.
> > >
> > > if (!nvec->rx) {
> >
> > why? the "unlikely" is there to optimize a critical interrupt path.
>
> The rule is that drivers should not use likely/unlikely() unless there
> is a difference in benchmark numbers.
well, we know that additional cpu cycles in this path break transfer for
unknown reasons. However, the unlikely here may be overkill. On the other
hand, I prefer not to change something here until these timing effects are
better understood.
> How critical can it be when it's
> always followed by a udelay(100)???
yes, this delay shouldn't be there at all. This is one of the timing mysteries
we still have to resolve.
> There are more important optimizations needed here.
sure. We are currently trying to move all this out into the tegra-i2c driver,
so this code block will get a major review/rewrite in the near future anyway.
Marc
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-10-15 9:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 14:08 [PATCH] staging: nvec: fixed few coding style warnings Sakshi Bansal
2015-10-14 18:12 ` Dan Carpenter
2015-10-14 18:12 ` Dan Carpenter
2015-10-15 8:39 ` Marc Dietrich
2015-10-15 8:39 ` Marc Dietrich
2015-10-15 8:48 ` Dan Carpenter
2015-10-15 8:48 ` Dan Carpenter
2015-10-15 9:15 ` Marc Dietrich [this message]
2015-10-15 9:15 ` Marc Dietrich
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=3046503.lL92KFT0lm@fb07-iapwap2 \
--to=marvin24@gmx.de \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=sakshi.april5@gmail.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 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.