Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 2003 15:29:30 -0500
From:      Bosko Milekic <bmilekic@unixdaemons.com>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        current@freebsd.org
Subject:   Re: mbuf header bloat ?
Message-ID:  <20030102152930.A25321@unixdaemons.com>
In-Reply-To: <15892.35521.181516.714686@grasshopper.cs.duke.edu>; from gallatin@cs.duke.edu on Thu, Jan 02, 2003 at 01:53:53PM -0500
References:  <15840.8629.324788.887872@grasshopper.cs.duke.edu> <Pine.BSF.4.21.0211232306410.28833-100000@InterJet.elischer.org> <15841.17237.826666.653505@grasshopper.cs.duke.edu> <20021125130005.A75177@unixdaemons.com> <15842.27547.385354.151541@grasshopper.cs.duke.edu> <20021125160122.A75673@unixdaemons.com> <15842.51914.871010.137070@grasshopper.cs.duke.edu> <20021126191526.B78371@unixdaemons.com> <15892.35521.181516.714686@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, Jan 02, 2003 at 01:53:53PM -0500, Andrew Gallatin wrote:
> I'm just tuning up my driver now to catch up to the "recent" interface
> changes.  While there, I went to add a ref count for my driver managed
> M_EXT clusters.  However, m_extadd() does not take a parameter for
> assignment into mp->m_ext.ref_cnt Eg, I cannot call m_extadd() if I
> want to use my own refcounter.
> 
> Is there any chance this could be fixed?  O/w, I'll have to
> avoid calling m_extadd()..

  I dunno.  I hate the whole story behind the reference counters in the
  mbuf code and I don't know what the correct approach here would be.  A
  long long while back I think m_extadd (or its equivalent) did allow
  something like this.  Then, we changed it so that counters would be
  allocated by the mbuf code 'transparently' (i.e., so that the Rest Of
  The World didn't have to worry about it).  However, not long ago, I
  changed the way reference counters were allocated for mbuf clusters so
  that it would be faster.  Counters for other objects are allocated
  with malloc().  The only 'correct' (half-assed) solution I can see is
  to allow m_extadd() to take a 'refcount' argument (again?) - perhaps
  leave a backwards-compatible m_extadd() and add a m_addext() or
  something - and only call malloc() for the counter if refcnt_provided
  == NULL.

  To be honest, I don't really like the idea but I don't see a better
  solution.  Right now, ref counting for regular mbuf clusters works
  fine and is pretty damn fast, but I don't know how I could make it
  happen for other external buffer types other than the way I just
  described.

> Thanks,
> 
> Drew

-- 
Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030102152930.A25321>