Hello,

> --- kfree_skb/include/linux/skbuff.h~kfree_skb_uninline_null  2006-02-23 
> 13:35:05.000000000 +0100
> +++ kfree_skb/include/linux/skbuff.h  2006-02-23 13:36:23.000000000 +0100
> @@ -306,6 +306,7 @@ struct sk_buff {
>  
>  #include <asm/system.h>
>  
> +void kfree_skb(struct sk_buff *skb);
>  extern void         __kfree_skb(struct sk_buff *skb);
>  extern struct sk_buff *__alloc_skb(unsigned int size,
>                                  gfp_t priority, int fclone);
> @@ -406,22 +407,6 @@ static inline struct sk_buff *skb_get(st
>   */
>  
>  /**
> - *   kfree_skb - free an sk_buff
> - *   @skb: buffer to free
> - *
> - *   Drop a reference to the buffer and free it if the usage count has
> - *   hit zero.
> - */
> -static inline void kfree_skb(struct sk_buff *skb)
> -{
> -     if (likely(atomic_read(&skb->users) == 1))
> -             smp_rmb();
> -     else if (likely(!atomic_dec_and_test(&skb->users)))
> -             return;
> -     __kfree_skb(skb);
> -}
> -
> -/**
>   *   skb_cloned - is the buffer a clone
>   *   @skb: buffer to check
>   *
> --- kfree_skb/net/core/skbuff.c~kfree_skb_uninline_null       2006-02-23 
> 13:35:05.000000000 +0100
> +++ kfree_skb/net/core/skbuff.c       2006-02-23 13:37:01.000000000 +0100
> @@ -355,6 +355,24 @@ void __kfree_skb(struct sk_buff *skb)
>  }
>  
>  /**
> + *   kfree_skb - free an sk_buff
> + *   @skb: buffer to free
> + *
> + *   Drop a reference to the buffer and free it if the usage count has
> + *   hit zero.
> + */
> +void kfree_skb(struct sk_buff *skb)
> +{
> +     if (unlikely(!skb))
> +             return;
> +     if (likely(atomic_read(&skb->users) == 1))
> +             smp_rmb();
> +     else if (likely(!atomic_dec_and_test(&skb->users)))
> +             return;
> +     __kfree_skb(skb);
> +}
> +

just thinking about it a little bit, why not un-inline the current
kfree_skb to, say, _kfree_skb, and make a new inlined kfree_skb
which just does

static inline void kfree_skb(struct sk_buff *skb)
{
        if (unlikely(!skb))
                return;
        _kfree_skb(skb);
}

This way the kernel with the new inlined kfree_skb should still become
smaller while not calling the un-inlined _kfree_skb if skb is
NULL...?? (_should_ become smaller is a claim I make without any
proof, sorry...)


Sven

-- 
Linux zion.homelinux.com 2.6.16-rc3-mm1_27 #27 Wed Feb 15 17:51:36 CET 2006 
i686 athlon i386 GNU/Linux
 14:14:50 up 5 days, 18:30,  1 user,  load average: 0.14, 0.11, 0.17

Attachment: pgp3WY3Yi97zC.pgp
Description: PGP signature

Reply via email to