From: Jon Hunter <jon-hunter@ti.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Tony Lindgren <tony@atomide.com>, Kevin Hilman <khilman@ti.com>,
Paul Walmsley <paul@pwsan.com>,
linux-omap <linux-omap@vger.kernel.org>,
linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V2 02/14] ARM: OMAP2+: Disable posted mode for the clocksource timer
Date: Wed, 7 Nov 2012 16:41:47 -0600 [thread overview]
Message-ID: <509AE3AB.8080008@ti.com> (raw)
In-Reply-To: <509ADC5F.7020307@ti.com>
On 11/07/2012 04:10 PM, Santosh Shilimkar wrote:
> On Wednesday 07 November 2012 01:01 PM, Jon Hunter wrote:
>> When using a DMTIMER as the clock-source timer, posted mode
>> configuration of
>> the DMTIMER is used. Posted mode is only benefical when configuring
>> timers as
>> it allows writes to be posted and does not stall the CPU until the
>> write is
>> complete. The clock-source timer is only configured once on boot and
>> so using
>> posted mode has no benefit. In fact, by using posted mode, it adds
>> overhead
>> to reading the timer. Therefore, by default disable posted mode for
>> DMTIMERs
>> used for clock-source.
>>
>> Using objdump this change reduces the function clocksource_read_cycles()
>> function from a total of 15 instructions (including 3 branches and 7
>> loads)
>> to 5 instructions (including 1 branch and 3 loads). Please note that
>> before
>> the minimum number of instructions that would be executed when calling
>> clocksource_read_cycles() would be 9 instructions (including 2
>> branches and 5
>> loads) where as now it will always be 5 instructions.
>>
>> This change also reduces the function dmtimer_read_sched_clock()
>> function from
>> a total of 17 instructions (including 4 branches and 8 loads) to 6
>> instructions
>> (including 1 branch and 4 loads). Please note that before the minimum
>> number of
>> instructions that would be executed when calling
>> dmtimer_read_sched_clock()
>> would be 11 instructions (including 2 branches and 6 loads) where as
>> now it
>> will always be 6 instructions.
>>
> This isn't right way to calculate the penalty of posted mode. Non-posted
> mode can results in 100 of cycles wait over interconnect
> and that can not be justified with few instructions savings.
Right, I see your point. Non-posted reads are going to add
re-synchronisation overhead. However, our hands are tied here because of
errata i103 we can't use posted mode for reading the counter.
So may be I should squash this change with patch #3 and just make this
part of the errata workaround. I can always re-visit later and do some
profiling to see what the optimal configuration should be.
>> This change removes the configuration of posted mode from the
>> __omap_dm_timer_reset() function and adds a new function called
>> omap_dm_timer_enable_posted() for enabling posted mode. Hence, call
>> omap_dm_timer_enable_posted() where ever we are calling
>> __omap_dm_timer_reset().
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
> But clock-source doesn't involve much into writes so patch as
> such is fine.
Yes writes are only on init.
Cheers
Jon
WARNING: multiple messages have this Message-ID (diff)
From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 02/14] ARM: OMAP2+: Disable posted mode for the clocksource timer
Date: Wed, 7 Nov 2012 16:41:47 -0600 [thread overview]
Message-ID: <509AE3AB.8080008@ti.com> (raw)
In-Reply-To: <509ADC5F.7020307@ti.com>
On 11/07/2012 04:10 PM, Santosh Shilimkar wrote:
> On Wednesday 07 November 2012 01:01 PM, Jon Hunter wrote:
>> When using a DMTIMER as the clock-source timer, posted mode
>> configuration of
>> the DMTIMER is used. Posted mode is only benefical when configuring
>> timers as
>> it allows writes to be posted and does not stall the CPU until the
>> write is
>> complete. The clock-source timer is only configured once on boot and
>> so using
>> posted mode has no benefit. In fact, by using posted mode, it adds
>> overhead
>> to reading the timer. Therefore, by default disable posted mode for
>> DMTIMERs
>> used for clock-source.
>>
>> Using objdump this change reduces the function clocksource_read_cycles()
>> function from a total of 15 instructions (including 3 branches and 7
>> loads)
>> to 5 instructions (including 1 branch and 3 loads). Please note that
>> before
>> the minimum number of instructions that would be executed when calling
>> clocksource_read_cycles() would be 9 instructions (including 2
>> branches and 5
>> loads) where as now it will always be 5 instructions.
>>
>> This change also reduces the function dmtimer_read_sched_clock()
>> function from
>> a total of 17 instructions (including 4 branches and 8 loads) to 6
>> instructions
>> (including 1 branch and 4 loads). Please note that before the minimum
>> number of
>> instructions that would be executed when calling
>> dmtimer_read_sched_clock()
>> would be 11 instructions (including 2 branches and 6 loads) where as
>> now it
>> will always be 6 instructions.
>>
> This isn't right way to calculate the penalty of posted mode. Non-posted
> mode can results in 100 of cycles wait over interconnect
> and that can not be justified with few instructions savings.
Right, I see your point. Non-posted reads are going to add
re-synchronisation overhead. However, our hands are tied here because of
errata i103 we can't use posted mode for reading the counter.
So may be I should squash this change with patch #3 and just make this
part of the errata workaround. I can always re-visit later and do some
profiling to see what the optimal configuration should be.
>> This change removes the configuration of posted mode from the
>> __omap_dm_timer_reset() function and adds a new function called
>> omap_dm_timer_enable_posted() for enabling posted mode. Hence, call
>> omap_dm_timer_enable_posted() where ever we are calling
>> __omap_dm_timer_reset().
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
> But clock-source doesn't involve much into writes so patch as
> such is fine.
Yes writes are only on init.
Cheers
Jon
next prev parent reply other threads:[~2012-11-07 22:41 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-07 19:01 [PATCH V2 00/14] ARM: OMAP: DMTIMER fixes Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 01/14] ARM: OMAP: Add DMTIMER definitions for posted mode Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 22:04 ` Santosh Shilimkar
2012-11-07 22:04 ` Santosh Shilimkar
2012-11-07 22:11 ` Jon Hunter
2012-11-07 22:11 ` Jon Hunter
2012-11-07 22:18 ` Santosh Shilimkar
2012-11-07 22:18 ` Santosh Shilimkar
2012-11-07 22:47 ` Jon Hunter
2012-11-07 22:47 ` Jon Hunter
2012-11-08 16:52 ` Jon Hunter
2012-11-08 16:52 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 02/14] ARM: OMAP2+: Disable posted mode for the clocksource timer Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 22:10 ` Santosh Shilimkar
2012-11-07 22:10 ` Santosh Shilimkar
2012-11-07 22:41 ` Jon Hunter [this message]
2012-11-07 22:41 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 03/14] ARM: OMAP3+: Implement timer workaround for errata i103 and i767 Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 22:14 ` Santosh Shilimkar
2012-11-07 22:14 ` Santosh Shilimkar
2012-11-07 23:28 ` Jon Hunter
2012-11-07 23:28 ` Jon Hunter
2012-11-07 23:43 ` Santosh Shilimkar
2012-11-07 23:43 ` Santosh Shilimkar
2012-11-08 16:55 ` Jon Hunter
2012-11-08 16:55 ` Jon Hunter
2012-11-09 19:41 ` Jon Hunter
2012-11-09 19:41 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 04/14] ARM: OMAP: Fix timer posted mode support Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 22:21 ` Santosh Shilimkar
2012-11-07 22:21 ` Santosh Shilimkar
2012-11-07 19:01 ` [PATCH V2 05/14] ARM: OMAP3: Correct HWMOD DMTIMER SYSC register declarations Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 06/14] ARM: OMAP2/3: Define HWMOD software reset status for DMTIMERs Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 07/14] ARM: OMAP2+: Don't use __omap_dm_timer_reset() Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 08/14] ARM: OMAP: Fix dmtimer reset for timer1 Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 09/14] ARM: OMAP: Don't restore of DMTIMER TISTAT register Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 10/14] ARM: OMAP: Don't restore DMTIMER interrupt status register Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 11/14] ARM: OMAP: Fix spurious interrupts when using timer match feature Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 12/14] ARM: OMAP: Add dmtimer interrupt disable function Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 13/14] ARM: OMAP: Remove unnecessary call to clk_get() Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 19:01 ` [PATCH V2 14/14] ARM: OMAP: Remove __omap_dm_timer_set_source function Jon Hunter
2012-11-07 19:01 ` Jon Hunter
2012-11-07 21:22 ` [PATCH V2 00/14] ARM: OMAP: DMTIMER fixes Tony Lindgren
2012-11-07 21:22 ` Tony Lindgren
2012-11-07 21:44 ` Jon Hunter
2012-11-07 21:44 ` Jon Hunter
2012-11-07 21:52 ` Tony Lindgren
2012-11-07 21:52 ` Tony Lindgren
2012-11-07 22:27 ` Santosh Shilimkar
2012-11-07 22:27 ` Santosh Shilimkar
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=509AE3AB.8080008@ti.com \
--to=jon-hunter@ti.com \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.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.