From: Petr Mladek <pmladek@suse.com>
To: "chunlei.wang" <Chunlei.wang@mediatek.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
John Ogness <john.ogness@linutronix.de>
Subject: Re: [PATCH] Fix prb_next_seq() performance issue
Date: Mon, 25 Oct 2021 15:18:25 +0200 [thread overview]
Message-ID: <YXaufehhi8QVCnds@alley> (raw)
In-Reply-To: <11f00d85b770e676cd0e06d87cc819ce82bb0beb.camel@mediatek.com>
On Mon 2021-10-25 13:51:07, chunlei.wang wrote:
>
> Subject: [PATCH] Fix prb_next_seq() performance issue.
>
> prb_next_seq() function have a performance issue, in bad case it will
> check all the seqs. If log buffer is 256K, the number of while loop
> is 8K, 512K is 16K, 2M is 64K, it will cause performance issue.
> we have a process use do_syslog poll&read method to read kernel log,
> sometime the cpu loading is 50%. So we add old_seq to reduce the
> loop time. It only check new log times.
The patch looks good and probably helps in the described use-case.
But the search might still be quite slow because @clear_seq or
@sysrq_seq might be far behind the last_seq.
I am going to send alternative patch that stores @id of the last
finalized message. It starts the search from there. All the tricks
will be hidden in the ring buffer code, so that it will be
easier to use. Also it should be more reliable.
Best Regards,
Petr
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-10-25 13:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 6:21 [PATCH] printk: Add printk log prefix information chunlei.wang
2020-04-24 7:02 ` Sergey Senozhatsky
2021-10-25 5:51 ` [PATCH] Fix prb_next_seq() performance issue chunlei.wang
2021-10-25 13:18 ` Petr Mladek [this message]
2021-10-25 13:20 ` [PATCH] printk: ringbuffer: Improve prb_next_seq() performance Petr Mladek
2021-10-25 22:06 ` John Ogness
2021-10-25 22:24 ` John Ogness
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=YXaufehhi8QVCnds@alley \
--to=pmladek@suse.com \
--cc=Chunlei.wang@mediatek.com \
--cc=john.ogness@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.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