From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [net-next 1/1] tipc: optimize function tipc_node_timeout() Date: Sat, 30 Jun 2018 20:52:23 +0900 (KST) Message-ID: <20180630.205223.2203940213481525974.davem@davemloft.net> References: <1530218365-16566-1-git-send-email-jon.maloy@ericsson.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, mohan.krishna.ghanta.krishnamurthy@ericsson.com, tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au, canh.d.luu@dektech.com.au, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net To: jon.maloy@ericsson.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:37836 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755208AbeF3Lw1 (ORCPT ); Sat, 30 Jun 2018 07:52:27 -0400 In-Reply-To: <1530218365-16566-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Jon Maloy Date: Thu, 28 Jun 2018 22:39:25 +0200 > From: Tung Nguyen > > In single-link usage, the function tipc_node_timeout() still iterates > over the whole link array to handle each link. Given that the maximum > number of bearers are 3, there are 2 redundant iterations with lock > grab/release. Since this function is executing very frequently it makes > sense to optimize it. > > This commit adds conditional checking to exit from the loop if the > known number of configured links has already been accessed. > > Acked-by: Ying Xue > Signed-off-by: Tung Nguyen > Signed-off-by: Jon Maloy Applied.