Re: [PATCH] Fix prb_next_seq() performance issue

From
Petr Mladek <pmladek@suse.com>
Date
2021-10-25 13:20:07
Also in
linux-mediatek
Reply to
chunlei.wang, 2021-10-25
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
Thread (7 messages) 7 messages, 4 authors, last reply 2021-10-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help