Re: Q: utrace-stopped utrace_report_jctl()

2009-03-12 Thread Roland McGrath
I'd like to ask you to clarify what utrace-stopped means... I'm very glad you are looking into this area! My understanding is: if we see -stopped == true under utrace-lock, then the target can do nothing interesting from the utrace's pov. The target should take utrace-lock at least once.

[PATCH 1/2] UTRACE_STOP race condition (updated)

2009-03-12 Thread Renzo Davoli
Dear Roland, dear utrace developers, I have updated my patch #1 (it solves the race condition on utrace_stop but not the nesting issue) for the latest version of utrace. I am trying to get the patches updated downloading, compiling and testing the fixes every week or so... Things would be

Re: [PATCH 2/2] UTRACE_STOP: nesting engine management (updated)

2009-03-12 Thread Oleg Nesterov
On 03/12, Renzo Davoli wrote: I have update also the second patch. Please note that now this patch must be applied after the first one. This patch implements a consistent nesting model for utrace machines. (There is a full description in the messages I sent on Feb. 14 and Mar. 6) This patch

Re: Q: utrace-stopped utrace_report_jctl()

2009-03-12 Thread Oleg Nesterov
Roland, I left some parts of your message unanswered because I need to think more about them... On 03/12, Roland McGrath wrote: But, if we enter utrace_report_jctl() with -stopped == 1, JCTL can be already removed from -utrace_flags, exactly because -stopped was true. I don't follow this.

Re: Q: utrace_reset() UTRACE_EVENT(REAP)

2009-03-12 Thread Oleg Nesterov
I'm afraid I wasn't clear again, On 03/12, Oleg Nesterov wrote: Oh. utrace_attach_task()-utrace_add_engine() sets -report + TIF_NOTIFY_RESUME. But tracehook_notify_resume() does nothing because -utrace_flags == 0 ? Confused. Perhaps this is not problem per se. But let's suppose we call,

Re: Q: -attaching REPORT_CALLBACKS()

2009-03-12 Thread Oleg Nesterov
On 03/11, Roland McGrath wrote: But not vise versa. I misunderstood the comment as if the new engine should not be notified if it is attached by another task while target is inside callback. That is indeed what happens in that case. But that one is not a specific should not, it's just

Re: Q: utrace-stopped utrace_report_jctl()

2009-03-12 Thread Roland McGrath
Yep. And utrace_reset() can be called because -stopped == 1. Right. Let me explain. Again, let's suppose D attaches engine E to the target T. T enters utrace_report_jctl() with -stopped == 1. D calls utrace_set_events(events = 0), this removes JCTL from E-flags. D calls, say,

Re: Q: utrace_reset() UTRACE_EVENT(REAP)

2009-03-12 Thread Roland McGrath
Hmm. But this leads to another question: why does utrace_reset() set UTRACE_EVENT(REAP) ? This looks as: make sure -utrace_flags is never 0 unless we detach all engines. Perhaps because sometimes, say tracehook_notify_resume(), we just check task_utrace_flags() != 0 ? Right, it's an