From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 24 07:53:25 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8902E106566C for ; Sat, 24 Mar 2012 07:53:25 +0000 (UTC) (envelope-from sushanth_rai@yahoo.com) Received: from nm23-vm0.bullet.mail.sp2.yahoo.com (nm23-vm0.bullet.mail.sp2.yahoo.com [98.139.91.224]) by mx1.freebsd.org (Postfix) with SMTP id 452D68FC17 for ; Sat, 24 Mar 2012 07:53:25 +0000 (UTC) Received: from [98.139.91.69] by nm23.bullet.mail.sp2.yahoo.com with NNFMP; 24 Mar 2012 07:53:19 -0000 Received: from [98.139.44.75] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 24 Mar 2012 07:52:29 -0000 Received: from [127.0.0.1] by omp1012.access.mail.sp2.yahoo.com with NNFMP; 24 Mar 2012 07:52:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 724668.95578.bm@omp1012.access.mail.sp2.yahoo.com Received: (qmail 50313 invoked by uid 60001); 24 Mar 2012 07:52:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1332575549; bh=t/a98aNrDsL/gnb3k6r9RTJk2xFZjA3U2w+W+VsX+gs=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Y1a7K+Pm7kYr5yFN7xQtewBcYhOaco61hud/N1P0E1XHSTzYJ8f0AjzNzYaDXxj+EUQc1cYWu1T7q+ehQGBiPffZersW+/cEtfHPyUpiRWTkwnABuJoFeHUerz46ZhBCrsC+OxrnHZMRlLPSIdJN/YMrLseK8U9eEDHTcLv3Fn8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=f5ADZgHV9cmkQAFANvWHqQ8HrjpRNvHgcjg26QGAbC6mHKz0cFu6rxdH74cwFZaHN4QV3V7v8osU7KtbqkmYZP/KrXuCZiLkMyaqelRPge+h+UhD6gF7TTr6vkGjYpvHtlmA8b3hW5T6SQxjelGGCs5IeyF4/9R+R98xzidHaXQ=; X-YMail-OSG: yAa2lXcVM1n0Hc0EYspk9fc03zkwsPNI7OFiT09YZXrOxx8 Ief2tUv7XYiJ85y3kKTqotLiCs9DqxE3vtGQLD0D7E5TBEykyj5dnUmm5g4Q emzWZBYwXUSg0C_4KZE1LwfqZv6lzk9FE_DWEx2xAJyNucmarNiMzFpB0FFT vsDZbbl0N8Cmok6s3pSs61jL.osK2ZoLH1Uk2aayMMZBeVr_fo0Sa3RbHenz 1rDUeS4kqw1fitZWrZElum9W28J1GnIvCByI1FwXrtli25Xaselo1J7MMVcl mWSJvd2YfLh.ypJYjdLLbSCvQRPVOj5CAgZrJG9j8ilicWEEY8_Jwe22ItSr cW.yNPXSd0YhhDGxCwyiEVqn27hjGcIOi0F6vBuLkOCNLbTz1Q.gzV3wAkJo JLg1zI9_YeDqeU8_c3VimHNulL5csyeu64O4q7uH8sKlf8jgP3DtGIXe6xEC fH5gn9HE- Received: from [75.62.236.160] by web180015.mail.gq1.yahoo.com via HTTP; Sat, 24 Mar 2012 00:52:29 PDT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.117.340979 Message-ID: <1332575549.45446.YahooMailClassic@web180015.mail.gq1.yahoo.com> Date: Sat, 24 Mar 2012 00:52:29 -0700 (PDT) From: Sushanth Rai To: Konstantin Belousov In-Reply-To: <20120323113841.GJ2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org Subject: Re: Improving gcore X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2012 07:53:25 -0000 --- On Fri, 3/23/12, Konstantin Belousov wrote: Can we > > safely remove them out of the runq ? > No, since thread on runq shall be considered the same as the > thread > actually executing on CPU. It is unsafe to suspend the > thread in this > state, due to it potentially owning a kernel resource. > > It the thread on runq but not on CPU is set up to return to > usermode > 'immediately' after putting back on CPU, then normal AST > check would > cause its suspend. Threads could have been running in user space and they are on the runq because their time slice expired or they yielded the CPU or got preempted. These threads will only notice the suspension when they enter the kernel via syscall or trap. If we can identify that a thread got switched-out for any of these reasons then it's reasonable to remove it from the runq when dealing with suspensions. >> approach and ofcourse it is missing details at this point. The idea >> again is to suspend all threads as quickly as possible. > I do not see how this would provide any significant difference comparing > with SIGSTOP delivery. The points were signals are checked and the points > were suspension can be applied are essentially the same. I tend to agree with this. Thanks, Sushanth