Linus Torvalds
bb5a93aaf2
x86/ldt: use "pr_info_once()" instead of open-coding it badly
...
Using a mutex for "print this warning only once" is so overdesigned as
to be actively offensive to my sensitive stomach.
Just use "pr_info_once()" that already does this, although in a
(harmlessly) racy manner that can in theory cause the message to be
printed twice if more than one CPU races on that "is this the first
time" test.
[ If somebody really cares about that harmless data race (which sounds
very unlikely indeed), that person can trivially fix printk_once() by
using a simple atomic access, preferably with an optimistic non-atomic
test first before even bothering to treat the pointless "make sure it
is _really_ just once" case.
A mutex is most definitely never the right primitive to use for
something like this. ]
Yes, this is a small and meaningless detail in a code path that hardly
matters. But let's keep some code quality standards here, and not
accept outrageously bad code.
Link: https://lore.kernel.org/lkml/CAHk-=wgV9toS7GU3KmNpj8hCS9SeF+A0voHS8F275_mgLhL4Lw@mail.gmail.com/
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Peter Zijlstra (Intel) <peterz@infradead.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-07-05 12:50:20 -07:00
..
2020-06-09 09:39:13 -07:00
2020-06-13 10:05:47 -07:00
2020-07-05 12:23:49 -07:00
2020-06-29 10:02:00 +02:00
2020-06-20 13:17:47 -07:00
2020-03-25 11:50:48 +01:00
2020-06-11 15:14:54 +02:00
2020-06-09 09:39:13 -07:00
2020-05-22 18:24:40 +02:00
2020-05-27 13:05:59 +02:00
2019-03-23 12:11:49 +01:00
2019-05-24 17:39:02 +02:00
2020-03-30 19:14:28 -07:00
2020-06-11 15:15:23 +02:00
2020-03-08 09:58:17 +01:00
2020-05-19 18:03:07 +02:00
2017-11-02 11:10:55 +01:00
2018-11-23 07:59:59 +01:00
2019-05-30 11:25:17 -07:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2017-11-02 11:10:55 +01:00
2019-08-09 22:52:10 +10:00
2020-01-09 14:40:03 +01:00
2018-11-23 07:59:59 +01:00
2020-06-11 15:15:03 +02:00
2020-04-14 14:24:05 +02:00
2020-06-11 15:15:23 +02:00
2020-06-17 10:57:41 -07:00
2020-06-11 20:02:46 +02:00
2020-06-09 09:39:13 -07:00
2019-11-29 12:17:58 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:07 +02:00
2020-06-09 09:39:13 -07:00
2020-04-30 20:14:34 +02:00
2020-06-11 15:14:37 +02:00
2020-06-17 10:57:41 -07:00
2018-11-20 09:43:10 +01:00
2020-06-09 09:39:13 -07:00
2020-02-22 23:37:37 +01:00
2020-06-11 15:15:16 +02:00
2020-01-06 09:45:59 +01:00
2020-06-11 15:15:22 +02:00
2019-05-30 11:26:32 -07:00
2019-06-29 11:35:35 +02:00
2020-06-09 09:39:13 -07:00
2020-06-11 15:15:26 +02:00
2020-02-26 15:21:22 +01:00
2019-05-24 08:46:06 +02:00
2020-05-28 21:36:20 +02:00
2020-06-11 15:15:12 +02:00
2020-06-11 15:15:07 +02:00
2020-06-11 15:15:14 +02:00
2020-06-11 15:15:15 +02:00
2019-10-18 11:58:33 +02:00
2020-06-09 09:39:13 -07:00
2020-04-27 02:07:40 -04:00
2019-10-10 15:43:59 +02:00
2020-03-27 11:05:41 +01:00
2019-11-12 16:21:15 +01:00
2020-02-23 21:59:42 +01:00
2020-06-17 10:57:41 -07:00
2019-11-12 16:21:15 +01:00
2020-06-13 10:05:47 -07:00
2020-02-17 14:40:23 +01:00
2020-07-05 12:50:20 -07:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2020-06-11 20:02:46 +02:00
2017-11-02 11:10:55 +01:00
2020-06-09 09:39:13 -07:00
2019-07-16 23:13:48 +02:00
2019-08-19 21:54:16 -07:00
2017-11-02 11:10:55 +01:00
2020-06-15 14:10:09 +02:00
2019-04-29 16:05:49 +02:00
2018-09-03 16:50:35 +02:00
2020-06-09 09:39:13 -07:00
2019-11-28 11:16:43 -08:00
2018-08-02 14:33:19 +02:00
2019-09-03 08:36:30 +02:00
2018-07-24 09:46:42 +02:00
2019-06-24 19:19:24 +02:00
2018-04-27 16:44:29 +02:00
2017-11-07 15:35:57 +01:00
2020-06-18 12:10:37 -07:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2020-06-11 15:54:31 -07:00
2019-10-01 20:31:35 +02:00
2020-06-09 09:39:13 -07:00
2020-02-17 14:40:23 +01:00
2020-01-06 09:45:59 +01:00
2017-11-02 11:10:55 +01:00
2020-06-11 15:54:31 -07:00
2019-10-18 09:53:19 +02:00
2020-03-25 18:28:28 +01:00
2017-11-02 11:10:55 +01:00
2018-05-19 14:03:14 +02:00
2020-06-02 10:59:12 -07:00
2020-04-27 09:28:16 +02:00
2018-04-25 10:40:56 -05:00
2020-06-01 16:21:46 -07:00
2020-06-11 15:15:16 +02:00
2020-06-09 09:39:13 -07:00
2020-02-15 17:26:26 -05:00
2017-11-02 11:10:55 +01:00
2020-06-03 16:59:21 -04:00
2020-03-21 16:03:25 +01:00
2019-07-22 10:47:11 +02:00
2020-01-20 10:57:53 +01:00
2019-05-30 11:26:32 -07:00
2020-06-09 09:39:14 -07:00
2020-06-11 15:54:31 -07:00
2019-06-27 23:48:04 +02:00
2019-05-30 11:29:21 -07:00
2020-03-25 12:59:35 +01:00
2017-11-02 11:10:55 +01:00
2020-06-11 15:15:16 +02:00
2020-07-05 12:23:49 -07:00
2020-03-30 19:55:39 -07:00
2020-02-16 20:58:06 +01:00
2020-05-21 23:07:00 +02:00
2020-04-15 11:13:12 +02:00
2020-06-11 15:15:29 +02:00
2019-05-21 10:50:45 +02:00
2020-05-22 19:55:17 +02:00
2019-10-27 09:00:28 +01:00
2019-10-18 10:04:04 +02:00
2020-06-09 09:39:14 -07:00
2020-06-13 10:05:47 -07:00
2019-06-05 17:37:08 +02:00
2020-05-19 15:53:57 +02:00