[883] in linux-net channel archive
Re: patch for skbuff.c
daemon@ATHENA.MIT.EDU (Rob Janssen reading Linux mailingl)
Sat Aug 12 11:04:05 1995
From: linux@pe1chl.ampr.org (Rob Janssen reading Linux mailinglist)
To: koop@biene.u-strasbg.fr (Felix A. KOOP)
Date: Fri, 11 Aug 1995 13:35:31 +0200 (MET DST)
Cc: iialan@iifeak.swan.ac.uk, linux-net@vger.rutgers.edu
In-Reply-To: <Pine.LNX.3.91.950810085510.15528B-100000@biene.u-strasbg.fr> from "Felix A. KOOP" at Aug 10, 95 09:03:12 am
Reply-To: linux-vger@wab-tis.rabobank.nl
According to Felix A. KOOP:
> after reading the source of skbuff.c I'm not quite sure why there are
> not cli()/sti() pairs on all accesses to the global variables. I included
> a patch for the rest. If it's not neccessary, perhaps you can tell me why?
>
> diff -u skbuff.c.old skbuff.c
> --- skbuff.c.old Thu Aug 10 08:41:27 1995
> +++ skbuff.c Thu Aug 10 08:53:04 1995
> @@ -446,7 +446,10 @@
> if (skb->lock)
> {
> skb->free = 3; /* Free when unlocked */
> + save_flags(flags);
> + cli();
> net_free_locked++;
> + restore_flags(flags);
> return;
> }
Well, at least on the x86, the code that GCC generates for incrementing
a global variable is only a single instruction. As a single instruction
cannot be interrupted halfway, there is no need to disable interrupts.
Of course, it may be different on other processors...
Rob