Re: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when rewinding persistent ring buffer

2026-03-23 Thread Google
On Mon, 23 Mar 2026 07:18:07 +0800
kernel test robot  wrote:

> Hi Masami,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on trace/for-next]
> [also build test ERROR on geert-m68k/for-next geert-m68k/for-linus 
> openrisc/for-next deller-parisc/for-next powerpc/next powerpc/fixes 
> s390/features uml/next tip/x86/core uml/fixes v7.0-rc4 next-20260320]
> [cannot apply to linus/master]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:
> https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/ring-buffer-Fix-to-update-per-subbuf-entries-of-persistent-ring-buffer/20260322-122412
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace 
> for-next
> patch link:
> https://lore.kernel.org/r/177391156211.193994.7531495945584650297.stgit%40mhiramat.tok.corp.google.com
> patch subject: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when 
> rewinding persistent ring buffer
> config: x86_64-kexec 
> (https://download.01.org/0day-ci/archive/20260323/[email protected]/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 
> 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): 
> (https://download.01.org/0day-ci/archive/20260323/[email protected]/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version 
> of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot 
> | Closes: 
> https://lore.kernel.org/oe-kbuild-all/[email protected]/
> 
> All errors (new ones prefixed by >>):
> 
> >> kernel/trace/ring_buffer.c:1965:15: error: use of undeclared identifier 
> >> 'bpage'
> 1965 | local_set(&bpage->entries, 0);
>  |^
>kernel/trace/ring_buffer.c:1966:15: error: use of undeclared identifier 
> 'bpage'
> 1966 | local_set(&bpage->page->commit, 0);
>  |^
>2 errors generated.
> 
> 
> vim +/bpage +1965 kernel/trace/ring_buffer.c
> 
>   1910
>   1911/* If the meta data has been validated, now validate the events 
> */
>   1912static void rb_meta_validate_events(struct ring_buffer_per_cpu 
> *cpu_buffer)
>   1913{
>   1914struct ring_buffer_cpu_meta *meta = 
> cpu_buffer->ring_meta;
>   1915struct buffer_page *head_page, *orig_head;
>   1916unsigned long entry_bytes = 0;
>   1917unsigned long entries = 0;
>   1918int discarded = 0;
>   1919int ret;
>   1920u64 ts;
>   1921int i;
>   1922
>   1923if (!meta || !meta->head_buffer)
>   1924return;
>   1925
>   1926orig_head = head_page = cpu_buffer->head_page;
>   1927
>   1928/* Do the reader page first */
>   1929ret = rb_validate_buffer(cpu_buffer->reader_page, 
> cpu_buffer->cpu, meta);
>   1930if (ret < 0) {
>   1931pr_info("Ring buffer meta [%d] invalid reader 
> page detected\n",
>   1932cpu_buffer->cpu);
>   1933discarded++;
>   1934} else {
>   1935entries += ret;
>   1936entry_bytes += 
> rb_page_size(cpu_buffer->reader_page);
>   1937}
>   1938
>   1939ts = head_page->page->time_stamp;
>   1940
>   1941/*
>   1942 * Try to rewind the head so that we can read the pages 
> which already
>   1943 * read in the previous boot.
>   1944 */
>   1945if (head_page == cpu_buffer->tail_page)
>   1946goto skip_rewind;
>   1947
>   1948rb_dec_page(&head_page);
>   1949for (i = 0; i < meta->nr_subbufs + 1; i++, 
> rb_dec_page(&head_page)) {
>   1950
>   1951/* Rewind until tail (writer) page. */
>   1952if (head_page == cpu_buffer->tail_page)
>   1953break;
>   1954
>   1955/* Rewind until unused page (no timestamp, no 
> commit). */
>   1956if (!head_page->page->time_stamp && 
> rb_page_commit(head_page) == 0)
>   1957break;
>   1958
>   1959/*
>   1960 * Skip if the page is invalid, or its 
> timestamp is newer than the
>   1961 * previous valid page

Re: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when rewinding persistent ring buffer

2026-03-22 Thread kernel test robot
Hi Masami,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[also build test ERROR on geert-m68k/for-next geert-m68k/for-linus 
openrisc/for-next deller-parisc/for-next powerpc/next powerpc/fixes 
s390/features uml/next tip/x86/core uml/fixes v7.0-rc4 next-20260320]
[cannot apply to linus/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:
https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/ring-buffer-Fix-to-update-per-subbuf-entries-of-persistent-ring-buffer/20260322-122412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace 
for-next
patch link:
https://lore.kernel.org/r/177391156211.193994.7531495945584650297.stgit%40mhiramat.tok.corp.google.com
patch subject: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when 
rewinding persistent ring buffer
config: x86_64-kexec 
(https://download.01.org/0day-ci/archive/20260323/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 
87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260323/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> kernel/trace/ring_buffer.c:1965:15: error: use of undeclared identifier 
>> 'bpage'
1965 | local_set(&bpage->entries, 0);
 |^
   kernel/trace/ring_buffer.c:1966:15: error: use of undeclared identifier 
'bpage'
1966 | local_set(&bpage->page->commit, 0);
 |^
   2 errors generated.


vim +/bpage +1965 kernel/trace/ring_buffer.c

  1910  
  1911  /* If the meta data has been validated, now validate the events */
  1912  static void rb_meta_validate_events(struct ring_buffer_per_cpu 
*cpu_buffer)
  1913  {
  1914  struct ring_buffer_cpu_meta *meta = cpu_buffer->ring_meta;
  1915  struct buffer_page *head_page, *orig_head;
  1916  unsigned long entry_bytes = 0;
  1917  unsigned long entries = 0;
  1918  int discarded = 0;
  1919  int ret;
  1920  u64 ts;
  1921  int i;
  1922  
  1923  if (!meta || !meta->head_buffer)
  1924  return;
  1925  
  1926  orig_head = head_page = cpu_buffer->head_page;
  1927  
  1928  /* Do the reader page first */
  1929  ret = rb_validate_buffer(cpu_buffer->reader_page, 
cpu_buffer->cpu, meta);
  1930  if (ret < 0) {
  1931  pr_info("Ring buffer meta [%d] invalid reader page 
detected\n",
  1932  cpu_buffer->cpu);
  1933  discarded++;
  1934  } else {
  1935  entries += ret;
  1936  entry_bytes += rb_page_size(cpu_buffer->reader_page);
  1937  }
  1938  
  1939  ts = head_page->page->time_stamp;
  1940  
  1941  /*
  1942   * Try to rewind the head so that we can read the pages which 
already
  1943   * read in the previous boot.
  1944   */
  1945  if (head_page == cpu_buffer->tail_page)
  1946  goto skip_rewind;
  1947  
  1948  rb_dec_page(&head_page);
  1949  for (i = 0; i < meta->nr_subbufs + 1; i++, 
rb_dec_page(&head_page)) {
  1950  
  1951  /* Rewind until tail (writer) page. */
  1952  if (head_page == cpu_buffer->tail_page)
  1953  break;
  1954  
  1955  /* Rewind until unused page (no timestamp, no commit). 
*/
  1956  if (!head_page->page->time_stamp && 
rb_page_commit(head_page) == 0)
  1957  break;
  1958  
  1959  /*
  1960   * Skip if the page is invalid, or its timestamp is 
newer than the
  1961   * previous valid page.
  1962   */
  1963  ret = rb_validate_buffer(head_page, cpu_buffer->cpu, 
meta);
  1964  if (ret >= 0 && ts < head_page->page->time_stamp) {
> 1965  local_set(&bpage->entries, 0);
  1966  local_set(&bpage->page->commit, 0);
  1967  head_page->page->time_stamp = ts;
  1968  ret = -1;
  1969  }
  1970  if (ret < 0) {
  1971  if (!discarded)
  1972  pr_info("Ring buffer 

Re: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when rewinding persistent ring buffer

2026-03-22 Thread kernel test robot
Hi Masami,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[also build test ERROR on geert-m68k/for-next geert-m68k/for-linus 
openrisc/for-next deller-parisc/for-next powerpc/next powerpc/fixes 
s390/features uml/next tip/x86/core linus/master uml/fixes v7.0-rc4 
next-20260320]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:
https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/ring-buffer-Fix-to-update-per-subbuf-entries-of-persistent-ring-buffer/20260322-122412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace 
for-next
patch link:
https://lore.kernel.org/r/177391156211.193994.7531495945584650297.stgit%40mhiramat.tok.corp.google.com
patch subject: [PATCH v11 4/5] ring-buffer: Skip invalid sub-buffers when 
rewinding persistent ring buffer
config: arc-defconfig 
(https://download.01.org/0day-ci/archive/20260322/[email protected]/config)
compiler: arc-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260322/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from ./arch/arc/include/generated/asm/local.h:1,
from include/linux/ring_buffer_types.h:5,
from kernel/trace/ring_buffer.c:7:
   kernel/trace/ring_buffer.c: In function 'rb_meta_validate_events':
>> kernel/trace/ring_buffer.c:1965:36: error: 'bpage' undeclared (first use in 
>> this function); did you mean 'page'?
1965 | local_set(&bpage->entries, 0);
 |^
   include/asm-generic/local.h:30:44: note: in definition of macro 'local_set'
  30 | #define local_set(l,i)  atomic_long_set((&(l)->a),(i))
 |^
   kernel/trace/ring_buffer.c:1965:36: note: each undeclared identifier is 
reported only once for each function it appears in
1965 | local_set(&bpage->entries, 0);
 |^
   include/asm-generic/local.h:30:44: note: in definition of macro 'local_set'
  30 | #define local_set(l,i)  atomic_long_set((&(l)->a),(i))
 |^


vim +1965 kernel/trace/ring_buffer.c

  1910  
  1911  /* If the meta data has been validated, now validate the events */
  1912  static void rb_meta_validate_events(struct ring_buffer_per_cpu 
*cpu_buffer)
  1913  {
  1914  struct ring_buffer_cpu_meta *meta = cpu_buffer->ring_meta;
  1915  struct buffer_page *head_page, *orig_head;
  1916  unsigned long entry_bytes = 0;
  1917  unsigned long entries = 0;
  1918  int discarded = 0;
  1919  int ret;
  1920  u64 ts;
  1921  int i;
  1922  
  1923  if (!meta || !meta->head_buffer)
  1924  return;
  1925  
  1926  orig_head = head_page = cpu_buffer->head_page;
  1927  
  1928  /* Do the reader page first */
  1929  ret = rb_validate_buffer(cpu_buffer->reader_page, 
cpu_buffer->cpu, meta);
  1930  if (ret < 0) {
  1931  pr_info("Ring buffer meta [%d] invalid reader page 
detected\n",
  1932  cpu_buffer->cpu);
  1933  discarded++;
  1934  } else {
  1935  entries += ret;
  1936  entry_bytes += rb_page_size(cpu_buffer->reader_page);
  1937  }
  1938  
  1939  ts = head_page->page->time_stamp;
  1940  
  1941  /*
  1942   * Try to rewind the head so that we can read the pages which 
already
  1943   * read in the previous boot.
  1944   */
  1945  if (head_page == cpu_buffer->tail_page)
  1946  goto skip_rewind;
  1947  
  1948  rb_dec_page(&head_page);
  1949  for (i = 0; i < meta->nr_subbufs + 1; i++, 
rb_dec_page(&head_page)) {
  1950  
  1951  /* Rewind until tail (writer) page. */
  1952  if (head_page == cpu_buffer->tail_page)
  1953  break;
  1954  
  1955  /* Rewind until unused page (no timestamp, no commit). 
*/
  1956  if (!head_page->page->time_stamp && 
rb_page_commit(head_page) == 0)
  1957  break;
  1958  
  1959  /*
  1960   * Skip if the page is invalid, or its timestamp is 
newer than the
  1961   * previous