NFS client READ performance on -current
John Baldwin
jhb at freebsd.org
Mon Jul 21 17:03:37 UTC 2014
On Sunday 20 July 2014 11:56:38 Garrett Wollman wrote:
> In article <201407151034.54681.jhb at freebsd.org>, jhb at freebsd.org writes:
> >Hmm, I am surprised by the m_pullup() behavior that it doesn't just
> >notice that the first mbuf with a cluster has the desired data already
> >and returns without doing anything.
>
> The specification of m_pullup() is that it returns a *writable* mbuf
> (and thus also that the "length" provided is less than MHLEN).
> Clusters are read-only.
Well, my patch to if_em is definitely correct then as it doesn't want a
writable mbuf, it just wants a certain portion of the mbuf chain to be stored
in the first segment.
Also, you should fix the manpage. It doesn't mention writable at all, just
that the data is accessible so that mtod() will work:
m_pullup(mbuf, len)
Arrange that the first len bytes of an mbuf chain are contiguous
and lay in the data area of mbuf, so they are accessible with
mtod(mbuf, type). It is important to remember that this may
involve reallocating some mbufs and moving data so all pointers
referencing data within the old mbuf chain must be recalculated or
made invalid. Return the new mbuf chain on success, NULL on fail-
ure (the mbuf chain is freed in this case). Note: It does not
allocate any mbuf clusters, so len must be less than or equal to
MHLEN.
--
John Baldwin
More information about the freebsd-net
mailing list