Skip to contentSkip to conversation

: Option to run cache reap in thread mode

PATCH Manfred Spraul 3 participants 10 messages Jun 16, 2004 – Jun 18, 2004 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Dimitri

In the process of testing per/cpu interrupt response times and CPU availability, I've found that running cache_reap() as a timer as is done currently results in some fairly long CPU holdoffs.

What is fairly long?
If cache_reap() is slow than the caches are too large.
Could you limit cachep->free_limit and check if that helps? It's right now scaled by num_online_cpus() - that's probably too much. It's unlikely that all 500 cpus will try to refill their cpu arrays at the same time. Something like a logarithmic increase should be sufficient. Do you use the default batchcount values or have you increased the values?
I think the sgi ia64 system do not work with slab debugging, but please check that debugging is off. Debug enabled is slow.

--
Manfred

#1 lore raw
Quoted 9 lines · Manfred Spraul
Quoted 6 lines · Dimitri

In the process of testing per/cpu interrupt response times and CPU availability,
I've found that running cache_reap() as a timer as is done currently results
in some fairly long CPU holdoffs.

What is fairly long?

Into the 100's of usec. I consider anything over 30 usec too long. I've seen this take longer than 30usec on a small (8p) system.

Quoted 5 lines

If cache_reap() is slow than the caches are too large. Could you limit cachep->free_limit and check if that helps? It's right now scaled by num_online_cpus() - that's probably too much. It's unlikely that all 500 cpus will try to refill their cpu arrays at the same time. Something like a logarithmic increase should be sufficient.

I haven't tried this yet, but I'm even seeing this on 4 cpu systems.

Quoted 1 line

Do you use the default batchcount values or have you increased the values?

Default.

Quoted 2 lines

I think the sgi ia64 system do not work with slab debugging, but please check that debugging is off. Debug enabled is slow.

# CONFIG_DEBUG_SLAB is not set

Quoted 3 lines

--
Manfred

Dimitri Sivanich <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 8 lines · Dimitri Sivanich
Quoted 3 lines

Do you use the default batchcount values or have you increased the values?

Default.

Could you try to reduce them? Something like (as root)

# cd /proc
# cat slabinfo | gawk '{printf("echo \"%s %d %d %d\" > /proc/slabinfo\n", $1,$9,4,2);}' | bash

If this doesn't help then perhaps the timer should run more frequently and scan only a part of the list of slab caches.

--
Manfred
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw

Manfred,

Quoted 8 lines · Manfred Spraul

Could you try to reduce them? Something like (as root)

# cd /proc
# cat slabinfo | gawk '{printf("echo \"%s %d %d %d\" > 
/proc/slabinfo\n", $1,$9,4,2);}' | bash

If this doesn't help then perhaps the timer should run more frequently and scan only a part of the list of slab caches.

I tried the modification you suggested and it had little effect. On a 4 cpu (otherwise idle) system I saw the characteristic 30+ usec interruptions (holdoffs) every 2 seconds.

Since it's running in timer context, this of course includes all of the timer_interrupt logic, but I've verified no other timers running during those times (and I see only very short holdoffs during other timer interrupts).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#4 lore raw
Quoted 8 lines · Dimitri Sivanich
Quoted 6 lines · Manfred Spraul

Could you try to reduce them? Something like (as root)

# cd /proc
# cat slabinfo | gawk '{printf("echo \"%s %d %d %d\" > 
/proc/slabinfo\n", $1,$9,4,2);}' | bash
Quoted 6 lines
Quoted 2 lines

If this doesn't help then perhaps the timer should run more frequently and scan only a part of the list of slab caches.

I tried the modification you suggested and it had little effect. On a 4 cpu (otherwise idle) system I saw the characteristic 30+ usec interruptions (holdoffs) every 2 seconds.

Against which slab cache? How many objects are being reaped in a single timer tick?

It's very simple:

mm/slab.c renamed from mm/slab.c~a +6 -0
@@ -2690,6 +2690,7 @@ static void drain_array_locked(kmem_cach
 static inline void cache_reap (void)
 {
 	struct list_head *walk;
+	static int max;
 
 #if DEBUG
 	BUG_ON(!in_interrupt());
@@ -2731,6 +2732,11 @@ static inline void cache_reap (void)
 		}
 
 		tofree = (searchp->free_limit+5*searchp->num-1)/(5*searchp->num);
+		if (tofree > max) {
+			max = tofree;
+			printk("%s: reap %d\n", searchp->name, tofree);
+		}
+
 		do {
 			p = list3_data(searchp)->slabs_free.next;
 			if (p == &(list3_data(searchp)->slabs_free))

_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#5 lore raw
Quoted 2 lines · Andrew Morton

Against which slab cache? How many objects are being reaped in a single timer tick?

Against all of them. See my analysis below.

Quoted 25 lines

It's very simple:

mm/slab.c renamed from mm/slab.c~a +6 -0
@@ -2690,6 +2690,7 @@ static void drain_array_locked(kmem_cach
 static inline void cache_reap (void)
 {
 	struct list_head *walk;
+	static int max;
 
 #if DEBUG
 	BUG_ON(!in_interrupt());
@@ -2731,6 +2732,11 @@ static inline void cache_reap (void)
 		}
 
 		tofree = (searchp->free_limit+5*searchp->num-1)/(5*searchp->num);
+		if (tofree > max) {
+			max = tofree;
+			printk("%s: reap %d\n", searchp->name, tofree);
+		}
+
 		do {
 			p = list3_data(searchp)->slabs_free.next;
 			if (p == &(list3_data(searchp)->slabs_free))
Quoted 1 line

_

Andrew & Manfred, here's what I think you've been looking for. Keep in mind that this analysis is done on an essentially unloaded system:

At the time of the holdoff (the point where we've spent a total of 30 usec in the timer_interrupt), we've looped through more than 100 of the 131 caches, usually closer to 120.

The maximum number of slabs to free (what Andrew indicated he wanted) is almost always 1 or 2 at the time of the holdoff, and the same for the number of per/cpu blocks.

The total number of slabs we've freed is usually on the order of 1-3.

The total number of per/cpu blocks freed is usually on the order of 1-5 but as high as 15.

The total number of times we've acquired the spin_lock is usually on the order of 5-10.

Below I've included the slabinfo for your reading pleasure.

slabinfo - version: 2.0

# name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <batchcount> <limit> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
ip_fib_hash           11    452     32  452    1 : tunables  120   60    8 : slabdata      1      1      0
rpc_buffers            8      8   2048    8    1 : tunables   24   12    8 : slabdata      1      1      0
rpc_tasks              8     42    384   42    1 : tunables   54   27    8 : slabdata      1      1      0
rpc_inode_cache        0      0    896   18    1 : tunables   54   27    8 : slabdata      0      0      0
unix_sock             29     84    768   21    1 : tunables   54   27    8 : slabdata      4      4      0
ip_mrt_cache           0      0    128  123    1 : tunables  120   60    8 : slabdata      0      0      0
tcp_tw_bucket          7     62    256   62    1 : tunables  120   60    8 : slabdata      1      1      0
tcp_bind_bucket       15    452     32  452    1 : tunables  120   60    8 : slabdata      1      1      0
tcp_open_request       0      0    128  123    1 : tunables  120   60    8 : slabdata      0      0      0
inet_peer_cache        3    123    128  123    1 : tunables  120   60    8 : slabdata      1      1      0
secpath_cache          0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
xfrm_dst_cache         0      0    384   42    1 : tunables   54   27    8 : slabdata      0      0      0
ip_dst_cache          30     84    384   42    1 : tunables   54   27    8 : slabdata      2      2      0
arp_cache              4     62    256   62    1 : tunables  120   60    8 : slabdata      1      1      0
raw4_sock              0      0    896   18    1 : tunables   54   27    8 : slabdata      0      0      0
udp_sock               3     18    896   18    1 : tunables   54   27    8 : slabdata      1      1      0
tcp_sock              28     44   1408   11    1 : tunables   24   12    8 : slabdata      4      4      0
flow_cache             0      0    128  123    1 : tunables  120   60    8 : slabdata      0      0      0
kcopyd-jobs          512    528    360   44    1 : tunables   54   27    8 : slabdata     12     12      0
dm_tio                 0      0     24  581    1 : tunables  120   60    8 : slabdata      0      0      0
dm_io                  0      0     32  452    1 : tunables  120   60    8 : slabdata      0      0      0
scsi_cmd_cache        34    124    512   31    1 : tunables   54   27    8 : slabdata      4      4      1
qla2xxx_srbs           0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
dm_session             0      0    416   38    1 : tunables   54   27    8 : slabdata      0      0      0
dm_fsreg               0      0    336   48    1 : tunables   54   27    8 : slabdata      0      0      0
dm_tokdata             0      0     72  214    1 : tunables  120   60    8 : slabdata      0      0      0
xfs_acl                0      0    304   53    1 : tunables   54   27    8 : slabdata      0      0      0
xfs_chashlist        944   1356     32  452    1 : tunables  120   60    8 : slabdata      3      3      0
xfs_ili              137    332    192   83    1 : tunables  120   60    8 : slabdata      4      4      0
xfs_ifork              0      0     64  240    1 : tunables  120   60    8 : slabdata      0      0      0
xfs_efi_item           0      0    352   45    1 : tunables   54   27    8 : slabdata      0      0      0
xfs_efd_item           0      0    360   44    1 : tunables   54   27    8 : slabdata      0      0      0
xfs_buf_item           6    172    184   86    1 : tunables  120   60    8 : slabdata      2      2      0
xfs_dabuf             16    581     24  581    1 : tunables  120   60    8 : slabdata      1      1      0
xfs_da_state          16     33    488   33    1 : tunables   54   27    8 : slabdata      1      1      0
xfs_trans              1     72    872   18    1 : tunables   54   27    8 : slabdata      1      4      0
xfs_inode          19458  19560    528   30    1 : tunables   54   27    8 : slabdata    652    652      0
xfs_btree_cur         16     83    192   83    1 : tunables  120   60    8 : slabdata      1      1      0
xfs_bmap_free_item      0      0     24  581    1 : tunables  120   60    8 : slabdata      0      0      0
xfs_buf_t             36    217    512   31    1 : tunables   54   27    8 : slabdata      7      7      2
linvfs_icache      19472  19488    768   21    1 : tunables   54   27    8 : slabdata    928    928      0
nfs_write_data        36     42    768   21    1 : tunables   54   27    8 : slabdata      2      2      0
nfs_read_data         32     42    768   21    1 : tunables   54   27    8 : slabdata      2      2      0
nfs_inode_cache        0      0   1024   15    1 : tunables   54   27    8 : slabdata      0      0      0
nfs_page               0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
isofs_inode_cache      0      0    640   25    1 : tunables   54   27    8 : slabdata      0      0      0
fat_inode_cache        0      0    768   21    1 : tunables   54   27    8 : slabdata      0      0      0
hugetlbfs_inode_cache      1     21    768   21    1 : tunables   54   27    8 : slabdata      1      1      0
ext2_inode_cache       0      0    768   21    1 : tunables   54   27    8 : slabdata      0      0      0
ext2_xattr             0      0     88  177    1 : tunables  120   60    8 : slabdata      0      0      0
journal_handle         0      0     48  312    1 : tunables  120   60    8 : slabdata      0      0      0
journal_head           0      0     88  177    1 : tunables  120   60    8 : slabdata      0      0      0
revoke_table           0      0     16  816    1 : tunables  120   60    8 : slabdata      0      0      0
revoke_record          0      0     32  452    1 : tunables  120   60    8 : slabdata      0      0      0
ext3_inode_cache       0      0    896   18    1 : tunables   54   27    8 : slabdata      0      0      0
ext3_xattr             0      0     88  177    1 : tunables  120   60    8 : slabdata      0      0      0
dquot                  0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
eventpoll_pwq          0      0     72  214    1 : tunables  120   60    8 : slabdata      0      0      0
eventpoll_epi          0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
kioctx                 0      0    384   42    1 : tunables   54   27    8 : slabdata      0      0      0
kiocb                  0      0    512   31    1 : tunables   54   27    8 : slabdata      0      0      0
dnotify_cache          0      0     40  371    1 : tunables  120   60    8 : slabdata      0      0      0
file_lock_cache        2    188    168   94    1 : tunables  120   60    8 : slabdata      2      2      0
fasync_cache           0      0     24  581    1 : tunables  120   60    8 : slabdata      0      0      0
shared_policy_node      0      0     56  272    1 : tunables  120   60    8 : slabdata      0      0      0
numa_policy            0      0     40  371    1 : tunables  120   60    8 : slabdata      0      0      0
shmem_inode_cache      4     18    896   18    1 : tunables   54   27    8 : slabdata      1      1      0
posix_timers_cache      0      0    144  110    1 : tunables  120   60    8 : slabdata      0      0      0
uid_cache              4    240     64  240    1 : tunables  120   60    8 : slabdata      1      1      0
sgpool-128            32     32   4096    4    1 : tunables   24   12    8 : slabdata      8      8      0
sgpool-64             32     32   2048    8    1 : tunables   24   12    8 : slabdata      4      4      0
sgpool-32             32     45   1024   15    1 : tunables   54   27    8 : slabdata      3      3      0
sgpool-16             32     62    512   31    1 : tunables   54   27    8 : slabdata      2      2      0
sgpool-8             141    310    256   62    1 : tunables  120   60    8 : slabdata      5      5      1
cfq_pool             145    272     56  272    1 : tunables  120   60    8 : slabdata      1      1      0
crq_pool             129    428     72  214    1 : tunables  120   60    8 : slabdata      2      2      7
deadline_drq           0      0     96  162    1 : tunables  120   60    8 : slabdata      0      0      0
as_arq                 0      0    112  140    1 : tunables  120   60    8 : slabdata      0      0      0
blkdev_requests       65    180    264   60    1 : tunables   54   27    8 : slabdata      3      3      4
biovec-BIO_MAX_PAGES    256    256   4096    4    1 : tunables   24   12    8 : slabdata     64     64      0
biovec-128           256    256   2048    8    1 : tunables   24   12    8 : slabdata     32     32      0
biovec-64            256    270   1024   15    1 : tunables   54   27    8 : slabdata     18     18      0
biovec-16            256    310    256   62    1 : tunables  120   60    8 : slabdata      5      5      0
biovec-4             256    480     64  240    1 : tunables  120   60    8 : slabdata      2      2      0
biovec-1             334    816     16  816    1 : tunables  120   60    8 : slabdata      1      1      1
bio                  340    615    128  123    1 : tunables  120   60    8 : slabdata      5      5      3
sock_inode_cache      69     84    768   21    1 : tunables   54   27    8 : slabdata      4      4      0
skbuff_head_cache    414    462    384   42    1 : tunables   54   27    8 : slabdata     11     11      0
sock                   3     50    640   25    1 : tunables   54   27    8 : slabdata      2      2      0
proc_inode_cache    1112   1200    640   25    1 : tunables   54   27    8 : slabdata     48     48      0
sigqueue             170    297    160   99    1 : tunables  120   60    8 : slabdata      3      3      0
radix_tree_node     1063   1110    536   30    1 : tunables   54   27    8 : slabdata     37     37      0
bdev_cache             4     18    896   18    1 : tunables   54   27    8 : slabdata      1      1      0
mnt_cache             35    123    128  123    1 : tunables  120   60    8 : slabdata      1      1      0
inode_cache         2347   2400    640   25    1 : tunables   54   27    8 : slabdata     96     96      0
dentry_cache       24571  24614    256   62    1 : tunables  120   60    8 : slabdata    397    397      0
filp                 760    868    256   62    1 : tunables  120   60    8 : slabdata     14     14      0
names_cache           51     68   4096    4    1 : tunables   24   12    8 : slabdata     17     17     18
idr_layer_cache       26     30    528   30    1 : tunables   54   27    8 : slabdata      1      1      0
buffer_head          464    648     96  162    1 : tunables  120   60    8 : slabdata      4      4      0
mm_struct            136    195   1024   15    1 : tunables   54   27    8 : slabdata     13     13      0
vm_area_struct      1933   2070    176   90    1 : tunables  120   60    8 : slabdata     23     23    224
fs_cache             111    480     64  240    1 : tunables  120   60    8 : slabdata      2      2      0
files_cache           75    180    896   18    1 : tunables   54   27    8 : slabdata     10     10      0
signal_cache         171    369    128  123    1 : tunables  120   60    8 : slabdata      3      3      0
sighand_cache        125    135   1664    9    1 : tunables   24   12    8 : slabdata     15     15      0
anon_vma             944   1162     24  581    1 : tunables  120   60    8 : slabdata      2      2      0
size-131072(DMA)       0      0 131072    1    8 : tunables    8    4    0 : slabdata      0      0      0
size-131072            0      0 131072    1    8 : tunables    8    4    0 : slabdata      0      0      0
size-65536(DMA)        0      0  65536    1    4 : tunables    8    4    0 : slabdata      0      0      0
size-65536             0      0  65536    1    4 : tunables    8    4    0 : slabdata      0      0      0
size-32768(DMA)        0      0  32768    1    2 : tunables    8    4    0 : slabdata      0      0      0
size-32768             9      9  32768    1    2 : tunables    8    4    0 : slabdata      9      9      0
size-16384(DMA)        0      0  16384    1    1 : tunables   24   12    8 : slabdata      0      0      0
size-16384            12     12  16384    1    1 : tunables   24   12    8 : slabdata     12     12      0
size-8192(DMA)         0      0   8192    2    1 : tunables   24   12    8 : slabdata      0      0      0
size-8192             33     34   8192    2    1 : tunables   24   12    8 : slabdata     17     17      0
size-4096(DMA)         0      0   4096    4    1 : tunables   24   12    8 : slabdata      0      0      0
size-4096            197    236   4096    4    1 : tunables   24   12    8 : slabdata     59     59      0
size-2048(DMA)         0      0   2048    8    1 : tunables   24   12    8 : slabdata      0      0      0
size-2048            339    368   2048    8    1 : tunables   24   12    8 : slabdata     46     46      0
size-1024(DMA)         0      0   1024   15    1 : tunables   54   27    8 : slabdata      0      0      0
size-1024            418    465   1024   15    1 : tunables   54   27    8 : slabdata     31     31      0
size-512(DMA)          0      0    512   31    1 : tunables   54   27    8 : slabdata      0      0      0
size-512             863    868    512   31    1 : tunables   54   27    8 : slabdata     28     28      0
size-256(DMA)          0      0    256   62    1 : tunables  120   60    8 : slabdata      0      0      0
size-256            1672   1674    256   62    1 : tunables  120   60    8 : slabdata     27     27      0
size-128(DMA)          0      0    128  123    1 : tunables  120   60    8 : slabdata      0      0      0
size-128             585    738    128  123    1 : tunables  120   60    8 : slabdata      6      6      0
size-64(DMA)           0      0     64  240    1 : tunables  120   60    8 : slabdata      0      0      0
size-64             4001   4080     64  240    1 : tunables  120   60    8 : slabdata     17     17      0
kmem_cache           148    154    704   22    1 : tunables   54   27    8 : slabdata      7      7      0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#6 lore raw
Quoted 4 lines · Dimitri Sivanich

At the time of the holdoff (the point where we've spent a total of 30 usec in the timer_interrupt), we've looped through more than 100 of the 131 caches, usually closer to 120.

ahh, ooh, ow, of course.

Manfred, we need a separate list of "slabs which might need reaping".

That'll help the average case. To help the worst case we should change cache_reap() to only reap (say) ten caches from the head of the new list and to then return. Maybe increase the timer frequency too.

something like:

/*
* FIFO list of caches (via kmem_cache_t.reap_list) which need consideration in
* cache_reap(). Protected by cache_chain_sem.
*/
static LIST_HEAD(global_reap_list);

cache_reap()

{
	for (i = 0; i < 10; i++) {
		if (list_empty(&global_reap_list))
			break;
		cachep = list_entry(&global_reap_list, kmem_cache_t, reap_list);
		list_del_init(&cachep->reap_list);
		<prune it>
	}
}

mark_cache_for_reaping(kmem_cach_t *cachep)

{
	if (list_empty(&cachep->reap_list)) {
		if (!down_trylock(&cache_chain_sem)) {
			list_add(&cachep->reap_list, &global_reap_list);
			up(&cache_chain_sem);
	}
}

Maybe cache_chain_sem should become a spinlock.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#7 lore raw
Quoted 9 lines · Andrew Morton
Quoted 5 lines · Dimitri Sivanich

At the time of the holdoff (the point where we've spent a total of 30 usec in the timer_interrupt), we've looped through more than 100 of the 131 caches, usually closer to 120.

Quoted 5 lines

ahh, ooh, ow, of course.

Manfred, we need a separate list of "slabs which might need reaping".

A cache that might need reaping is a cache that has seen at least one kmem_cache_free(). The list would trade less time in the timer context at the expense of slower kmem_cache_free calls. I'm fairly certain that this would be end up as a big net loss.

Quoted 4 lines

That'll help the average case. To help the worst case we should change cache_reap() to only reap (say) ten caches from the head of the new list and to then return.

I'll write something:
- allow to disable the DMA kmalloc caches for archs that do not need them.
- increase the timer frequency and scan only a few caches in each timer.
- perhaps a quicker test for cache_reap to notice that nothing needs to be done. Right now four tests are done (!flags & _NO_REAP, ac->touched==0, ac->avail != 0, global timer not yet expired). It's possible to skip some tests. e.g. move the _NO_REAP caches on a separate list, replace the time_after(.next_reap,jiffies) with a separate timer.

--
Manfred
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#8 lore raw
Quoted 10 lines

I'll write something:
- allow to disable the DMA kmalloc caches for archs that do not need them.
- increase the timer frequency and scan only a few caches in each timer.
- perhaps a quicker test for cache_reap to notice that nothing needs to be done. Right now four tests are done (!flags & _NO_REAP, ac->touched==0, ac->avail != 0, global timer not yet expired). It's possible to skip some tests. e.g. move the _NO_REAP caches on a separate list, replace the time_after(.next_reap,jiffies) with a separate timer.

Quoted 3 lines

--
Manfred

Thanks for addressing this. Sounds like some good improvements overall.

One question though: What about possible spinlock contention issues in the cache_reap timer processing, or is that unlikely here (even on a heavily loaded system with a large number of CPUs)?

Dimitri Sivanich <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#9 lore raw
In reply to Manfred Spraul
Quoted 9 lines · Manfred Spraul

I'll write something:
- allow to disable the DMA kmalloc caches for archs that do not need them.
- increase the timer frequency and scan only a few caches in each timer.
- perhaps a quicker test for cache_reap to notice that nothing needs to be done. Right now four tests are done (!flags & _NO_REAP, ac->touched==0, ac->avail != 0, global timer not yet expired). It's possible to skip some tests. e.g. move the _NO_REAP caches on a separate list, replace the time_after(.next_reap,jiffies) with a separate timer.

Come to think of it, replacing the timer with schedule_delayed_work() and doing it all via keventd should work OK. Doing everything in a single pass is the most CPU-efficient way of doing it, and as long as we're preemptible and interruptible the latency issues will be solved.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>