From owner-svn-src-head@FreeBSD.ORG Mon Aug 19 11:23:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75C9AD26; Mon, 19 Aug 2013 11:23:39 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [IPv6:2607:f8b0:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2C7D2799; Mon, 19 Aug 2013 11:23:38 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id ha12so2890004vcb.37 for ; Mon, 19 Aug 2013 04:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1I5XMmkdC5W6EQp1dtooni+gFizXIw1sDnzb/+Q8Oxc=; b=j6OZeyKmYAutDLEopLzcm7GqB+usm4PTf0uJ6Dw7MfRYD3ABX6q1SCenEpzWrMLuAD Pnnkb5Z9sVq4GA8QMexjduH9yKwagS8Gmg4VzLeRItvr8WwlUYnmkr6wPHmgZ7aPczBx ewZHoyGsSLxvtNahBdV3d8Kbp/H60SJLkgrguKt6g/aM/4A2pUpuqvThXYk7imhRg/rs ObnjoXxNShQDILvXZ51hZFfxb9DnaqbIE76AZeznSNMAATK1Ch9DHmjC375rutmpTCKn r12d6qkB9TkAI8+xF7kmV3UcOBcm3Nq+uaOIoSMBwyLaNpB8/PeVu9km91G1ccjn+1zM Atfw== MIME-Version: 1.0 X-Received: by 10.52.103.35 with SMTP id ft3mr11128463vdb.5.1376911418024; Mon, 19 Aug 2013 04:23:38 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.21.140 with HTTP; Mon, 19 Aug 2013 04:23:37 -0700 (PDT) In-Reply-To: <201308191116.r7JBGsc6065793@svn.freebsd.org> References: <201308191116.r7JBGsc6065793@svn.freebsd.org> Date: Mon, 19 Aug 2013 13:23:37 +0200 X-Google-Sender-Auth: jAOYSwQBxGZ_iwqjFqX3qcFwND4 Message-ID: Subject: Re: svn commit: r254520 - in head/sys: kern sys From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 11:23:39 -0000 On Mon, Aug 19, 2013 at 1:16 PM, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 19 11:16:53 2013 > New Revision: 254520 > URL: http://svnweb.freebsd.org/changeset/base/254520 > > Log: > Remove the unused M_NOFREE mbuf flag. It didn't have any in-tree users > for a very long time, if ever. > > Should such a functionality ever be needed again the appropriate and > much better way to do it is through a custom EXT_SOMETHING external mbuf > type together with a dedicated *ext_free function. > > Discussed with: trociny, glebius > > Modified: > head/sys/kern/kern_mbuf.c > head/sys/kern/uipc_mbuf.c > head/sys/sys/mbuf.h > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/kern/kern_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) > @@ -474,7 +474,6 @@ mb_dtor_mbuf(void *mem, int size, void * > if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0) > 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__)); > #ifdef INVARIANTS > trash_dtor(mem, size, arg); > #endif > > Modified: head/sys/kern/uipc_mbuf.c > ============================================================================== > --- head/sys/kern/uipc_mbuf.c Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/kern/uipc_mbuf.c Mon Aug 19 11:16:53 2013 (r254520) > @@ -278,17 +278,10 @@ m_extadd(struct mbuf *mb, caddr_t buf, u > void > mb_free_ext(struct mbuf *m) > { > - int skipmbuf; > > KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); > KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); > > - > - /* > - * check if the header is embedded in the cluster > - */ > - skipmbuf = (m->m_flags & M_NOFREE); > - > /* Free attached storage if this mbuf is the only reference to it. */ > if (*(m->m_ext.ref_cnt) == 1 || > atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) { > @@ -329,8 +322,6 @@ mb_free_ext(struct mbuf *m) > ("%s: unknown ext_type", __func__)); > } > } > - if (skipmbuf) > - return; > > /* > * Free this mbuf back to the mbuf zone with all m_ext > @@ -395,7 +386,7 @@ m_demote(struct mbuf *m0, int all) > m_freem(m->m_nextpkt); > m->m_nextpkt = NULL; > } > - m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); > + m->m_flags = m->m_flags & (M_EXT|M_RDONLY); > } > } > > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013 (r254519) > +++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013 (r254520) > @@ -200,7 +200,7 @@ struct mbuf { > /* 0x00008000 free */ > #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ > #define M_PROMISC 0x00020000 /* packet was not for us */ > -#define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */ > + /* 0x00040000 free */ I think you should just use M_UNUSED or something similar here for consistency, like it's happening in td_pflags (sys/sys/proc.h), e.g.: #define TDP_UNUSED9 0x00000100 /* --available-- */ > #define M_PROTO6 0x00080000 /* protocol-specific */ > #define M_PROTO7 0x00100000 /* protocol-specific */ > #define M_PROTO8 0x00200000 /* protocol-specific */ > @@ -515,7 +515,7 @@ m_free(struct mbuf *m) > > if (m->m_flags & M_EXT) > mb_free_ext(m); > - else if ((m->m_flags & M_NOFREE) == 0) > + else > uma_zfree(zone_mbuf, m); > return (n); > } -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare