linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] genirq: Set the irq thread policy without checking CAP_SYS_NICE
@ 2013-10-11 11:00 Sebastian Andrzej Siewior
  2013-10-14 10:49 ` Ivo Sieben
  2013-10-28  8:54 ` [tip:irq/urgent] " tip-bot for Thomas Pfaff
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-11 11:00 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ivo Sieben, Thomas Pfaff, linux-kernel, linux-rt-users,
	Sebastian Andrzej Siewior

From: Thomas Pfaff <tpfaff@pcs.com>

In commit ee23871389 ("genirq: Set irq thread to RT priority on
creation") we moved the assigment of the thread's priority from the
thread's function into __setup_irq(). That function may run in user
context for instance if the user opens an UART node and then driver
calls requests in the ->open() callback. That user may not have
CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER
policy.

This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE
check which is otherwise required for the SCHED_OTHER policy.

Cc: Ivo Sieben <meltedpianoman@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
[bigeasy: rewrite the changelog]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/irq/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 514bcfd..3e59f95 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -956,7 +956,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 			goto out_mput;
 		}
 
-		sched_setscheduler(t, SCHED_FIFO, &param);
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
 
 		/*
 		 * We keep the reference to the task struct even if
-- 
1.8.4.rc3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] genirq: Set the irq thread policy without checking CAP_SYS_NICE
  2013-10-11 11:00 [PATCH] genirq: Set the irq thread policy without checking CAP_SYS_NICE Sebastian Andrzej Siewior
@ 2013-10-14 10:49 ` Ivo Sieben
  2013-10-28  8:54 ` [tip:irq/urgent] " tip-bot for Thomas Pfaff
  1 sibling, 0 replies; 3+ messages in thread
From: Ivo Sieben @ 2013-10-14 10:49 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: Thomas Gleixner, Thomas Pfaff, LKML, RT

Patch looks OK to me.. but I'm not an expert.

Regards,
Ivo Sieben

2013/10/11 Sebastian Andrzej Siewior <bigeasy@linutronix.de>:
> From: Thomas Pfaff <tpfaff@pcs.com>
>
> In commit ee23871389 ("genirq: Set irq thread to RT priority on
> creation") we moved the assigment of the thread's priority from the
> thread's function into __setup_irq(). That function may run in user
> context for instance if the user opens an UART node and then driver
> calls requests in the ->open() callback. That user may not have
> CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER
> policy.
>
> This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE
> check which is otherwise required for the SCHED_OTHER policy.
>
> Cc: Ivo Sieben <meltedpianoman@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
> [bigeasy: rewrite the changelog]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  kernel/irq/manage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 514bcfd..3e59f95 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -956,7 +956,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
>                         goto out_mput;
>                 }
>
> -               sched_setscheduler(t, SCHED_FIFO, &param);
> +               sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
>
>                 /*
>                  * We keep the reference to the task struct even if
> --
> 1.8.4.rc3
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:irq/urgent] genirq: Set the irq thread policy without checking CAP_SYS_NICE
  2013-10-11 11:00 [PATCH] genirq: Set the irq thread policy without checking CAP_SYS_NICE Sebastian Andrzej Siewior
  2013-10-14 10:49 ` Ivo Sieben
@ 2013-10-28  8:54 ` tip-bot for Thomas Pfaff
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Thomas Pfaff @ 2013-10-28  8:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, bigeasy, tglx, meltedpianoman, tpfaff

Commit-ID:  bbfe65c219c638e19f1da5adab1005b2d68ca810
Gitweb:     http://git.kernel.org/tip/bbfe65c219c638e19f1da5adab1005b2d68ca810
Author:     Thomas Pfaff <tpfaff@pcs.com>
AuthorDate: Fri, 11 Oct 2013 13:00:40 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 28 Oct 2013 09:50:42 +0100

genirq: Set the irq thread policy without checking CAP_SYS_NICE

In commit ee23871389 ("genirq: Set irq thread to RT priority on
creation") we moved the assigment of the thread's priority from the
thread's function into __setup_irq(). That function may run in user
context for instance if the user opens an UART node and then driver
calls requests in the ->open() callback. That user may not have
CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER
policy.

This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE
check which is otherwise required for the SCHED_OTHER policy.

[bigeasy: Rewrite the changelog]

Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Cc: Ivo Sieben <meltedpianoman@gmail.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1381489240-29626-1-git-send-email-bigeasy@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 514bcfd..3e59f95 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -956,7 +956,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 			goto out_mput;
 		}
 
-		sched_setscheduler(t, SCHED_FIFO, &param);
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
 
 		/*
 		 * We keep the reference to the task struct even if

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-28  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 11:00 [PATCH] genirq: Set the irq thread policy without checking CAP_SYS_NICE Sebastian Andrzej Siewior
2013-10-14 10:49 ` Ivo Sieben
2013-10-28  8:54 ` [tip:irq/urgent] " tip-bot for Thomas Pfaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).