From patchwork Fri Dec 3 10:14:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junchang Wang X-Patchwork-Id: 74103 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 EB970B7043 for ; Fri, 3 Dec 2010 21:15:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754003Ab0LCKPK (ORCPT ); Fri, 3 Dec 2010 05:15:10 -0500 Received: from mail-px0-f174.google.com ([209.85.212.174]:42862 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746Ab0LCKPJ (ORCPT ); Fri, 3 Dec 2010 05:15:09 -0500 Received: by pxi15 with SMTP id 15so1416553pxi.19 for ; Fri, 03 Dec 2010 02:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=+uk62RWCsiiaXUQ1CMbawJq3HGiXv/cDbcYLN4m+2+Y=; b=nZ9z2rDFo9QZxXe17yxJCmz7IOg0lH3rs9zqpxbDw9ctcXLhzuyJ2vSkNEfxE44hVv +BOAv6HNYfGw/OT+yI+e6TGaowXiw3pJrGA9FRtvWVhro4nTOvZMMPFdNwSkOK2YI5DT haXtRsi8Ce2hMMZEv08JKml/ciQaISZsP6sW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=Otf+1pwJCO0Q97ARPlN8lxLQNi7a0fvwEIMYBIFMMFAPe1Z9CuCM8KyOss2ttcAXOI Lh814RxxE/ka71DqYVQmoInPlGUBvBikYB0HnRdBBmR0BKH/GZa1dQvXJOQ7RaJQx4gr 30l+JmYPTeetSdZWtKR0BXizkmlwURrKzitWw= Received: by 10.143.39.15 with SMTP id r15mr1629697wfj.62.1291371308616; Fri, 03 Dec 2010 02:15:08 -0800 (PST) Received: from Desktop-Junchang ([58.211.218.74]) by mx.google.com with ESMTPS id w42sm2028060wfh.3.2010.12.03.02.15.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Dec 2010 02:15:07 -0800 (PST) Date: Fri, 3 Dec 2010 18:14:52 +0800 From: Junchang Wang To: eric.dumazet@gmail.com Cc: netdev@vger.kernel.org Subject: Question about __alloc_skb() speedup Message-ID: <20101203101450.GA9573@Desktop-Junchang> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Eric, I'm reading your patch (ec7d2f2cf3a1 __alloc_skb() speedup), in which you prefetch skb and the shinfo part. I'm very curious why we don't prefetch skb->data. It seems that will help tx path a lot. I added the following code and the pktgen in my server (A Intel SR1625 server with two E5530 4-core processors and a single ixgbe-based NIC) goes from 7.6Mpps to 8.4Mpps (64 byte), with 10% performance gain. For rx path, I did experiments on both ixgbe and igb with pktgen+kute, and there is no change in system performance. welcome any suggestions and corrections. Thanks. --Junchang --- 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/core/skbuff.c b/net/core/skbuff.c index 104f844..c60a808 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -222,6 +222,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, child->fclone = SKB_FCLONE_UNAVAILABLE; } + prefetchw(data); + out: return skb; nodata: