Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Mar 2003 17:38:09 -0500
From:      Bosko Milekic <bmilekic@unixdaemons.com>
To:        Petri Helenius <pete@he.iki.fi>
Cc:        freebsd-current@FreeBSD.ORG, freebsd-net@FreeBSD.ORG
Subject:   Re: mbuf cache
Message-ID:  <20030304173809.A10373@unixdaemons.com>
In-Reply-To: <0e1b01c2e29c$d1fefdc0$932a40c1@PHE>; from pete@he.iki.fi on Wed, Mar 05, 2003 at 12:24:27AM %2B0200
References:  <0ded01c2e295$cbef0940$932a40c1@PHE> <20030304164449.A10136@unixdaemons.com> <0e1b01c2e29c$d1fefdc0$932a40c1@PHE>

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

On Wed, Mar 05, 2003 at 12:24:27AM +0200, Petri Helenius wrote:
> >  
> >   Yes, it's normal.  The commit log clearly states that the new
> >   watermarks do nothing for now.  I have a patch that changes that but I
> >   haven't committed it yet because I left for vacation last Sunday and I
> >   only returned early this Monday.  Since then, I've been too busy to
> >   clean up and commit it.  In about a week or so you should notice a
> >   difference.
> > 
> Any comments on the high cpu consumption of mb_free? Or any other places
> where I should look to improve performance?

  What do you mean "high cpu consumption?"  The common case of mb_free()
  is this:

  bucket = mb_list->ml_btable[MB_BUCKET_INDX(m, mb_list)];
  owner = bucket->mb_owner & ~MB_BUCKET_FREE;
  switch (owner) {
      ...
      default:
	  cnt_lst = MB_GET_PCPU_LIST_NUM(mb_list, owner);
	  MB_PUT_OBJECT(m, bucket, cnt_lst);
	  MB_MBTYPES_DEC(cnt_lst, type, 1);
	  if (bucket->mb_owner & MB_BUCKET_FREE) {
	  	SLIST_INSERT_HEAD(&(cnt_lst->mb_cont.mc_bhead),
				    bucket,
				    mb_blist);
	   	bucket->mb_owner = cnt_lst->mb_cont.mc_numowner;
	  }
  }

  That's the common path, modulo a couple checks on whether or not the
  container being freed to needs to be moved or whether we're in a
  starvation situation.  The only thing to be done, possibly, is make
  the routine smaller by moving those couple of actions to seperate
  routines, but I'm not clear that this is very useful, given that
  mb_free()'s usage is restricted to only inside subr_mbuf.c

> Pete

-- 
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?20030304173809.A10373>