From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 26 06:34:23 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 3154F1065670 for ; Mon, 26 Mar 2012 06:34:23 +0000 (UTC) (envelope-from sushanth_rai@yahoo.com) Received: from nm19.bullet.mail.sp2.yahoo.com (nm19.bullet.mail.sp2.yahoo.com [98.139.91.89]) by mx1.freebsd.org (Postfix) with SMTP id E29CE8FC16 for ; Mon, 26 Mar 2012 06:34:22 +0000 (UTC) Received: from [98.139.91.68] by nm19.bullet.mail.sp2.yahoo.com with NNFMP; 26 Mar 2012 06:34:16 -0000 Received: from [98.139.44.78] by tm8.bullet.mail.sp2.yahoo.com with NNFMP; 26 Mar 2012 06:34:15 -0000 Received: from [127.0.0.1] by omp1015.access.mail.sp2.yahoo.com with NNFMP; 26 Mar 2012 06:34:15 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 982293.56693.bm@omp1015.access.mail.sp2.yahoo.com Received: (qmail 1223 invoked by uid 60001); 26 Mar 2012 06:34:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1332743655; bh=E+p7+sly2hdG/jpbuKCt9zISVh7P8ciS7+egvW9u3OM=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=yduukkPHWj2/XYG4WIDDMQ/wMbvS51zEsczHQWv4lm1RWS9U4OJ3ouGRwp8UtyQNrgzxVm5BCCiq45H1UezwACMO9NNDZ3YDUOfGTjfi1Mom7kiw7aPk7MkdXJLSBD55/DCV4dyiPGQTKtEir9mPfbonnRE/kMwwcNA6ygR3B98= 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=Efwxx+bi9yRjJLFhwzCDAoNva2BzqC+WNsyb1z4mkrXlW8hrYt6jb40ny8VHADU/21ve6GJoPQSpw383SBNwEsiuS73H1RqvyHneZz1enAxfBcnghnuhuszPRZK7nBNeC7Bugg06QnO95EB/5axmV01ISSh+fUG5w2fsFlSJh1A=; X-YMail-OSG: 4Jepwj4VM1neVR_WSa5dfUcJkiaPkwWCVR8zFfdN.PHNn5p 6dHA.G.T7yMqnXccwEmDYAg07dt6as9JF8_.qpzHsqWRlKNuZIDZS85m.tJS kRJNiYoWg59wbMHmyb057uz.Q2UT_5LR1GY_Q3Wndb6JG_Oe_VbU050D14l9 82Rl_bS4vf3QxY4jFjWAetB_8a3rPg0H6fuDpXjU4IVPtDz.36nfdT7a2Quy j774yL_unv5FJj34M9Du0fTbhO3ouXJzcXNED6Nr_OiwlgTd5Y_iAtW9FzY5 _OgI7bOOqpamyopMPTlU3x9Xr.XiVo4fOPdn6K80hSwtlWdeQkwcAIvonCuv Yq8pR8EQK9vnGOhSHO2gUiYAyQN2LKwd_23XHlsinaJNMoS70doDyXLk0SVt I.JuN3uAP154IqQP3GVDobTlhYUOkPawxjB3Uhh_AdYcaJwPddelK1y8y6tD 8b3_RTvE- Received: from [75.62.236.160] by web180010.mail.gq1.yahoo.com via HTTP; Sun, 25 Mar 2012 23:34:15 PDT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.117.340979 Message-ID: <1332743655.97165.YahooMailClassic@web180010.mail.gq1.yahoo.com> Date: Sun, 25 Mar 2012 23:34:15 -0700 (PDT) From: Sushanth Rai To: Konstantin Belousov In-Reply-To: <20120324080129.GT2358@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: Mon, 26 Mar 2012 06:34:23 -0000 --- On Sat, 3/24/12, Konstantin Belousov wrote: > No, I mentioned exactly this in paragraph you replied to. > To actually start executing from runq, thread needs to > transition > from kernel to userspace (in other words, thread appears on > runq > due to interrupt, thus entering kernel space). On the > kernel->user > transition, the thread will be suspended in AST handler. > > So, if pending AST catched usermode thread on runq, no > single usermode > instruction is executed by the thread before suspension. > Got it. Basically if the usermode thread's time slice is up, AST handler (triggered due timer interrupt) would switch-out the thread when it sees TDF_NEERESCHED flag. When thread starts running again, userret() called from AST handler would check for suspension. I guess it was much ado about nothing. At least I got understand the code little better. Much thanks for that. Sushanth