From patchwork Wed Nov 4 20:27:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Kirby X-Patchwork-Id: 37623 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 8B36AB7BA4 for ; Thu, 5 Nov 2009 07:27:27 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757974AbZKDU1R (ORCPT ); Wed, 4 Nov 2009 15:27:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756844AbZKDU1Q (ORCPT ); Wed, 4 Nov 2009 15:27:16 -0500 Received: from newpeace.netnation.com ([204.174.223.7]:38107 "EHLO peace.netnation.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751361AbZKDU1Q (ORCPT ); Wed, 4 Nov 2009 15:27:16 -0500 Received: from sim by peace.netnation.com with local (Exim 4.63) (envelope-from ) id 1N5mRo-0008GY-ON; Wed, 04 Nov 2009 12:27:16 -0800 Date: Wed, 4 Nov 2009 12:27:16 -0800 From: Simon Kirby To: netdev@vger.kernel.org, Wensong Zhang , Julian Anastasov Subject: test Message-ID: <20091104202716.GE14821@hostway.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello! I was noticing a significant amount of what seems/seemed to be destination lists with multiple entries with the lblcr LVS algorithm. While tracking it down, I think I stumbled over a mistake. In ip_vs_lblcr_full_check(), it appears the time check logic is reversed: for (i=0, j=tbl->rover; isched_lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { if (time_after(en->lastuse+sysctl_ip_vs_lblcr_expiration, now)) continue; ip_vs_lblcr_free(en); atomic_dec(&tbl->entries); } write_unlock(&svc->sched_lock); } Shouldn't this be "time_before"? It seems that it currently nukes all recently-used entries every time this function is called, which seems to be every 30 minutes, rather than removing the not-recently-used ones. If my reading is correct, this patch should fix it. Am I missing something? Cheers, Simon- diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 715b57f..937743f 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c @@ -432,7 +432,7 @@ static inline void ip_vs_lblcr_full_check(struct ip_vs_service *svc) write_lock(&svc->sched_lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { - if (time_after(en->lastuse+sysctl_ip_vs_lblcr_expiration, + if (time_before(en->lastuse+sysctl_ip_vs_lblcr_expiration, now)) continue;