Re: Linux-2.2.4 testpatch..

Linus Torvalds (torvalds@transmeta.com)
Wed, 24 Mar 1999 10:45:54 -0800 (PST)


On Wed, 24 Mar 1999, Andrea Arcangeli wrote:
> On 24 Mar 1999, Linus Torvalds wrote:
>
> >There's a potential problem under certain load conditions with 2.2.4,
> >which should be fixed by this one-liner. If you have trouble with 2.2.4
>
> > remove_from_queues(buf);
> >+ buf->b_count = 0;
> > put_last_free(buf);
> > }
>
> Which is the problem?

The problem is that _while_ the buffer is on the free list, it has a
non-zero count.

Yes, Andrea, the count is re-initialized when you take the buffer off the
free list.

But think about what happens if somebody needs more memory in the
meantime. The page freeing logic will refuse to touch any buffers that are
on the free list, which is exactly the wrong thing to do.

So no, you shouldn't see any internal consistency problems due to missing
the b_count = 0.

But you might, for example, see machines that have much less memory
available to them than they should. Which could result in some serious
performance degradation (and in the extreme case in a locked up machine
that has no memory available to it, but I doubt that actually ever happens
in real life).

The fact that it is hard to see is obviously why I never noticed it
myself. I doubt you can trigger the bad cases very easily, possibly not at
all. But that doesn't mean that it isn't a bug..

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/