DragonFly submit List (threaded) for 2008-01
DragonFly BSD
DragonFly submit List (threaded) for 2008-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: lockmgr_sleep() (was Re: ssleep() (was Re: mention msleep() in porting_drivers.txt))


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Wed, 16 Jan 2008 17:49:34 +0100

Aggelos Economopoulos wrote:
So, about adding a lockmgr_sleep(): I think it would be useful; open-coding
the whole thing makes it easy to slip in hard to notice bugs. But what should
the prototype be? If we follow the freebsd semantics, the lock should be re-
acquired on return. This means that we need to do a lockstatus() (which implies
a spin_lock_wr()) to get information that the caller probably has available or

Why? When we release the lock in lock_sleep, we will obtain the status anyways, right?


*  lockmgr_sleep(void *ident, int flags, const char *wmesg, int timeo,
		struct lock *lk, int lkflags)

Looks nice this way, in case we need to pass the lkflags.


spin_sleep(void *ident, int flags, const char *wmesg, int timo,
	struct spinlock *spin)

+1


The down side of course is having to change a couple of dozen call sites. But
as long as we're breaking people's patches with the name change, we might as
well fix the interface, assuming everyone agrees that's an improvement.

No problem. We could keep msleep() around for some time.


cheers
  simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]