From patchwork Thu Jun 24 11:00:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 56780 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 489E1B6F06 for ; Thu, 24 Jun 2010 21:00:31 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754864Ab0FXLA1 (ORCPT ); Thu, 24 Jun 2010 07:00:27 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:53470 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754861Ab0FXLA0 (ORCPT ); Thu, 24 Jun 2010 07:00:26 -0400 Received: by wyi11 with SMTP id 11so1549660wyi.19 for ; Thu, 24 Jun 2010 04:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=vb4WbHYxobPQOGANWR+9GULSo7gI95r3NnWxLd9HSD8=; b=fNuUWfpYfce4nvy1JJRfF4krckAOB5EkeehEc48ZKNfMDW9vuyHi3kvxqtfbIpVjfS 0AoV5duwfN2/RwJn1i477pbu/K7Ga9sA/X0GqDRbwu9xHbvryQ2lgLIshYx8g9CtdGqj G0Hbb2czillNDiJBpqrPt/5O6v/OSFxV3vA94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=n+WIcqgCP1ViNqUxov9DESxdp7WoV3RhAoVy/CMBikpSjapU0uizWyqf4RRPkEN6Ti TQJkwMIuyYVmOS9EA0/iwvSc7wdV7Izt/LlQ1mdZqPLY1TaEgVmakDX8HZ8QqEaD33mL 4NcvnJX0jRv1Y8ZNf6PXYyGP2D3OpZfZ1r9dA= Received: by 10.216.86.196 with SMTP id w46mr3694042wee.104.1277377224792; Thu, 24 Jun 2010 04:00:24 -0700 (PDT) Received: from [127.0.0.1] ([85.17.35.125]) by mx.google.com with ESMTPS id w21sm2151694weq.21.2010.06.24.04.00.23 (version=SSLv3 cipher=RC4-MD5); Thu, 24 Jun 2010 04:00:24 -0700 (PDT) Subject: [PATCH net-next-2.6] tcp: tso_fragment() might avoid GFP_ATOMIC From: Eric Dumazet To: David Miller Cc: netdev Date: Thu, 24 Jun 2010 13:00:22 +0200 Message-ID: <1277377222.2816.296.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We can pass a gfp argument to tso_fragment() and avoid GFP_ATOMIC allocations sometimes. Signed-off-by: Eric Dumazet --- net/ipv4/tcp_output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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/tcp_output.c b/net/ipv4/tcp_output.c index 51d316d..25ff62e 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1460,7 +1460,7 @@ int tcp_may_send_now(struct sock *sk) * packet has never been sent out before (and thus is not cloned). */ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, - unsigned int mss_now) + unsigned int mss_now, gfp_t gfp) { struct sk_buff *buff; int nlen = skb->len - len; @@ -1470,7 +1470,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, if (skb->len != skb->data_len) return tcp_fragment(sk, skb, len, mss_now); - buff = sk_stream_alloc_skb(sk, 0, GFP_ATOMIC); + buff = sk_stream_alloc_skb(sk, 0, gfp); if (unlikely(buff == NULL)) return -ENOMEM; @@ -1768,7 +1768,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, cwnd_quota); if (skb->len > limit && - unlikely(tso_fragment(sk, skb, limit, mss_now))) + unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) break; TCP_SKB_CB(skb)->when = tcp_time_stamp;