From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: Setting the priority of an IRQ thread Date: Wed, 17 Jun 2009 11:17:03 +0200 (CEST) Message-ID: References: <000001c9ee36$218cf3a0$a852c70a@dlh.st.com> <20090616182734.GD13048@pengutronix.de> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-2142236691-1245230224=:2800" Cc: Martin Shepherd , linux-rt-users@vger.kernel.org To: =?ISO-8859-15?Q?Uwe_Kleine-K=F6nig?= Return-path: Received: from www.tglx.de ([62.245.132.106]:55835 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756256AbZFQJRV (ORCPT ); Wed, 17 Jun 2009 05:17:21 -0400 In-Reply-To: Sender: linux-rt-users-owner@vger.kernel.org List-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-2142236691-1245230224=:2800 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT On Wed, 17 Jun 2009, Thomas Gleixner wrote: > On Tue, 16 Jun 2009, Uwe Kleine-König wrote: > > On Tue, Jun 16, 2009 at 07:59:28AM +0000, Martin Shepherd wrote: > > > Suresh Kumar SHUKLA st.com> writes: > > > > // get IRQ descriptor from IRQ, it contains pid > > > > desc = &irq_desc[IRQ_BASIC_TIMER_3_1]; > > > > > > That's a very useful clue. I was thinking that I would have to walk the process > > > tree to find the thread by name. Following up on this clue, it appears as though > > > in kernel 2.6.29.4 I should be able to use desc=irq_to_desc(irq) to look up the > > > IRQ descriptor, then use pid=get_task_pid(desc->thread), to get the PID of the > > > IRQ thread, then use sys_sched_setscheduler(pid,...) to change its priority. > > > I'll try that out in the morning. > > I wouldn't recommend calling sys_sched_setscheduler from kernel space. > > That's the userspace API and you need to pass a __user pointer as third > > argument. > > > > The right way is to do this change from userspace. > > What a nonsense. Care to look at the code ? > > The irq/softirq threads call sys_sched_setscheduler() already to > change their priorities. More awake, it should be changed for correctness sake. :) > The right way to do this is to have an interface > set_irq_thread_prio(irq, prio) This still stands, if we need a way to change the prio from the driver. But the more I think about it should be done from user space. Thanks, tglx --8323328-2142236691-1245230224=:2800--