Driver patch to look at...

John Baldwin jhb at freebsd.org
Tue Feb 5 19:11:20 UTC 2013


On Tuesday, February 05, 2013 2:04:12 pm Randall Stewart wrote:
> Hmm
> 
> That would trade off a stack pointer + a compare
> vs always doing the move.

Right, the store is probably cheaper than the branch. :)  However, minimizing 
the duplicated code in drivers and having this interface be as clear/readable 
as possible is my main goal.

> Thats fine until I have to add the _mc() version, then the put
> back would be an atomic, and most of the time the return from
> this is probably not changed…
> 
> I really would prefer not to since the compare and maybe store vs
> the always store.. though the same now, would be far more expensive
> in the _mc version.. if we do a _mc version of course ;-)

I would just not bother with an _mc version until we actually need it. :)

I think doing the sort of peek/advance type logic only works well with
single consumers anyway.

-- 
John Baldwin


More information about the freebsd-net mailing list