From: Hannes Reinecke <hare@suse.de>
To: Jens Axboe <axboe@kernel.dk>, Ming Lei <tom.leiming@gmail.com>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] blk-mq: avoid sysfs buffer overflow by too many CPU cores
Date: Mon, 4 Nov 2019 07:57:43 +0100 [thread overview]
Message-ID: <6eaff732-a4df-3465-c9f5-427bfb5caa20@suse.de> (raw)
In-Reply-To: <a7100fe3-fe27-407a-8237-27dc31df59d0@kernel.dk>
On 11/4/19 2:56 AM, Jens Axboe wrote:
> On 11/3/19 4:57 PM, Ming Lei wrote:
>> On Sun, Nov 3, 2019 at 8:28 AM Chaitanya Kulkarni
>> <Chaitanya.Kulkarni@wdc.com> wrote:
>>>
>>> Ming,
>>>
>>> On 11/02/2019 01:02 AM, Ming Lei wrote:
>>>> It is reported that sysfs buffer overflow can be triggered in case
>>>> of too many CPU cores(>841 on 4K PAGE_SIZE) when showing CPUs of
>>>> hctx via/sys/block/$DEV/mq/$N/cpu_list.
>>>>
>>>> So use snprintf for avoiding the potential buffer overflow.
>>>>
>>>> This version doesn't change the attribute format, and simply stop
>>>> to show CPU number if the buffer is to be overflow.
>>>
>>> Does it make sense to also add a print or WARN_ON in case of overflow ?
>>
>> Yes, it does, could you cook a patch for that?
>
> No it doesn't. The WARN_ON brings absolutely nothing. If you're using
> a script, it gets the same values out and doesn't see the warning. If
> it's a human cat'ing it, they will probably already realize that
> we're missing CPUs. Or maybe not even see the warning. It's useless.
>
> We should either make this seqfile, or just kill the file. Those are
> the only two options that make any sense.
>
I'd rather retain that file; it proved really useful when debugging
interrupt affinity issues.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer
next prev parent reply other threads:[~2019-11-04 6:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-02 8:02 [PATCH] blk-mq: avoid sysfs buffer overflow by too many CPU cores Ming Lei
2019-11-02 14:03 ` Jens Axboe
2019-11-03 0:25 ` Chaitanya Kulkarni
2019-11-03 15:02 ` Jens Axboe
2019-11-03 20:26 ` Chaitanya Kulkarni
2019-11-03 23:57 ` Ming Lei
2019-11-04 1:56 ` Jens Axboe
2019-11-04 6:57 ` Hannes Reinecke [this message]
2019-11-04 14:13 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2019-08-15 12:15 Ming Lei
2019-08-15 12:24 ` Greg KH
2019-08-15 12:29 ` Ming Lei
2019-08-15 12:35 ` Greg KH
2019-08-15 12:43 ` Ming Lei
2019-08-15 13:21 ` Greg KH
2019-08-15 23:10 ` Ray, Mark C (Global Solutions Engineering (GSE))
2019-08-16 2:49 ` Ming Lei
2019-08-16 7:12 ` Greg KH
2019-08-16 14:21 ` Jens Axboe
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=6eaff732-a4df-3465-c9f5-427bfb5caa20@suse.de \
--to=hare@suse.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tom.leiming@gmail.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;
as well as URLs for NNTP newsgroup(s).