Jesper Dangaard Brouer
fbd02630c6
slub: initial bulk free implementation
This implements SLUB specific kmem_cache_free_bulk(). SLUB allocator now
both have bulk alloc and free implemented.
Choose to reenable local IRQs while calling slowpath __slab_free(). In
worst case, where all objects hit slowpath call, the performance should
still be faster than fallback function __kmem_cache_free_bulk(), because
local_irq_{disable+enable} is very fast (7-cycles), while the fallback
invokes this_cpu_cmpxchg() which is slightly slower (9-cycles).
Nitpicking, this should be faster for N>=4, due to the entry cost of
local_irq_{disable+enable}.
Do notice that the save+restore variant is very expensive, this is key to
why this optimization works.
CPU: i7-4790K CPU @ 4.00GHz
* local_irq_{disable,enable}: 7 cycles(tsc) - 1.821 ns
* local_irq_{save,restore} : 37 cycles(tsc) - 9.443 ns
Measurements on CPU CPU i7-4790K @ 4.00GHz
Baseline normal fastpath (alloc+free cost): 43 cycles(tsc) 10.834 ns
Bulk- fallback - this-patch
1 - 58 cycles(tsc) 14.542 ns - 43 cycles(tsc) 10.811 ns improved 25.9%
2 - 50 cycles(tsc) 12.659 ns - 27 cycles(tsc) 6.867 ns improved 46.0%
3 - 48 cycles(tsc) 12.168 ns - 21 cycles(tsc) 5.496 ns improved 56.2%
4 - 47 cycles(tsc) 11.987 ns - 24 cycles(tsc) 6.038 ns improved 48.9%
8 - 46 cycles(tsc) 11.518 ns - 17 cycles(tsc) 4.280 ns improved 63.0%
16 - 45 cycles(tsc) 11.366 ns - 17 cycles(tsc) 4.483 ns improved 62.2%
30 - 45 cycles(tsc) 11.433 ns - 18 cycles(tsc) 4.531 ns improved 60.0%
32 - 75 cycles(tsc) 18.983 ns - 58 cycles(tsc) 14.586 ns improved 22.7%
34 - 71 cycles(tsc) 17.940 ns - 53 cycles(tsc) 13.391 ns improved 25.4%
48 - 80 cycles(tsc) 20.077 ns - 65 cycles(tsc) 16.268 ns improved 18.8%
64 - 71 cycles(tsc) 17.799 ns - 53 cycles(tsc) 13.440 ns improved 25.4%
128 - 91 cycles(tsc) 22.980 ns - 79 cycles(tsc) 19.899 ns improved 13.2%
158 - 100 cycles(tsc) 25.241 ns - 90 cycles(tsc) 22.732 ns improved 10.0%
250 - 102 cycles(tsc) 25.583 ns - 95 cycles(tsc) 23.916 ns improved 6.9%
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-04 16:54:41 -07:00
..
2015-08-22 14:54:55 +02:00
2015-07-02 08:46:00 -06:00
2014-10-29 16:33:15 -07:00
2015-06-30 19:44:55 -07:00
2015-04-14 16:49:03 -07:00
2015-07-17 16:39:54 -07:00
2015-06-24 17:49:44 -07:00
2015-08-14 15:56:32 -07:00
2015-04-15 16:35:20 -07:00
2014-12-13 12:42:48 -08:00
2015-05-13 14:05:12 -04:00
2014-10-09 22:26:00 -04:00
2015-06-02 08:33:35 -06:00
2015-07-04 19:36:06 -07:00
2015-06-24 17:49:45 -07:00
2015-04-15 16:35:18 -07:00
2015-08-07 04:39:42 +03:00
2015-02-11 17:06:02 -08:00
2015-06-25 17:00:35 -07:00
2015-06-24 17:49:42 -07:00
2015-06-30 19:44:56 -07:00
2015-02-10 14:30:31 -08:00
2015-07-23 20:59:41 +02:00
2015-01-08 15:10:52 -08:00
2014-10-09 22:25:50 -04:00
2015-06-24 17:49:46 -07:00
2015-04-15 16:35:18 -07:00
2015-02-12 18:54:10 -08:00
2015-08-31 12:36:10 -07:00
2015-06-02 08:33:34 -06:00
2015-04-14 16:49:06 -07:00
2015-06-30 19:44:55 -07:00
2015-06-25 16:00:17 -07:00
2015-09-04 16:54:41 -07:00
2015-08-14 15:56:32 -07:00
2015-07-09 11:12:48 -07:00
2015-06-24 17:49:46 -07:00
2015-04-15 16:35:20 -07:00
2015-06-24 17:49:44 -07:00
2015-08-07 04:39:42 +03:00
2015-02-11 17:06:06 -08:00
2015-04-14 16:49:00 -07:00
2015-06-30 19:44:56 -07:00
2015-07-10 10:39:25 -05:00
2014-11-13 13:46:09 +11:00
2015-02-11 17:06:02 -08:00
2015-06-24 17:49:41 -07:00
2015-06-24 17:49:41 -07:00
2015-02-10 14:30:31 -08:00
2015-06-30 19:44:55 -07:00
2015-09-01 18:46:42 -07:00
2015-06-24 17:49:44 -07:00
2015-08-21 14:30:10 -07:00
2015-02-11 17:06:02 -08:00
2014-12-13 12:42:48 -08:00
2015-08-13 12:32:00 -06:00
2015-05-14 17:55:51 -07:00
2015-07-17 16:39:54 -07:00
2015-08-07 04:39:42 +03:00
2015-03-25 16:20:30 -07:00
2014-09-02 14:46:05 -04:00
2014-09-02 14:46:02 -04:00
2015-07-21 11:31:00 -04:00
2015-06-24 17:49:44 -07:00
2015-04-11 22:27:12 -04:00
2015-06-02 08:33:35 -06:00
2015-06-25 16:00:17 -07:00
2015-08-07 04:39:41 +03:00
2015-09-04 16:54:41 -07:00
2015-09-04 16:54:41 -07:00
2015-09-04 16:54:41 -07:00
2015-09-04 16:54:41 -07:00
2015-09-04 16:54:41 -07:00
2014-12-10 17:41:09 -08:00
2015-04-15 16:35:18 -07:00
2015-06-24 17:49:42 -07:00
2015-06-23 18:01:07 -04:00
2015-06-02 08:33:33 -06:00
2015-04-15 16:35:19 -07:00
2014-12-13 12:42:48 -08:00
2015-04-15 16:35:18 -07:00
2014-12-02 17:32:07 -08:00
2015-08-05 10:49:38 +02:00
2015-02-11 17:06:07 -08:00
2015-02-12 18:54:10 -08:00
2015-06-25 17:00:37 -07:00
2015-06-25 17:00:37 -07:00
2015-06-25 17:00:37 -07:00
2015-06-25 17:00:37 -07:00