public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Petr Pavlu <petr.pavlu@suse.com>,
	Linux trace kernel <linux-trace-kernel@vger.kernel.org>
Subject: Re: [bug report] ring-buffer: Limit time with disabled interrupts in rb_check_pages()
Date: Tue, 22 Oct 2024 06:17:14 -0400	[thread overview]
Message-ID: <20241022061714.4f293898@rorschach.local.home> (raw)
In-Reply-To: <d51fd42f-9fc7-4b0b-aae3-ee8bfd909d69@stanley.mountain>

On Tue, 22 Oct 2024 12:09:47 +0300
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> Hello Petr Pavlu,

It's not Petr's fault, but mine.

> 
> Commit 1f1c2bc9d075 ("ring-buffer: Limit time with disabled
> interrupts in rb_check_pages()") from Jul 15, 2024 (linux-next),
> leads to the following Smatch static checker warning:
> 

>     1531         raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
>     1532         head = rb_list_head(cpu_buffer->pages);
>     1533         if (!rb_check_links(cpu_buffer, head))
>     1534                 goto out_locked;
>     1535         buffer_cnt = cpu_buffer->cnt;
>     1536         tmp = head;
>     1537         raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
>     1538                 return;
>                          ^^^^^^
> You probably intended to delete this return?

He sent two patches where the second patch was a fix to mainline. I
asked him to reverse the order so I could send the fix to Linus, in
which he did. In the mean time I switched the order myself for testing
and broke it with this mistake. When he sent the update I took his
patches but accidentally tested and pushed the broken branch to
linux-next.

When Linus took the fix, Stephen Rothwell reported a bad merge between
next and Linus's tree. That's when I realized I had pushed the wrong
branch.

This is the broken branch. I already updated my for-next branch with
the correct commits and when Stephen syncs the linux-next tree, it
should be fixed.

-- Steve


> 
>     1539 
> --> 1540         while (true) {  
>     1541                 raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
>     1542 
>     1543                 if (buffer_cnt != cpu_buffer->cnt) {
>     1544                         /* The list was updated, try again. */
>     1545                         raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
>     1546                         goto again;
>     1547                 }
>     1548 
>     1549                 tmp = rb_list_head(tmp->next);
>     1550                 if (tmp == head)
>     1551                         /* The iteration circled back, all is done. */
>     1552                         goto out_locked;
>     1553 
>     1554                 if (!rb_check_links(cpu_buffer, tmp))
>     1555                         goto out_locked;
>     1556 
>     1557                 raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
>     1558         }
>     1559 
>     1560 out_locked:
>     1561         raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
>     1562 }
> 
> regards,
> dan carpenter


      parent reply	other threads:[~2024-10-22 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  9:09 [bug report] ring-buffer: Limit time with disabled interrupts in rb_check_pages() Dan Carpenter
2024-10-22  9:50 ` Petr Pavlu
2024-10-22 10:17 ` Steven Rostedt [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=20241022061714.4f293898@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=petr.pavlu@suse.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