Subject: Re: m_defrag() addition
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/07/2005 10:46:32
--Pk6IbRAofICFmK5e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 05, 2005 at 11:23:48AM +0100, Jaromir Dolecek wrote:
>=20
> Given this, I propose following for NetBSD m_defrag():
> * signature struct mbuf *m_defrag(struct mbuf *m0, int flags, int nseg_go=
al)
> * function returns defragmented mbuf chain on success, or NULL on failure=
=20
> * function fails if there is not enough memory to allocate new mbuf chain
>   memory (iff M_NOWAIT) or if it would not be able to meet the nseg_goal
>   fragmentation goal
> * success means the function has defragmented the mbuf chain
>   into <=3D nseg_goal continuous virtual memory segments, and the defragm=
ented
>   virtual memory segments cross the PAGE_SIZE boundary maximum
>   (nseg_goal - 1) times; this is to guarantee the result consists
>   of nseg_goal physical pages maximum
> * old mbuf chain kept intact in either success or error case
>=20
> Usage pattern would be:

[snip]

> Does this sound right?

Sounds good!

Take care,

Bill

--Pk6IbRAofICFmK5e
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFCLKGIWz+3JHUci9cRArLLAKCNxPbG/sSCDTvP6mdrOqdR42Q+XACfXdn6
K6mks2K74AQaYz0bqAa0P6g=
=4AK+
-----END PGP SIGNATURE-----

--Pk6IbRAofICFmK5e--