From: Pavel Machek <pavel@ucw.cz>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: linux-leds@vger.kernel.org, dmurphy@ti.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: ledtrig-cpu: Limit to 4 CPUs
Date: Thu, 8 Oct 2020 12:10:51 +0200 [thread overview]
Message-ID: <20201008101051.GB16084@duo.ucw.cz> (raw)
In-Reply-To: <5496ac44-003e-5f2a-7faf-88b4a264dedf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]
Hi!
> > I believe probability someone uses that with more than 4 CPUs is <
> > 5%.
>
> So you even didn't bother to check:
>
> $ git grep "default-trigger = \"cpu[4-9]"
> arch/arm/boot/dts/vexpress-v2m-rs1.dtsi: linux,default-trigger = "cpu4";
> arch/arm/boot/dts/vexpress-v2m-rs1.dtsi: linux,default-trigger = "cpu5";
> arch/arm/boot/dts/vexpress-v2m.dtsi: linux,default-trigger = "cpu4";
> arch/arm/boot/dts/vexpress-v2m.dtsi: linux,default-trigger = "cpu5";
>
> cpus are enumerated starting from 0, so there are more reasons for which
> your patch is broken:
>
> 1. There are mainline users.
> 2. You claim that you limit trigger use to 4 cpus, while the number is
> actually 5, due to your condition:
> + if (cpu > 4)
> + continue;
Ok, fixed.
> 3. For platforms exceeding the limit the number of triggers registered
> would not match the number all available cpus, for no obvious reason.
> Better solution would be to prevent use of the trigger entirely
> in such cases, which would need only to alter first instruction in
> ledtrig_cpu_init(), which currently is:
>
> BUILD_BUG_ON(CONFIG_NR_CPUS > 9999);
Hmm. If I do that I'll get complains from various build bots...
But I might do dependency in Kconfig...
> The correct approach would be to create new trigger with better
> interface and then advise people switching to it.
Patch would be accepted.
> > Probability that someone uses it with more than 100 CPUs is << 1%
> > I'd say. Systems just don't have that many LEDs. I'll take the risk.
> >
> > If I broke someone's real, existing setup, I'll raise the limit.
>
> Is this professional approach - throw a potential bug at users and
> check if it will hit them? :-) And for no reason - you're not fixing
> anything.
I'm sorry I failed to meet your expectations.
I raised limit to 8.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
prev parent reply other threads:[~2020-10-08 10:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-19 9:38 ledtrig-cpu: Limit to 4 CPUs Pavel Machek
2020-09-20 14:15 ` Jacek Anaszewski
2020-09-20 15:39 ` Marek Behun
2020-09-20 16:55 ` Jacek Anaszewski
2020-09-20 17:33 ` Marek Behun
2020-09-20 17:49 ` Jacek Anaszewski
2020-09-20 18:34 ` Pavel Machek
2020-09-21 22:14 ` Jacek Anaszewski
2020-09-21 22:42 ` Pavel Machek
2020-09-22 20:41 ` Jacek Anaszewski
2020-09-25 8:51 ` Jacek Anaszewski
2020-09-25 9:40 ` Pavel Machek
2020-09-26 13:59 ` Jacek Anaszewski
2020-10-08 10:10 ` Pavel Machek [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=20201008101051.GB16084@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
/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).