From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 9 18:09:58 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 377A6106564A for ; Mon, 9 Apr 2012 18:09:58 +0000 (UTC) (envelope-from sushanth_rai@yahoo.com) Received: from nm23.bullet.mail.sp2.yahoo.com (nm23.bullet.mail.sp2.yahoo.com [98.139.91.93]) by mx1.freebsd.org (Postfix) with SMTP id 0CE908FC12 for ; Mon, 9 Apr 2012 18:09:58 +0000 (UTC) Received: from [98.139.91.67] by nm23.bullet.mail.sp2.yahoo.com with NNFMP; 09 Apr 2012 18:09:52 -0000 Received: from [98.139.44.77] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 09 Apr 2012 18:08:52 -0000 Received: from [127.0.0.1] by omp1014.access.mail.sp2.yahoo.com with NNFMP; 09 Apr 2012 18:08:52 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 556930.89548.bm@omp1014.access.mail.sp2.yahoo.com Received: (qmail 58537 invoked by uid 60001); 9 Apr 2012 18:08:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1333994931; bh=tVoQAT/owrGIhU3dC27Aa3jwTXsr1nTDwGOLnlZ/wsE=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Op4btWinCyBdIWT0/KQWNmWDJShn99V4mXOkO3qf0swqfPCDzPzsvaE7QZXFLlgYyHcg4wPTNhnNfY1MsspSHKzZ0tf5jbKVH1Ps15CmjqS4pkj6HtXEADrGwSxyIguJk9k5JjXgTXSBP1pVtVh6AhSVEsjSSkRJhtPPlxAu/EQ= 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:Content-Transfer-Encoding; b=xdLjptPGyBplhq8UHDtibTmlIQ7hbHEFlVXGS0j6S1GkBMc/78lLyR2Yfisv0pK7wz7FsnxLp7kVufy97PNjvI1fwmZ7r2iLiMqRuYCmEl/2xieMAS9GgCu1S0uQoQ21JvPdJ+iiAmsXpSPTCtIwBXAnutUgxEIMW4L+T9pmK7U=; X-YMail-OSG: eZdLQ0cVM1l.ct8gr1BwKi1Vs5fyf_D3fKmywGm3P_a5B3O 7qfxAsq4w2DjxzEpzSK4HnyWDjqO49R7zZUCxO0bOLr9NuMFR6Pt7aWvEak4 TfTNZcDM2XqDYQqYpU.VTPqKkeNpblG53PtGSVFkt3YR7U9KYoU6yjMsUy.6 3HHs4D4Vw9Ji__SJ5TFY3L8BcZN0kAI3XNS9cW33GadE15Mw7LjaqZoH6zND e2q3O9Nj4hzfm3gTc2xCPVmdPHVkqhXmHRzPBJvdFhtIcXSxwH_s6gQe3OSi dvtzzkc5xAz7Aspa8DllTWqcgzThF1svC4uByKlVP7TuJ_Us0HGkNs80Yu_K cN3vxfNOGeHGOGG89Zxq2DS0rNPXqictz1WTxjVIzPUcORoy8_29mPGFhz8q WvH9CWdB3sjXUeMjNZY4H92_tIl6QkUgYQomcRTeCOJklVQM.YFhzZSDHDdk L88bph4w- Received: from [209.119.38.67] by web180004.mail.gq1.yahoo.com via HTTP; Mon, 09 Apr 2012 11:08:50 PDT X-Mailer: YahooMailClassic/15.0.5 YahooMailWebService/0.8.117.340979 Message-ID: <1333994930.58509.YahooMailClassic@web180004.mail.gq1.yahoo.com> Date: Mon, 9 Apr 2012 11:08:50 -0700 (PDT) From: Sushanth Rai To: John Baldwin In-Reply-To: <201204091217.05561.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Startvation of realtime piority threads 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, 09 Apr 2012 18:09:58 -0000 I'm on 7.2. sched_sleep() on 7.2 just records the sleep time. That's why I = though _sleep might the right place to do the check.=0A=0AThanks,=0ASushant= h=0A=0A--- On Mon, 4/9/12, John Baldwin wrote:=0A=0A> Fro= m: John Baldwin =0A> Subject: Re: Startvation of realtime = piority threads=0A> To: "Sushanth Rai" =0A> Cc: fre= ebsd-hackers@freebsd.org=0A> Date: Monday, April 9, 2012, 9:17 AM=0A> On Th= ursday, April 05, 2012 9:08:24=0A> pm Sushanth Rai wrote:=0A> > I understan= d the downside of badly written realtime=0A> app.=A0 In my case =0A> applic= ation runs in userspace without making much syscalls=0A> and by all means i= t =0A> is a well behaved application. Yes, I can wire memory,=0A> change th= e application =0A> to use mutex instead of spinlock and those changes shoul= d=0A> help but they are =0A> still working around the problem. I still beli= eve kernel=0A> should not lower the =0A> realtime priority when blocking on= resources. This can lead=0A> to priority =0A> inversion, especially since = these threads run at fixed=0A> priorities and kernel =0A> doesn't muck with= them.=0A> >=A0 =0A> > As you suggested _sleep() should not adjust the=0A> = priorities for realtime =0A> threads. =0A> =0A> Hmm, sched_sleep() for both= SCHED_4BSD and SCHED_ULE already=0A> does the right=0A> thing here in HEAD= .=0A> =0A> =A0=A0=A0 if (PRI_BASE(td->td_pri_class) !=3D=0A> PRI_TIMESHARE)= =0A> =A0=A0=A0 =A0=A0=A0 return;=0A> =0A> Which OS version did you see this= on?=0A> =0A> -- =0A> John Baldwin=0A>