Files
ubports_kernel_google_msm/include/linux
Anton Blanchard e269b08517 iommu: inline iommu_num_pages
A profile of a network benchmark showed iommu_num_pages rather high up:

     0.52%  iommu_num_pages

Looking at the profile, an integer divide is taking almost all of the time:

      %
         :      c000000000376ea4 <.iommu_num_pages>:
    1.93 :      c000000000376ea4:       fb e1 ff f8     std     r31,-8(r1)
    0.00 :      c000000000376ea8:       f8 21 ff c1     stdu    r1,-64(r1)
    0.00 :      c000000000376eac:       7c 3f 0b 78     mr      r31,r1
    3.86 :      c000000000376eb0:       38 84 ff ff     addi    r4,r4,-1
    0.00 :      c000000000376eb4:       38 05 ff ff     addi    r0,r5,-1
    0.00 :      c000000000376eb8:       7c 84 2a 14     add     r4,r4,r5
   46.95 :      c000000000376ebc:       7c 00 18 38     and     r0,r0,r3
   45.66 :      c000000000376ec0:       7c 84 02 14     add     r4,r4,r0
    0.00 :      c000000000376ec4:       7c 64 2b 92     divdu   r3,r4,r5
    0.00 :      c000000000376ec8:       38 3f 00 40     addi    r1,r31,64
    0.00 :      c000000000376ecc:       eb e1 ff f8     ld      r31,-8(r1)
    1.61 :      c000000000376ed0:       4e 80 00 20     blr

Since every caller of iommu_num_pages passes in a constant power of two
we can inline this such that the divide is replaced by a shift. The
entire function is only a few instructions once optimised, so it is
a good candidate for inlining overall.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-09 20:45:05 -07:00
..
2010-07-31 14:20:02 +01:00
2010-08-02 15:03:21 -03:00
2010-05-28 01:38:00 +02:00
2010-08-05 13:26:20 +01:00
2010-06-04 16:00:42 -04:00
2010-06-15 09:56:01 +10:00
2010-05-27 09:12:53 -07:00
2010-06-24 21:30:09 -07:00
2010-08-06 15:36:47 -05:00
2010-08-04 11:00:45 +02:00
2010-08-05 09:22:31 -05:00
2010-07-12 14:41:40 +02:00
2010-05-25 08:07:01 -07:00
2010-05-27 09:12:42 -07:00
2010-07-19 11:54:16 +02:00
2010-06-16 18:08:13 +02:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-06-23 13:16:38 -07:00
2010-08-09 20:45:05 -07:00
2010-06-22 08:07:01 +02:00
2010-07-19 22:01:26 -07:00
2010-06-03 03:21:52 -07:00
2010-08-09 20:44:58 -07:00
2010-06-29 10:07:09 +02:00
2010-08-02 06:39:44 +03:00
2010-08-01 10:47:00 +03:00
2010-07-06 13:45:24 -04:00
2010-06-16 18:03:15 +02:00
2010-07-14 17:14:00 +10:00
2010-08-09 20:45:02 -07:00
2010-06-03 03:21:52 -07:00
2010-08-09 20:45:00 -07:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-07-02 21:59:08 -07:00
2010-07-05 16:14:52 -06:00
2010-07-05 16:14:25 -06:00
2010-07-24 09:58:22 -06:00
2010-08-09 20:45:02 -07:00
2010-07-31 19:53:06 +08:00
2010-07-30 09:29:35 -07:00
2010-06-03 03:21:52 -07:00
2010-07-19 01:58:48 +02:00
2010-07-19 01:58:48 +02:00
2010-06-03 03:21:52 -07:00
2010-07-19 11:02:51 +02:00
2010-05-27 09:12:50 -07:00
2010-05-30 09:02:47 -07:00
2010-07-22 13:46:21 -07:00
2010-08-09 20:45:02 -07:00
2010-06-03 03:21:52 -07:00
2010-05-25 11:41:43 -04:00
2010-08-03 00:31:48 -07:00
2010-06-16 14:55:35 -07:00
2010-08-09 20:45:04 -07:00
2010-07-21 21:43:06 +02:00
2010-08-06 10:37:02 -04:00
2010-08-02 10:37:17 -05:00
2010-06-03 03:21:52 -07:00