Eric Dumazet
15ae02baf0
lib/extable.c: remove an expensive integer divide in search_extable()
Actual code let compiler generates idiv instruction on x86.
Using a right shift is OK here and readable as well.
Before patch
10: 57 push %edi
11: 56 push %esi
12: 89 d6 mov %edx,%esi
14: 53 push %ebx
15: 89 c3 mov %eax,%ebx
17: eb 22 jmp 3b <search_extable+0x2b>
19: 89 f0 mov %esi,%eax
1b: ba 02 00 00 00 mov $0x2,%edx
20: 29 d8 sub %ebx,%eax
22: 89 d7 mov %edx,%edi
24: c1 f8 03 sar $0x3,%eax
27: 99 cltd
28: f7 ff idiv %edi
2a: 8d 04 c3 lea (%ebx,%eax,8),%eax
2d: 39 08 cmp %ecx,(%eax)
...
After patch
00000010 <search_extable>:
10: 53 push %ebx
11: 89 c3 mov %eax,%ebx
13: eb 18 jmp 2d <search_extable+0x1d>
15: 89 d0 mov %edx,%eax
17: 29 d8 sub %ebx,%eax
19: c1 f8 04 sar $0x4,%eax
1c: 8d 04 c3 lea (%ebx,%eax,8),%eax
1f: 39 08 cmp %ecx,(%eax)
...
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:08 -08:00
..
2007-07-31 15:39:37 -07:00
2007-10-20 22:30:54 +01:00
2008-02-03 17:48:52 +02:00
2007-10-11 22:17:20 -07:00
2005-10-18 08:26:15 -07:00
2007-10-20 00:26:10 +02:00
2007-05-11 05:38:25 -04:00
2007-11-05 15:12:32 -08:00
2006-12-10 10:07:52 -08:00
2007-07-16 09:05:51 -07:00
2007-10-17 08:42:56 -07:00
2007-07-16 09:05:50 -07:00
2007-02-11 10:51:32 -08:00
2007-05-07 12:12:51 -07:00
2007-07-17 10:23:04 -07:00
2006-06-25 10:01:20 -07:00
2008-02-03 17:48:52 +02:00
2005-04-16 15:20:36 -07:00
2006-06-25 10:01:20 -07:00
2007-05-10 18:24:13 +02:00
2005-04-16 15:20:36 -07:00
2006-07-03 15:27:01 -07:00
2006-01-08 20:13:48 -08:00
2007-04-28 14:15:58 -04:00
2007-04-25 22:28:53 -07:00
2005-04-16 15:20:36 -07:00
2008-02-06 10:41:08 -08:00
2007-07-24 12:24:59 -07:00
2008-01-28 23:58:27 -05:00
2005-04-16 15:20:36 -07:00
2007-07-17 10:23:02 -07:00
2005-04-16 15:20:36 -07:00
2007-11-29 09:24:53 -08:00
2007-10-19 11:53:41 -07:00
2007-10-17 08:42:45 -07:00
2007-05-02 19:27:15 +02:00
2006-02-03 08:32:08 -08:00
2006-06-20 20:24:58 -07:00
2007-10-17 08:42:57 -07:00
2008-02-05 09:44:11 -08:00
2007-10-17 08:42:50 -07:00
2006-10-06 08:53:40 -07:00
2007-07-31 15:39:39 -07:00
2007-08-22 19:52:45 -07:00
2008-02-03 08:58:07 +01:00
2008-01-25 21:08:33 +01:00
2006-09-25 21:08:40 -07:00
2008-01-24 21:59:04 -08:00
2008-02-02 15:14:48 -08:00
2008-01-24 20:40:05 -08:00
2007-11-08 21:34:09 +08:00
2006-12-07 08:39:35 -08:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-12-07 08:39:43 -08:00
2008-02-05 09:44:11 -08:00
2007-05-03 03:10:39 -07:00
2008-01-28 15:00:35 -08:00
2007-10-19 11:53:44 -07:00
2006-06-27 17:32:46 -07:00
2007-10-19 11:53:41 -07:00
2005-04-16 15:20:36 -07:00
2007-12-23 12:54:37 -08:00
2008-02-05 09:44:17 -08:00
2006-12-04 02:00:22 -05:00
2006-09-30 20:26:56 +02:00
2006-12-13 09:05:49 -08:00
2006-10-11 01:45:14 -04:00
2008-01-30 13:33:00 +01:00
2008-01-28 10:54:49 +01:00
2006-06-30 19:25:36 +02:00
2007-02-11 10:51:32 -08:00
2005-10-30 17:37:32 -08:00
2007-10-17 08:42:52 -07:00
2007-10-19 11:53:43 -07:00
2007-04-26 01:54:39 -07:00
2008-02-05 09:44:12 -08:00
2007-12-01 00:03:52 +11:00
2006-08-22 14:33:58 -07:00
2006-09-29 09:18:23 -07:00
2006-06-30 19:25:36 +02:00
2007-07-31 15:39:39 -07:00