DragonFly commits List (threaded) for 2007-02
DragonFly BSD
DragonFly commits List (threaded) for 2007-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/kern kern_sig.c


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 22 Feb 2007 19:49:19 +0100

Matthew Dillon wrote:
:corecode 2007/02/22 07:48:55 PST
:
:DragonFly src repository
:
: Modified files:
: sys/kern kern_sig.c : Log:
: Fix stopping of the current process, which was broken by the last commit.
: : If the current process is still far inside the kernel and is going to
: tsleep(), CURSIG()/issignal() in tsleep() have to see the pending signal;
:..


You can't actually stop a process in tsleep, ever. The kernel might
be holding resources (such as lockmgr locks) that would never be released.


A process can only be stopped in userret() (platform/pc32/i386/trap.c).

Please make sure that those semantics are retained.

That always happened. CURSIG/issignal check for a SA_STOP signal and calls tstop, which in turn calls tsleep() in a loop until SSTOP (previously P_STOPPED) is cleared.


I'm also not fond of this, but seems the kernel code assumes this behaviour. I noticed this in ttread(): it calls ttysleep()/tsleep(), but really expects the thread to be stopped *inside*.

I'd rather have the threads stop only in userret() as well (and possibly when entering the kernel), but we'd need very careful audit of CURSIG/issignal() users.

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   / \

Attachment: signature.asc
Description: OpenPGP digital signature



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