Re: small patch to buffer.c (2.0.x, stop wasting cycles).

Ingo Molnar (mingo@pc5829.hil.siemens.at)
Fri, 4 Apr 1997 18:55:27 +0200 (MET DST)


On Fri, 4 Apr 1997, Gordon Oliver wrote:

> This little patch takes the cli()/restore_flags() out of the loop.

> --- fs/buffer.c.original Tue Apr 1 21:15:32 1997
> +++ fs/buffer.c Tue Apr 1 21:20:52 1997
> @@ -1023,21 +1023,29 @@
> * to be IRQ-safe here (but note that interrupts only _add_ to the
> * reuse_list, never take away. So we don't need to worry about the
> * reuse_list magically emptying).
> + *
> + * Changed the code to copy out the list at the beginning instead of
> + * locking it for every entry. This could be made into a while loop, but
> + * that doesn't seem to have much purpose, since this code is called
> + * every time we want a buffer.

is the buffer-head freelist modified from interrupt handlers? If yes the
it's unsafe to call put_unused_buffer_head with irqs on. If no then no
need to cli at all.

-- mingo