Author: andre
Date: Sat Aug 24 21:09:57 2013
New Revision: 254812
URL: http://svnweb.freebsd.org/changeset/base/254812

Log:
  Remove unused m_free_fast().  The difference to m_free() is only
  2 predictable branches nowadays.  However as a pre-condition the
  caller had to ensure that the mbuf pkthdr did not have any mtags
  attached to it, costing some potential branches again.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_mbuf.c
  head/sys/sys/mbuf.h

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c   Sat Aug 24 21:08:55 2013        (r254811)
+++ head/sys/kern/kern_mbuf.c   Sat Aug 24 21:09:57 2013        (r254812)
@@ -447,7 +447,7 @@ mb_dtor_mbuf(void *mem, int size, void *
        m = (struct mbuf *)mem;
        flags = (unsigned long)arg;
 
-       if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0)
+       if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags))
                m_tag_delete_chain(m, NULL);
        KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__));
        KASSERT((m->m_flags & M_NOFREE) == 0, ("%s: M_NOFREE set", __func__));

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h Sat Aug 24 21:08:55 2013        (r254811)
+++ head/sys/sys/mbuf.h Sat Aug 24 21:09:57 2013        (r254812)
@@ -453,8 +453,6 @@ struct mbuf {
 #define        MT_NOINIT       255     /* Not a type but a flag to allocate
                                   a non-initialized mbuf */
 
-#define MB_NOTAGS      0x1UL   /* no tags attached to mbuf */
-
 /*
  * Compatibility with historic mbuf allocator.
  */
@@ -636,17 +634,6 @@ m_getcl(int how, short type, int flags)
        return (uma_zalloc_arg(zone_pack, &args, how));
 }
 
-static __inline void
-m_free_fast(struct mbuf *m)
-{
-#ifdef INVARIANTS
-       if (m->m_flags & M_PKTHDR)
-               KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of 
mbuf with tags"));
-#endif
-
-       uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS);
-}
-
 static __inline struct mbuf *
 m_free(struct mbuf *m)
 {
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to