Deleted Added
full compact
30c30
< __FBSDID("$FreeBSD: head/sys/dev/hatm/if_hatm_intr.c 121729 2003-10-30 10:43:52Z harti $");
---
> __FBSDID("$FreeBSD: head/sys/dev/hatm/if_hatm_intr.c 121744 2003-10-30 16:19:50Z harti $");
93a94,111
> *
> * Note that in general this algorithm is not safe when multiple readers
> * and writers are present. To cite from a mail from David Schultz
> * <das@freebsd.org>:
> *
> * It looks like this is subject to the ABA problem. For instance,
> * suppose X, Y, and Z are the top things on the freelist and a
> * thread attempts to make an allocation. You set buf to X and load
> * buf->link (Y) into a register. Then the thread get preempted, and
> * another thread allocates both X and Y, then frees X. When the
> * original thread gets the CPU again, X is still on top of the
> * freelist, so the atomic operation succeeds. However, the atomic
> * op places Y on top of the freelist, even though Y is no longer
> * free.
> *
> * We are, however sure that we have only one thread that ever allocates
> * buffers because the only place we're call from is the interrupt handler.
> * Under these circumstances the code looks safe.