DragonFly bugs List (threaded) for 2008-10
DragonFly BSD
DragonFly bugs List (threaded) for 2008-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: panic: sf_buf_free: freeing free sf_buf


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Oct 2008 07:52:43 -0700 (PDT)

:Please nuke the old patch I sent to you on IRC and test following one:
:http://leaf.dragonflybsd.org/~sephe/sendfile.diff1
:
:Best Regards,
:sephe

    FreeBSD has a cute atomic_fetchadd_int() function that can also be
    used.  It is in /archive/FreeBSD-current/src/sys/i386/include/atomic.h.

    Instead of:

	serialize_enter
	subtract_int...
	serialize_exit

    You would do:

	if (atomic_fetchadd_int(&sfm->mref_count, -1) == 1) {
		... last ref went away ...
	}

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]