Date: Sat, 15 Jul 2000 13:48:29 -0400 (EDT) From: Bosko Milekic <bmilekic@dsuper.net> To: Alfred Perlstein <bright@wintelcom.net> Cc: net@FreeBSD.ORG, dg@FreeBSD.ORG, dillon@FreeBSD.ORG Subject: Re: mbuf refcnt and sendfile Message-ID: <Pine.BSF.4.21.0007151342140.19466-100000@jehovah.technokratis.com> In-Reply-To: <Pine.BSF.4.21.0007151245300.19250-100000@jehovah.technokratis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> When you increase the reference count, it's not exactly atomic as
> you may be offsetting into a location, it may produce more than one
> instruction in which case you may catch an interrupt in between where
> things will get broken.
I just thought of something that would essentially change this and
make your assumption correct for the issue of atomicity. However, I still
think that it's better to not maintain an external reference counter for
each ext_buf mainly for the reason of transparency. But I guess what you
could do, if you really insist on it is, in m_ext:
union {
u_int counter;
u_int *countr;
} count;
The first referrer can use the u_int counter and the rest can point
their *countr's to this first mbuf's counter. This would avoid the
external management of a reference counter. It might indeed make these
operations more optimized. I made the changes already so I'll post them a
little later today, if you want.
Personally, though, I preferred to have all of the mbufs referring to
the same external object easily accessible through any of the isolated
mbufs.
--Bosko
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0007151342140.19466-100000>
