LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: "\"Ilpo Järvinen\"" <ilpo.jarvinen@helsinki.fi>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Miller <davem@davemloft.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [RFC PATCH 1/8] [NET]: uninline skb_put, de-bloats a lot
Date: Wed, 20 Feb 2008 14:57:32 +0100	[thread overview]
Message-ID: <20080220145732.d716355e.dada1@cosmosbay.com> (raw)
In-Reply-To: <1203515238-22848-2-git-send-email-ilpo.jarvinen@helsinki.fi>

On Wed, 20 Feb 2008 15:47:11 +0200
"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi> wrote:

> ~500 files changed
> ...
> kernel/uninlined.c:
>   skb_put                       | +104
>  1 function changed, 104 bytes added, diff: +104
> 
> vmlinux.o:
>  869 functions changed, 198 bytes added, 111003 bytes removed, diff: -110805
> 
> This change is INCOMPLETE, I think that the call to current_text_addr()
> should be rethought but I don't have a clue how to do that.

You want to use __builtin_return_address(0)

> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>  include/linux/skbuff.h |   20 +-------------------
>  net/core/skbuff.c      |   21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 19 deletions(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 412672a..5925435 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -896,25 +896,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len)
>  	return tmp;
>  }
>  
> -/**
> - *	skb_put - add data to a buffer
> - *	@skb: buffer to use
> - *	@len: amount of data to add
> - *
> - *	This function extends the used data area of the buffer. If this would
> - *	exceed the total buffer size the kernel will panic. A pointer to the
> - *	first byte of the extra data is returned.
> - */
> -static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
> -{
> -	unsigned char *tmp = skb_tail_pointer(skb);
> -	SKB_LINEAR_ASSERT(skb);
> -	skb->tail += len;
> -	skb->len  += len;
> -	if (unlikely(skb->tail > skb->end))
> -		skb_over_panic(skb, len, current_text_addr());
> -	return tmp;
> -}
> +extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
>  
>  static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len)
>  {
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 4e35422..661d439 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -857,6 +857,27 @@ free_skb:
>  	return err;
>  }
>  
> +/**
> + *	skb_put - add data to a buffer
> + *	@skb: buffer to use
> + *	@len: amount of data to add
> + *
> + *	This function extends the used data area of the buffer. If this would
> + *	exceed the total buffer size the kernel will panic. A pointer to the
> + *	first byte of the extra data is returned.
> + */
> +unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
> +{
> +	unsigned char *tmp = skb_tail_pointer(skb);
> +	SKB_LINEAR_ASSERT(skb);
> +	skb->tail += len;
> +	skb->len  += len;
> +	if (unlikely(skb->tail > skb->end))
> +		skb_over_panic(skb, len, current_text_addr());
> +	return tmp;
> +}
> +EXPORT_SYMBOL(skb_put);
> +
>  /* Trims skb to length len. It can change skb pointers.
>   */
>  
> -- 
> 1.5.2.2
> 
> --
> 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
> 

  parent reply	other threads:[~2008-02-20 13:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 13:47 [RFC PATCH 0/8]: uninline & uninline Ilpo Järvinen
2008-02-20 13:47 ` [RFC PATCH 1/8] [NET]: uninline skb_put, de-bloats a lot Ilpo Järvinen
2008-02-20 13:47   ` [RFC PATCH 2/8] [NET]: uninline skb_pull, " Ilpo Järvinen
2008-02-20 13:47     ` [RFC PATCH 3/8] [NET]: uninline dev_alloc_skb, " Ilpo Järvinen
2008-02-20 13:47       ` [RFC PATCH 4/8] [NET]: uninline skb_push, " Ilpo Järvinen
2008-02-20 13:47         ` [RFC PATCH 5/8] [NET]: uninline dst_release Ilpo Järvinen
2008-02-20 13:47           ` [RFC PATCH 6/8] [NET]: uninline skb_trim, de-bloats Ilpo Järvinen
2008-02-20 13:47             ` [RFC PATCH 7/8] [SCTP]: uninline sctp_add_cmd_sf Ilpo Järvinen
2008-02-20 13:47               ` [RFC PATCH 8/8] Jhash in too big for inlining, move under lib/ Ilpo Järvinen
2008-02-23  8:02                 ` Andrew Morton
2008-02-23 10:05                   ` Ilpo Järvinen
2008-02-23 18:21                     ` Andrew Morton
2008-02-23 13:06                   ` Andi Kleen
2008-02-20 22:16               ` [RFC PATCH 7/8] [SCTP]: uninline sctp_add_cmd_sf Vlad Yasevich
2008-02-20 22:34                 ` Ilpo Järvinen
2008-02-21 15:27                   ` Vlad Yasevich
2008-02-20 16:19       ` [RFC PATCH 3/8] [NET]: uninline dev_alloc_skb, de-bloats a lot Jan Engelhardt
2008-02-20 16:27         ` Patrick McHardy
2008-02-20 16:30           ` Jan Engelhardt
2008-02-20 22:18             ` Ilpo Järvinen
2008-03-12 15:27               ` Ilpo Järvinen
2008-02-20 13:54   ` [RFC PATCH 1/8] [NET]: uninline skb_put, " Patrick McHardy
2008-02-20 13:57   ` Eric Dumazet [this message]
2008-02-23  8:02 ` [RFC PATCH 0/8]: uninline & uninline Andrew Morton
2008-02-23 10:11   ` Ilpo Järvinen
2008-02-23 13:15   ` Andi Kleen
2008-02-23 18:06     ` Ilpo Järvinen
2008-02-23 18:55     ` Andrew Morton
2008-02-23 19:58       ` Hua Zhong
2008-02-23 21:02         ` Andi Kleen
2008-02-27 19:08       ` profile-likely patch (was " Valdis.Kletnieks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080220145732.d716355e.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=acme@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).