Re: JFFS2 swsusp / signal cleanup.

From: Pavel Machek
Date: Sun Oct 05 2003 - 14:15:50 EST


Hi!

> > Is flush_signals() really so stupid to do? Goal was to make
> > modifications to code as simple as possible, and as most pieces do not
> > expect to be interrupted, pretending signal never happened seems like
> > good idea...
>
> What if that signal was necessary for the operation of the thread, and
> dropping it would cause a problem?
>
> Since you're effectively using signal handling to cause a false pending
> signal indication, surely the correct cleanup is to re-calculate the
> pending signal indication. That way, we won't be throwing away
> signals.

Should I do recalc_sigpending() instead of flush_signals(current)?

> I'm also wondering if there could be a problem with (ab)using TASK_STOPPED
> here - could a stopped task be woken prematurely and thereby sent spinning
> in refrigerator() by a non-stopped process sending a SIGCONT at just the
> right time?
>
> Maybe we want a TASK_FROZEN state to describe the "frozen, may not be woken
> by anything except thawing" state?

That would certainly be cleaner, but I think it would require
modifications all over the kernel...

That SIGCONT race... while() in refrigerator() should catch
that. Maybe we spin, but we go back to sleep pretty soon.

Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/