[PATCH] Release lchan directly when refcount drops to zero

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Freyther zecke at selfish.org
Wed Nov 18 09:19:27 UTC 2009


Hi all,

I have written this small patch yesterday. It is removing the "auto release" 
after timeout from lchan and will directly release the channel ones the ref 
count drops to zero.

This means that any use of the lchan after a put_lchan is illegal (the code 
using a timeout used to workaround this issue). I have changed three call 
sites to follow this convention, I have added a BUG_ON into the abis_rsl 
method.

From a quick test (Location Updating Request and a call) the BUG_ON in the 
abis_rsl.c is hit by:

	- The lchan release code (okay... a false warning and avoided by
          increasing use_count and decreasing it...)

	- CM Service Request Ack and such is sent without anyone holding
	  a reference to it. I think this warning is safe to ignore for now as
          no one has simply claimed the channel. I plan to fix this in 
          January/February when moving our MSC code over to the On Waves
          BSC abstraction.


The benefit of this change is that we free our channels a lot earlier. I think 
this change would be beneficial for the 26C3 and I would like to hear opinions 
and see some testing with it.


regards
	z.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lchan-Release-the-channel-ones-its-usecount-drops-to.patch
Type: text/x-patch
Size: 8987 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20091118/cd20df6c/attachment.bin>


More information about the OpenBSC mailing list