Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313166 > unrolled thread

Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL

Started byJoerg Roedel <joro@8bytes.org>
First post2016-01-20 13:10 +0100
Last post2016-01-21 03:10 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL Joerg Roedel <joro@8bytes.org> - 2016-01-20 13:10 +0100
    Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL Huang Shijie <shijie.huang@arm.com> - 2016-01-20 14:40 +0100
      Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL Robin Murphy <robin.murphy@arm.com> - 2016-01-20 15:50 +0100
        Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is  NULL "Jon Medhurst (Tixy)" <tixy@linaro.org> - 2016-01-20 17:10 +0100
        Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL Huang Shijie <shijie.huang@arm.com> - 2016-01-21 03:10 +0100

#1313166 — Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL

FromJoerg Roedel <joro@8bytes.org>
Date2016-01-20 13:10 +0100
SubjectRe: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL
Message-ID<qSZKi-68m-5@gated-at.bofh.it>
On Tue, Jan 12, 2016 at 10:15:05AM +0800, Huang Shijie wrote:
> This patch adds a shortcut for the code when the @device_node is NULL.
> In my juno-r1 board, the boot time can be faster by 0.004014s.

How have you made sure this number is reliable and not just noise in the
boot process?


	Joerg

[toc] | [next] | [standalone]


#1313228

FromHuang Shijie <shijie.huang@arm.com>
Date2016-01-20 14:40 +0100
Message-ID<qT19p-78z-13@gated-at.bofh.it>
In reply to#1313166
On Wed, Jan 20, 2016 at 01:02:25PM +0100, Joerg Roedel wrote:
> On Tue, Jan 12, 2016 at 10:15:05AM +0800, Huang Shijie wrote:
> > This patch adds a shortcut for the code when the @device_node is NULL.
> > In my juno-r1 board, the boot time can be faster by 0.004014s.
> 
> How have you made sure this number is reliable and not just noise in the
> boot process?
In the boot process, there are 5 or more modules whose @dev_node are
NULL. Without the patch, the kernel will waste some cycles to do the
meaningless calculations for all these modules. In theory, it is not noise.
If you have interest, I can send you the kernel boot logs. :)

Of course, the 0.004014s maybe not accurate enough, it is just an
approximate number.

Thanks
Huang Shijie

[toc] | [prev] | [next] | [standalone]


#1313264

FromRobin Murphy <robin.murphy@arm.com>
Date2016-01-20 15:50 +0100
Message-ID<qT2f7-7Ty-9@gated-at.bofh.it>
In reply to#1313228
On 20/01/16 13:34, Huang Shijie wrote:
> On Wed, Jan 20, 2016 at 01:02:25PM +0100, Joerg Roedel wrote:
>> On Tue, Jan 12, 2016 at 10:15:05AM +0800, Huang Shijie wrote:
>>> This patch adds a shortcut for the code when the @device_node is NULL.
>>> In my juno-r1 board, the boot time can be faster by 0.004014s.
>>
>> How have you made sure this number is reliable and not just noise in the
>> boot process?
> In the boot process, there are 5 or more modules whose @dev_node are
> NULL. Without the patch, the kernel will waste some cycles to do the
> meaningless calculations for all these modules.

With a quick counting hack, booting 4.4 on my r1 indeed shows 5 calls 
where dev_node is null. Plus 68 calls in which we waste cycles doing 
meaningless calculations when dev_node is non-null. The fundamental 
issue at hand is that the "platform bus" is a rubbish abstraction.

> In theory, it is not noise.
> If you have interest, I can send you the kernel boot logs. :)
>
> Of course, the 0.004014s maybe not accurate enough, it is just an
> approximate number.

A mean and standard deviation of at least, say, 5 runs each with and 
without the patch would be considerably more meaningful (even if still 
far from statistically significant).

Robin.

>
> Thanks
> Huang Shijie
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
>

[toc] | [prev] | [next] | [standalone]


#1313322 — Re: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL

From"Jon Medhurst (Tixy)" <tixy@linaro.org>
Date2016-01-20 17:10 +0100
SubjectRe: [PATCH] iommu/arm-smmu: add a shortcut when the @dev_node is NULL
Message-ID<qT3uz-vq-51@gated-at.bofh.it>
In reply to#1313264
On Wed, 2016-01-20 at 14:46 +0000, Robin Murphy wrote:
> > Of course, the 0.004014s maybe not accurate enough, it is just an
> > approximate number.
> 
> A mean and standard deviation of at least, say, 5 runs each with and 
> without the patch would be considerably more meaningful (even if
> still 
> far from statistically significant).

It wouldn't surprise me if replacing the proposed change with an 'asm
volatile("nop")' or two also give a boot time delta of several
milliseconds (due to change in cache line alignment of functions). I
don't believe you can reliably measure such minor changes.

It doesn't mean that the proposed change isn't a good addition though,
it obviously results in less code getting executed for the cost of one
or two instructions for a compare and branch. 

-- 
Tixy

[toc] | [prev] | [next] | [standalone]


#1313815

FromHuang Shijie <shijie.huang@arm.com>
Date2016-01-21 03:10 +0100
Message-ID<qTcRb-6Re-9@gated-at.bofh.it>
In reply to#1313264
On Wed, Jan 20, 2016 at 02:46:34PM +0000, Robin Murphy wrote:
> On 20/01/16 13:34, Huang Shijie wrote:
> >On Wed, Jan 20, 2016 at 01:02:25PM +0100, Joerg Roedel wrote:
> >>On Tue, Jan 12, 2016 at 10:15:05AM +0800, Huang Shijie wrote:
> >>>This patch adds a shortcut for the code when the @device_node is NULL.
> >>>In my juno-r1 board, the boot time can be faster by 0.004014s.
> >>
> >>How have you made sure this number is reliable and not just noise in the
> >>boot process?
> >In the boot process, there are 5 or more modules whose @dev_node are
> >NULL. Without the patch, the kernel will waste some cycles to do the
> >meaningless calculations for all these modules.
>
> With a quick counting hack, booting 4.4 on my r1 indeed shows 5 calls where
> dev_node is null. Plus 68 calls in which we waste cycles doing meaningless
> calculations when dev_node is non-null. The fundamental issue at hand is

The 68 calls are just compare instructions, such as "b.eq".
But if the code runs to the followng branch when the @dev_node is NULL, the
instructions executed will more the 68 calls (even including
some read memory instructions when try to grab the locks).

> that the "platform bus" is a rubbish abstraction.
This is just a small trivial patch, please ignore it if we think it is
no use. :)

thanks
Huang Shijie
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web