From: Kalle Valo <kvalo@qca.qualcomm.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: linville@tuxdriver.com, sfr@canb.auug.org.au,
netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
ath6kl-devel@qualcomm.com, davem@davemloft.net
Subject: Re: [PATCH v2 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK()
Date: Fri, 6 Jan 2012 10:08:46 +0200 [thread overview]
Message-ID: <4F06AC0E.1000809@qca.qualcomm.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AF33@saturn3.aculab.com>
On 01/05/2012 04:14 PM, David Laight wrote:
>
>> We don't need it as debug calls already have a log level and
>> compiler should be smart enough to optimise away the code when
>> ath6kl debug code is not enabled.
>
> Have you checked?
No, I just assumed so.
> I think you are assuming that because the called function collapses,
> the call will be removed allowing the loop to be removed. I suspect
> this is only true if the function is inlined. IIRC the normal linkage
> rules mean that only static functions are candidates for inlining.
I think you are right.
But while I investigated more I noticed that ath6kl_dump_registers()
will be an empty static inline whenever CONFIG_ATH6KL_DEBUG is disabled
and that will make sure that the whole function is not included. So
whenever ath6kl debug code is enabled there is a small performance hit,
but it's so small that IMHO we don't need to worry about it.
And for optimal performance CONFIG_ATH6KL_DEBUG should be disabled anyway.
What do you think?
Kalle
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: <linville@tuxdriver.com>, <sfr@canb.auug.org.au>,
<netdev@vger.kernel.org>, <linux-wireless@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-next@vger.kernel.org>,
<ath6kl-devel@qualcomm.com>, <davem@davemloft.net>
Subject: Re: [PATCH v2 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK()
Date: Fri, 6 Jan 2012 10:08:46 +0200 [thread overview]
Message-ID: <4F06AC0E.1000809@qca.qualcomm.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AF33@saturn3.aculab.com>
On 01/05/2012 04:14 PM, David Laight wrote:
>
>> We don't need it as debug calls already have a log level and
>> compiler should be smart enough to optimise away the code when
>> ath6kl debug code is not enabled.
>
> Have you checked?
No, I just assumed so.
> I think you are assuming that because the called function collapses,
> the call will be removed allowing the loop to be removed. I suspect
> this is only true if the function is inlined. IIRC the normal linkage
> rules mean that only static functions are candidates for inlining.
I think you are right.
But while I investigated more I noticed that ath6kl_dump_registers()
will be an empty static inline whenever CONFIG_ATH6KL_DEBUG is disabled
and that will make sure that the whole function is not included. So
whenever ath6kl debug code is enabled there is a small performance hit,
but it's so small that IMHO we don't need to worry about it.
And for optimal performance CONFIG_ATH6KL_DEBUG should be disabled anyway.
What do you think?
Kalle
next prev parent reply other threads:[~2012-01-06 8:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 13:25 [PATCH v2 0/6] ath6kl: create ath6kl_core.ko Kalle Valo
2012-01-05 13:26 ` [PATCH v2 1/6] ath6kl: rename vif init and cleanup functions Kalle Valo
2012-01-05 13:26 ` [PATCH v2 2/6] ath6kl: unify cfg80211 init/cleanup functions Kalle Valo
2012-01-05 13:27 ` [PATCH v2 3/6] ath6kl: create core.c Kalle Valo
2012-01-05 13:28 ` [PATCH v2 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK() Kalle Valo
2012-01-05 14:14 ` David Laight
2012-01-05 14:14 ` David Laight
2012-01-06 8:08 ` Kalle Valo [this message]
2012-01-06 8:08 ` Kalle Valo
2012-01-05 13:28 ` [PATCH v2 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions Kalle Valo
2012-01-05 16:38 ` Joe Perches
2012-01-06 8:14 ` Kalle Valo
2012-01-06 8:14 ` Kalle Valo
2012-01-05 13:28 ` [PATCH v2 6/6] ath6kl: create ath6kl_core.ko Kalle Valo
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=4F06AC0E.1000809@qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=David.Laight@ACULAB.COM \
--cc=ath6kl-devel@qualcomm.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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.