Re: Disposal of a misleading M_TRYWAIT




:> Since the advent of MBUMA in FreeBSD (whatever), M_TRYWAIT has meant
:> M_WAITOK. (The reason for M_TRYWAIT itself was that an original mbuf's
:> M_WAIT could return NULL.)
:>
:..
:
:This seems reasonable to me for exactly the reasons you stte. We might
:simultaneously want to complete the M_DONTWAIT -> M_NOWAIT conversion. And
:you can then remove the XXX comment in mbuf.h about phasing out M_TRYWAIT and
:M_DONTWAIT. :-)
:
:Robert N M Watson

The real issue is the fact that both the kernel malloc and the mbuf
allocation APIs are using the same M_ prefix for their flags.

We converted our mbuf allocator flags (aka M_DONTWAIT, M_TRYWAIT, M_WAIT)
from M_ to MB_ and the code became a whole lot easier to read.

I would not recommend converting the mbuf allocator to actually *USE*
kernel malloc flags. The problem there is that you then have no clear
delineation between M_ flags supported by malloc and M_ flags supported
by the mbuf allocator.

-Matt

_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Disposal of a misleading M_TRYWAIT
    ... :This seems reasonable to me for exactly the reasons you stte. ... The real issue is the fact that both the kernel malloc and the mbuf ... We converted our mbuf allocator flags ...
    (freebsd-arch)
  • Re: Disposal of a misleading M_TRYWAIT
    ... (The reason for M_TRYWAIT itself was that an original mbuf's ... The real issue is the fact that both the kernel malloc and the mbuf ... We converted our mbuf allocator flags ...
    (freebsd-arch)
  • Re: Cant insert a notebook page
    ... The docs mention two reasons: ... pageID is ignored) ... you might want to experiment with the flags for the notebook ... This code is part of the SWT port. ...
    (comp.os.os2.programmer.misc)
  • Re: Cant insert a notebook page
    ... The docs mention two reasons: ... pageID is ignored) ... you might want to experiment with the flags for the notebook ... This code is part of the SWT port. ...
    (comp.os.os2.programmer.misc)
  • Re: Disposal of a misleading M_TRYWAIT
    ... We made a decision a while back to not use malloc flags for mbuf routine arguments. ... A significant part of Ruslan's patch is improving consistency in error handling by making all code consider the wait case unable to fail, and there's nothing quite like removing unused exceptional case handling to make network code easier to read. ... I would also be fine with a proposal that replaces the existing M_DONTWAIT / M_TRYWAIT with mbuf allocator specific flags that read FOO_WAIT and FOO_NOWAIT ...
    (freebsd-arch)