mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	inet: frags: delay fqdir_free_fn()
fqdir_free_fn() is using very expensive rcu_barrier() When one netns is dismantled, we often call fqdir_exit() multiple times, typically lauching fqdir_free_fn() twice. Delaying by one second fqdir_free_fn() helps to reduce the number of rcu_barrier() calls, and lock contention on rcu_state.barrier_mutex. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									b2c919c108
								
							
						
					
					
						commit
						802e12ff9c
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -175,7 +175,7 @@ static void fqdir_free_fn(struct work_struct *work)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static DECLARE_WORK(fqdir_free_work, fqdir_free_fn);
 | 
					static DECLARE_DELAYED_WORK(fqdir_free_work, fqdir_free_fn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void fqdir_work_fn(struct work_struct *work)
 | 
					static void fqdir_work_fn(struct work_struct *work)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -184,7 +184,7 @@ static void fqdir_work_fn(struct work_struct *work)
 | 
				
			||||||
	rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL);
 | 
						rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (llist_add(&fqdir->free_list, &fqdir_free_list))
 | 
						if (llist_add(&fqdir->free_list, &fqdir_free_list))
 | 
				
			||||||
		queue_work(system_wq, &fqdir_free_work);
 | 
							queue_delayed_work(system_wq, &fqdir_free_work, HZ);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net)
 | 
					int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue