From patchwork Mon Jul 27 20:08:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Duyck X-Patchwork-Id: 500639 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A274A140D19 for ; Tue, 28 Jul 2015 06:08:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754671AbbG0UIJ (ORCPT ); Mon, 27 Jul 2015 16:08:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58173 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754373AbbG0UIH (ORCPT ); Mon, 27 Jul 2015 16:08:07 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id ACAF8ADACB; Mon, 27 Jul 2015 20:08:07 +0000 (UTC) Received: from [192.168.122.149] (vpn-234-204.phx2.redhat.com [10.3.234.204]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6RK86Qh030639; Mon, 27 Jul 2015 16:08:07 -0400 Subject: [net PATCH] fib_trie: Drop unnecessary calls to leaf_pull_suffix From: Alexander Duyck To: dsa@cumulusnetworks.com, davem@davemloft.net Cc: netdev@vger.kernel.org Date: Mon, 27 Jul 2015 13:08:06 -0700 Message-ID: <20150727195631.26840.93266.stgit@ahduyck-vm-fedora22> In-Reply-To: <55B6612C.7050506@cumulusnetworks.com> References: <55B6612C.7050506@cumulusnetworks.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It was reported that update_suffix was taking a long time on systems where a large number of leaves were attached to a single node. As it turns out fib_table_flush was calling update_suffix for each leaf that didn't have all of the aliases stripped from it. As a result, on this large node removing one leaf would result in us calling update_suffix for every other leaf on the node. The fix is to just remove the calls to leaf_pull_suffix since they are redundant as we already have a call in resize that will go through and update the suffix length for the node before we exit out of fib_table_flush or fib_table_flush_external. Reported-by: David Ahern Signed-off-by: Alexander Duyck Tested-by: David Ahern --- This patch should apply to linux-4.1.y and newer kernels. I've done a bit of testing on my system and I no longer see update_suffix dominating the performance traces. David if you can test with this patch to see if you still see the issue I would appreciate it. net/ipv4/fib_trie.c | 4 ---- 1 file changed, 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index ef90d73911de..70168ca4716b 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -1791,8 +1791,6 @@ void fib_table_flush_external(struct fib_table *tb) if (hlist_empty(&n->leaf)) { put_child_root(pn, n->key, NULL); node_free(n); - } else { - leaf_pull_suffix(pn, n); } } } @@ -1862,8 +1860,6 @@ int fib_table_flush(struct fib_table *tb) if (hlist_empty(&n->leaf)) { put_child_root(pn, n->key, NULL); node_free(n); - } else { - leaf_pull_suffix(pn, n); } }