From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8256 invoked by alias); 2 Nov 2006 16:42:48 -0000 Received: (qmail 8248 invoked by uid 22791); 2 Nov 2006 16:42:48 -0000 X-Spam-Status: No, hits=1.4 required=5.0 tests=AWL,BAYES_50,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mail4.hitachi.co.jp (HELO mail4.hitachi.co.jp) (133.145.228.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Nov 2006 16:42:30 +0000 Received: from mlsv5.hitachi.co.jp (unknown [133.145.228.16]) by mail4.hitachi.co.jp (Postfix) with ESMTP id 92FDB33CC9 for ; Fri, 3 Nov 2006 01:42:27 +0900 (JST) Received: from mfilter-s3.hitachi.co.jp by mlsv5.hitachi.co.jp (8.12.10/8.12.10) id kA2GgRZx009224; Fri, 3 Nov 2006 01:42:27 +0900 Received: from vshuts5.hitachi.co.jp (unverified) by mfilter-s3.hitachi.co.jp (Content Technologies SMTPRS 4.3.17) with SMTP id ; Fri, 3 Nov 2006 01:42:27 +0900 Received: from hsdlgw92.sdl.hitachi.co.jp ([133.144.7.20]) by vshuts5.hitachi.co.jp with SMTP id M2006110301422612344 ; Fri, 03 Nov 2006 01:42:26 +0900 Received: from vgate2.sdl.hitachi.co.jp by hsdlgw92.sdl.hitachi.co.jp (8.13.1/3.7W06092911) id kA2GgK8O012626; Fri, 3 Nov 2006 01:42:26 +0900 Received: from maila.sdl.hitachi.co.jp ([133.144.14.196]) by vgate2.sdl.hitachi.co.jp (SAVSMTP 3.1.1.32) with SMTP id M2006110301422501087 ; Fri, 03 Nov 2006 01:42:25 +0900 Received: from [127.0.0.1] ([10.232.9.172]) by maila.sdl.hitachi.co.jp (8.13.1/3.7W04031011) with ESMTP id kA2GgPoK014533; Fri, 3 Nov 2006 01:42:25 +0900 Message-ID: <454A1FDA.5040209@hitachi.com> Date: Thu, 02 Nov 2006 18:51:00 -0000 From: Masami Hiramatsu Organization: Systems Development Lab., Hitachi, Ltd., Japan User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: bibo mao Cc: mingo@redhat.com, anil.s.keshavamurthy@intel.com, ananth@in.ibm.com, prasanna@in.ibm.com, systemtap@sources.redhat.com, soshima@redhat.com, haoki@redhat.com, yumiko.sugita.yf@hitachi.com Subject: Re: [RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00335.txt.bz2 Hi Bibo, bibo mao wrote: > I am not familiar with freeze_processes(), I only view code. > And I write simple program(though buggy) to test: [...] > it seems that many threads are not frozen even freeze_processes > return 0. I think the most important issue is whether those threads are preempted (suddenly scheduled out) or not. Those preempted threads might be preempted on the instruction buffer or on the middle of the target instructions. In that case, we cannot free the buffer or overwrite a jump code. But, if those threads are sleeping at the known places, we can ensure safety of freeing/overwriting. Therefore, I think it is necessary to check whether all non-frozen threads are sleeping or not, like as below; --------------------------------------- int check_safety(void) { int ret = 0; struct task_struct *g, *p; if (freeze_processes()) { goto Thaw; } do_each_thread(g, p) { if (frozen(p)) continue; if (p->state == TASK_RUNNING) { ret = -EAGAIN; break; } } while_each_thread(g, p); Thaw: thaw_processes(); return ret; } Thanks, -- Masami HIRAMATSU Linux Technology Center Hitachi, Ltd., Systems Development Laboratory E-mail: masami.hiramatsu.pt@hitachi.com