svn commit: r296025 - head/sys/netpfil/pf

Konstantin Belousov kostikbel at gmail.com
Thu Feb 25 11:18:44 UTC 2016


On Thu, Feb 25, 2016 at 11:26:18AM +0100, Kristof Provost wrote:
> That's a good point. We could handle those accesses failing, but
> sleeping with the PF_RULES_WLOCK held would be a bad idea.
> 
> I suppose we could just change M_WAITOK into M_NOWAIT and return ENOMEM
> if it fails. The only downside I can see is that it's more likely for a
> call to fail if there's not a lot of free memory.
As you rightfully noted, use of M_NOWAIT at the top-half of the kernel
causes random user-visible failures, which are caused by unrelated
events and its interaction with the pagedaemon activities.  Typical
kernel code applies somewhat more complex algorithms to e.g. calculate
the memory requirements, drop the locks and alloc everything, then
re-acquire the locks and recheck the conditions.

> 
> There's actually a decent number of cases where that'd have to be done,
> but it doesn't look particularly hard to do.


More information about the svn-src-head mailing list