From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH v4] net: batch skb dequeueing from softnet input_pkt_queue Date: Thu, 22 Apr 2010 16:03:21 +0800 Message-ID: References: <1271915513-2966-1-git-send-email-xiaosuo@gmail.com> <20100421231843.4c284991@nehalam> <1271920877.7895.4757.camel@edumazet-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Stephen Hemminger , "David S. Miller" , jamal , Tom Herbert , netdev@vger.kernel.org To: Eric Dumazet Return-path: Received: from mail-bw0-f225.google.com ([209.85.218.225]:32888 "EHLO mail-bw0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684Ab0DVIDn convert rfc822-to-8bit (ORCPT ); Thu, 22 Apr 2010 04:03:43 -0400 Received: by bwz25 with SMTP id 25so9219876bwz.28 for ; Thu, 22 Apr 2010 01:03:41 -0700 (PDT) In-Reply-To: <1271920877.7895.4757.camel@edumazet-laptop> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Apr 22, 2010 at 3:21 PM, Eric Dumazet = wrote: > Jamal perf reports show lock contention but also cache line ping pong= s. > > Yet, you keep a process_queue_len shared by producers and consumer. > > Producers want to read it, while consumer decrement it (dirtying its > cache line) every packet, slowing down the things. > > > The idea of batching is to let the consumer process its local queue w= ith > no impact to producers. > > Please remove it completely, or make the consumer zero it only at the > end of batch processing. > > A cache line miss cost is about 120 cycles. Multiply it by 1 million > packet per second... > OK, I'll remove it, and update the input_pkt_queue only before process_backlog returns. --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com)