linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Peter Zijlstra <peterz@infradead.org>,
	Andy Walls <andy@silverblocksystems.net>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
	Andy Walls <awalls@md.metrocast.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 4/5] media/ivtv: Reduce default FIFO priority
Date: Wed, 7 Aug 2019 11:26:33 +0200	[thread overview]
Message-ID: <c3f71479-d280-94ad-ab20-5098e599526a@xs4all.nl> (raw)
In-Reply-To: <20190802085822.GA2386@hirez.programming.kicks-ass.net>

On 8/2/19 10:58 AM, Peter Zijlstra wrote:
> On Thu, Aug 01, 2019 at 02:38:06PM +0200, Peter Zijlstra wrote:
>> If the consumer of the data are RT tasks as well (I hadn't expected that
>> from a TV capture device) then I'd propose to use FIFO-50 as default.
>>
>> The thing is, the moment you're doing actual proper RT, the admin needs
>> to configure things anyway, which then very much includes setting the
>> priority of interrupt threads and the like.
>>
>> (that is exacty why pretty much everything defaults to FIFO-50)
> 
> Is the below acceptible?

I think this should be OK. ivtv is real-time sensitive since certain
tasks have to happen within (if I remember correctly) 1/60th of a second
(the time it takes to capture a single video field). Data is lost if it
can't be done within that time.

Using FIFO-50 means that it competes with other irq threads, and since
irq threads shouldn't take up much time anyway this should be OK.

Andy, what do you think?

Regards,

	Hans

> 
> ---
> Subject: media/ivtv: Reduce default FIFO priority
> From: Peter Zijlstra <peterz@infradead.org>
> Date: Thu Aug  1 12:56:40 CEST 2019
> 
> The ivtv driver creates a FIFO-99 thread by default, reduce this to
> FIFO-50.
> 
> FIFO-99 is the very highest priority available to SCHED_FIFO and
> it not a suitable default; it would indicate the ivtv work is the
> most important work on the machine.
> 
> Cc: Andy Walls <awalls@md.metrocast.net>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-media@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  drivers/media/pci/ivtv/ivtv-driver.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/media/pci/ivtv/ivtv-driver.c
> +++ b/drivers/media/pci/ivtv/ivtv-driver.c
> @@ -738,7 +738,7 @@ static void ivtv_process_options(struct
>   */
>  static int ivtv_init_struct1(struct ivtv *itv)
>  {
> -	struct sched_param param = { .sched_priority = 99 };
> +	struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
>  
>  	itv->base_addr = pci_resource_start(itv->pdev, 0);
>  	itv->enc_mbox.max_mbox = 2; /* the encoder has 3 mailboxes (0-2) */
> 


  reply	other threads:[~2019-08-07  9:26 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 11:13 [PATCH 0/5] Fix FIFO-99 abuse Peter Zijlstra
2019-08-01 11:13 ` [PATCH 1/5] sched/pci: Reduce psimon FIFO priority Peter Zijlstra
2019-08-01 17:49   ` Johannes Weiner
2019-08-01 18:31     ` Suren Baghdasaryan
2019-08-01 21:03       ` Suren Baghdasaryan
2019-08-01 21:02     ` Peter Zijlstra
2019-08-01 11:13 ` [PATCH 2/5] rcu/tree: Fix SCHED_FIFO params Peter Zijlstra
2019-08-01 13:51   ` Paul E. McKenney
2019-08-01 14:43     ` Peter Zijlstra
2019-08-01 15:33       ` Paul E. McKenney
2019-08-01 11:13 ` [PATCH 3/5] crypto: Reduce default RT priority Peter Zijlstra
2019-08-09  6:19   ` Herbert Xu
2019-08-01 11:13 ` [PATCH 4/5] media/ivtv: Reduce default FIFO priority Peter Zijlstra
2019-08-01 12:24   ` Andy Walls
2019-08-01 12:38     ` Peter Zijlstra
2019-08-02  8:58       ` Peter Zijlstra
2019-08-07  9:26         ` Hans Verkuil [this message]
2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
2019-08-01 11:26   ` Mark Brown
2019-08-01 12:07     ` Peter Zijlstra
2019-08-01 11:27   ` Geert Uytterhoeven
2019-08-01 12:12     ` Peter Zijlstra
2019-08-01 12:16       ` Geert Uytterhoeven
2019-08-01 11:27   ` Enric Balletbo i Serra
2019-08-01 12:17     ` Peter Zijlstra
2019-08-01 12:35       ` Mark Brown
2019-08-01 15:44         ` Doug Anderson
2019-08-02 11:22   ` Applied "spi: Reduce kthread priority" to the spi tree Mark Brown
2019-08-01 13:17 ` [PATCH 0/5] Fix FIFO-99 abuse Qais Yousef
2019-08-02  9:32   ` Peter Zijlstra
2019-08-02  9:50     ` Thomas Gleixner
2019-08-02 10:26     ` Qais Yousef
2019-08-02 12:41       ` Peter Zijlstra
2019-08-02 14:08         ` Qais Yousef
2019-08-02 14:33           ` Peter Zijlstra
2019-08-02 15:21             ` Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3f71479-d280-94ad-ab20-5098e599526a@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=andy@silverblocksystems.net \
    --cc=awalls@md.metrocast.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).