From: David Laight <David.Laight@ACULAB.COM>
To: 'John Ogness' <john.ogness@linutronix.de>,
'Petr Mladek' <pmladek@suse.com>,
"Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Marco Elver <elver@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: 5.19 printk breaks message ordering
Date: Sun, 19 Jun 2022 14:24:26 +0000 [thread overview]
Message-ID: <f7b4b14ab186464488cb52a5c425751a@AcuMS.aculab.com> (raw)
In-Reply-To: <87edzlrrva.fsf@jogness.linutronix.de>
From: John Ogness
> Sent: 19 June 2022 09:16
>
> On 2022-06-17, David Laight <David.Laight@ACULAB.COM> wrote:
> > What priority do these kthreads run at?
>
> 120 (SCHED_OTHER, nice=0)
>
> > I'd have thought they ought to run at a high priority?
> > That should tend to give kernel messages priority over user ones.
> >
> > Quite how high is another matter.
> > Probably a bit below the RT/FIFO:50 of threaded ISR.
>
> As a default value, I recommend keeping to the SCHED_OTHER policy as a
> default. Perhaps a nice value of -20? There are quite a few kernel
> threads using that as their default:
That doesn't mean it is a sensible priority :-)
Running at (SCHED_OTHER, nice=0) is almost certainly worse.
There is little guarantee they'll run if the system is busy
and has non-default priority user threads.
I know there is the NIBY style 'my process is more important than yours'
But processes that don't run for very long, or have to run
in order to keep the system working properly, almost certainly
need to be higher priority than the lowest RT one.
I've been fighting system thread priorities on a system that
is doing a lot of real time audio over UDP (ie RTP).
The application threads processing the RTP need to run in preference
to all other application threads (nothing else is that time critical).
Processor affinities don't help - they can only really be used to
move things away from some cpu, and I need to use the idle time.
Running the RTP threads at a RT priority works reasonably well
except that some system threads (like the softint ones napi uses)
get blocked - causing lost packets.
Threaded napi helps - but only if I run the threads under the RT
scheduler.
David
>
> # ps -Leo ni,command | grep ^-20 | sort
> -20 [acpi_thermal_pm]
> -20 [ata_sff]
> -20 [blkcg_punt_bio]
> -20 [cfg80211]
> -20 [inet_frag_wq]
> -20 [ipv6_addrconf]
> -20 [kblockd]
> -20 [kworker/0:0H-events_highpri]
> -20 [kworker/0:1H-events_highpri]
> -20 [md]
> -20 [mld]
> -20 [mm_percpu_wq]
> -20 [netns]
> -20 [nfsiod]
> -20 [rcu_gp]
> -20 [rcu_par_gp]
> -20 [rpciod]
> -20 [scsi_tmf_0]
> -20 [scsi_tmf_1]
> -20 [writeback]
> -20 [xprtiod]
>
> John Ogness
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2022-06-19 14:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 13:23 Jason A. Donenfeld
2022-06-17 13:37 ` Jason A. Donenfeld
2022-06-17 13:38 ` [PATCH] printk: allow direct console printing to be enabled always Jason A. Donenfeld
2022-06-19 0:30 ` Randy Dunlap
2022-06-19 8:37 ` Jason A. Donenfeld
2022-06-19 11:05 ` John Ogness
2022-06-19 20:39 ` Jason A. Donenfeld
2022-06-19 20:43 ` [PATCH v2] " Jason A. Donenfeld
2022-06-19 23:17 ` John Ogness
2022-06-19 23:28 ` Jason A. Donenfeld
2022-06-19 23:33 ` [PATCH v3] " Jason A. Donenfeld
2022-06-20 16:58 ` Petr Mladek
2022-06-20 17:03 ` Jason A. Donenfeld
2022-06-21 9:43 ` David Laight
2022-06-21 9:59 ` Jason A. Donenfeld
2022-06-22 12:55 ` Jason A. Donenfeld
2022-06-20 4:04 ` [PATCH v2] " David Laight
2022-06-20 5:17 ` Sergey Senozhatsky
2022-06-20 7:56 ` Jason A. Donenfeld
2022-06-21 1:34 ` Sergey Senozhatsky
2022-06-21 21:47 ` John Ogness
2022-06-17 14:21 ` 5.19 printk breaks message ordering Petr Mladek
2022-06-17 14:41 ` Jason A. Donenfeld
2022-06-17 15:01 ` David Laight
2022-06-19 8:15 ` John Ogness
2022-06-19 14:24 ` David Laight [this message]
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=f7b4b14ab186464488cb52a5c425751a@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=Jason@zx2c4.com \
--cc=elver@google.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
/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
Powered by JetHome