Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759696Ab3DZBpb (ORCPT ); Thu, 25 Apr 2013 21:45:31 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:47730 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757277Ab3DZBp2 (ORCPT ); Thu, 25 Apr 2013 21:45:28 -0400 From: Simon Horman To: Eric Dumazet , Julian Anastasov , Ingo Molnar , Peter Zijlstra Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Pablo Neira Ayuso , Dipankar Sarma , "Paul E. McKenney" , Simon Horman Subject: [PATCH 2/2] ipvs: Use cond_resched_rcu_lock() helper when dumping connections Date: Fri, 26 Apr 2013 10:45:08 +0900 Message-Id: <1366940708-10180-3-git-send-email-horms@verge.net.au> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1366940708-10180-1-git-send-email-horms@verge.net.au> References: <1366940708-10180-1-git-send-email-horms@verge.net.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1319 Lines: 43 This avoids the situation where a dump of a large number of connections may prevent scheduling for a long time while also avoiding excessive calls to rcu_read_unlock() and rcu_read_lock(). Cc: Eric Dumazet Cc: Julian Anastasov Signed-off-by: Simon Horman --- net/netfilter/ipvs/ip_vs_conn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index a083bda..42a7b33 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c @@ -975,8 +975,7 @@ static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) return cp; } } - rcu_read_unlock(); - rcu_read_lock(); + cond_resched_rcu_lock(); } return NULL; @@ -1015,8 +1014,7 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos) iter->l = &ip_vs_conn_tab[idx]; return cp; } - rcu_read_unlock(); - rcu_read_lock(); + cond_resched_rcu_lock(); } iter->l = NULL; return NULL; -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/