* [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding [not found] <20240910162335.2993310-1-vdonnefort@google.com> @ 2024-09-10 16:23 ` Vincent Donnefort 2024-09-10 16:45 ` Steven Rostedt 2024-09-10 16:23 ` [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system Vincent Donnefort 1 sibling, 1 reply; 11+ messages in thread From: Vincent Donnefort @ 2024-09-10 16:23 UTC (permalink / raw) To: rostedt Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, Vincent Donnefort, Shuah Khan, linux-kselftest Improve the ring-buffer meta-page test coverage by checking for the entire padding region to be 0 instead of just looking at the first 4 bytes. Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: linux-kselftest@vger.kernel.org Signed-off-by: Vincent Donnefort <vdonnefort@google.com> diff --git a/tools/testing/selftests/ring-buffer/map_test.c b/tools/testing/selftests/ring-buffer/map_test.c index 4bb0192e43f3..ba12fd31de87 100644 --- a/tools/testing/selftests/ring-buffer/map_test.c +++ b/tools/testing/selftests/ring-buffer/map_test.c @@ -231,15 +231,15 @@ TEST_F(map, data_mmap) /* Verify meta-page padding */ if (desc->meta->meta_page_size > getpagesize()) { - void *addr; - data_len = desc->meta->meta_page_size; data = mmap(NULL, data_len, PROT_READ, MAP_SHARED, desc->cpu_fd, 0); ASSERT_NE(data, MAP_FAILED); - addr = (void *)((unsigned long)data + getpagesize()); - ASSERT_EQ(*((int *)addr), 0); + for (int i = desc->meta->meta_struct_len; + i < desc->meta->meta_page_size; i += sizeof(int)) + ASSERT_EQ(*(int *)(data + i), 0); + munmap(data, data_len); } } -- 2.46.0.598.g6f2099f65c-goog ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding 2024-09-10 16:23 ` [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding Vincent Donnefort @ 2024-09-10 16:45 ` Steven Rostedt 2024-09-10 18:49 ` Shuah Khan 0 siblings, 1 reply; 11+ messages in thread From: Steven Rostedt @ 2024-09-10 16:45 UTC (permalink / raw) To: Vincent Donnefort Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, Shuah Khan, linux-kselftest Shuah, Can you take this through your tree? Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> -- Steve On Tue, 10 Sep 2024 17:23:34 +0100 Vincent Donnefort <vdonnefort@google.com> wrote: > Improve the ring-buffer meta-page test coverage by checking for the > entire padding region to be 0 instead of just looking at the first 4 > bytes. > > Cc: Shuah Khan <skhan@linuxfoundation.org> > Cc: linux-kselftest@vger.kernel.org > Signed-off-by: Vincent Donnefort <vdonnefort@google.com> > > diff --git a/tools/testing/selftests/ring-buffer/map_test.c b/tools/testing/selftests/ring-buffer/map_test.c > index 4bb0192e43f3..ba12fd31de87 100644 > --- a/tools/testing/selftests/ring-buffer/map_test.c > +++ b/tools/testing/selftests/ring-buffer/map_test.c > @@ -231,15 +231,15 @@ TEST_F(map, data_mmap) > > /* Verify meta-page padding */ > if (desc->meta->meta_page_size > getpagesize()) { > - void *addr; > - > data_len = desc->meta->meta_page_size; > data = mmap(NULL, data_len, > PROT_READ, MAP_SHARED, desc->cpu_fd, 0); > ASSERT_NE(data, MAP_FAILED); > > - addr = (void *)((unsigned long)data + getpagesize()); > - ASSERT_EQ(*((int *)addr), 0); > + for (int i = desc->meta->meta_struct_len; > + i < desc->meta->meta_page_size; i += sizeof(int)) > + ASSERT_EQ(*(int *)(data + i), 0); > + > munmap(data, data_len); > } > } ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding 2024-09-10 16:45 ` Steven Rostedt @ 2024-09-10 18:49 ` Shuah Khan 2024-09-11 7:52 ` Vincent Donnefort 0 siblings, 1 reply; 11+ messages in thread From: Shuah Khan @ 2024-09-10 18:49 UTC (permalink / raw) To: Steven Rostedt, Vincent Donnefort Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest, Shuah Khan On 9/10/24 10:45, Steven Rostedt wrote: > > Shuah, > > Can you take this through your tree? > > Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> I can take this through my tree. > > -- Steve > > > On Tue, 10 Sep 2024 17:23:34 +0100 > Vincent Donnefort <vdonnefort@google.com> wrote: > >> Improve the ring-buffer meta-page test coverage by checking for the >> entire padding region to be 0 instead of just looking at the first 4 >> bytes. >> >> Cc: Shuah Khan <skhan@linuxfoundation.org> >> Cc: linux-kselftest@vger.kernel.org >> Signed-off-by: Vincent Donnefort <vdonnefort@google.com> Vincent, Can you please rebase these on linux-kselftest next branch and resend. This patch doesn't apply. Also please fix the subject to say: selfttests/ring-buffer ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding 2024-09-10 18:49 ` Shuah Khan @ 2024-09-11 7:52 ` Vincent Donnefort 2024-09-11 16:05 ` Shuah Khan 2024-09-11 16:20 ` Steven Rostedt 0 siblings, 2 replies; 11+ messages in thread From: Vincent Donnefort @ 2024-09-11 7:52 UTC (permalink / raw) To: Shuah Khan Cc: Steven Rostedt, mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest On Tue, Sep 10, 2024 at 12:49:58PM -0600, Shuah Khan wrote: > On 9/10/24 10:45, Steven Rostedt wrote: > > > > Shuah, > > > > Can you take this through your tree? > > > > Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> > > I can take this through my tree. > > > > > -- Steve > > > > > > On Tue, 10 Sep 2024 17:23:34 +0100 > > Vincent Donnefort <vdonnefort@google.com> wrote: > > > > > Improve the ring-buffer meta-page test coverage by checking for the > > > entire padding region to be 0 instead of just looking at the first 4 > > > bytes. > > > > > > Cc: Shuah Khan <skhan@linuxfoundation.org> > > > Cc: linux-kselftest@vger.kernel.org > > > Signed-off-by: Vincent Donnefort <vdonnefort@google.com> > > Vincent, > > Can you please rebase these on linux-kselftest next branch and > resend. This patch doesn't apply. > > Also please fix the subject to say: > > selfttests/ring-buffer Will do, but it depends linux-trace/ring-buffer/for-next which hasn't make it yet to linux-next. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding 2024-09-11 7:52 ` Vincent Donnefort @ 2024-09-11 16:05 ` Shuah Khan 2024-09-11 16:20 ` Steven Rostedt 1 sibling, 0 replies; 11+ messages in thread From: Shuah Khan @ 2024-09-11 16:05 UTC (permalink / raw) To: Vincent Donnefort Cc: Steven Rostedt, mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest, Shuah Khan On 9/11/24 01:52, Vincent Donnefort wrote: > On Tue, Sep 10, 2024 at 12:49:58PM -0600, Shuah Khan wrote: >> On 9/10/24 10:45, Steven Rostedt wrote: >>> >>> Shuah, >>> >>> Can you take this through your tree? >>> >>> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> >> >> I can take this through my tree. >> >>> >>> -- Steve >>> >>> >>> On Tue, 10 Sep 2024 17:23:34 +0100 >>> Vincent Donnefort <vdonnefort@google.com> wrote: >>> >>>> Improve the ring-buffer meta-page test coverage by checking for the >>>> entire padding region to be 0 instead of just looking at the first 4 >>>> bytes. >>>> >>>> Cc: Shuah Khan <skhan@linuxfoundation.org> >>>> Cc: linux-kselftest@vger.kernel.org >>>> Signed-off-by: Vincent Donnefort <vdonnefort@google.com> >> >> Vincent, >> >> Can you please rebase these on linux-kselftest next branch and >> resend. This patch doesn't apply. >> >> Also please fix the subject to say: >> >> selfttests/ring-buffer > > Will do, but it depends linux-trace/ring-buffer/for-next which hasn't make it > yet to linux-next. In which case it has to go through tracing tree. Steve, This is yours to take due to the dependency on linux-trace/ring-buffer/for-next Acked-by: Shuah Khan <skhan@linuxfoundation.org> thanks, -- Shuah ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding 2024-09-11 7:52 ` Vincent Donnefort 2024-09-11 16:05 ` Shuah Khan @ 2024-09-11 16:20 ` Steven Rostedt 1 sibling, 0 replies; 11+ messages in thread From: Steven Rostedt @ 2024-09-11 16:20 UTC (permalink / raw) To: Vincent Donnefort Cc: Shuah Khan, mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest On Wed, 11 Sep 2024 08:52:11 +0100 Vincent Donnefort <vdonnefort@google.com> wrote: > > selfttests/ring-buffer > > Will do, but it depends linux-trace/ring-buffer/for-next which hasn't make it > yet to linux-next. Ah, I missed that you updated the selftest in one of your other patches. That should have been a separate patch, as it works with the current upstream code (just tested it against 6.11-rc7). That's my fault for missing it in the review. And after applying these changes on top of it, 6.11-rc7 still works as well. But since it's in for-next, might as well keep it there as the merge window is about to open. -- Steve ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system [not found] <20240910162335.2993310-1-vdonnefort@google.com> 2024-09-10 16:23 ` [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding Vincent Donnefort @ 2024-09-10 16:23 ` Vincent Donnefort 2024-09-10 16:45 ` Steven Rostedt 1 sibling, 1 reply; 11+ messages in thread From: Vincent Donnefort @ 2024-09-10 16:23 UTC (permalink / raw) To: rostedt Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, Vincent Donnefort, Shuah Khan, linux-kselftest Handle the case where the meta-page content is bigger than the system page-size. This prepares the ground for extending features covered by the meta-page. Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: linux-kselftest@vger.kernel.org Signed-off-by: Vincent Donnefort <vdonnefort@google.com> diff --git a/tools/testing/selftests/ring-buffer/map_test.c b/tools/testing/selftests/ring-buffer/map_test.c index ba12fd31de87..d10a847130fb 100644 --- a/tools/testing/selftests/ring-buffer/map_test.c +++ b/tools/testing/selftests/ring-buffer/map_test.c @@ -92,12 +92,22 @@ int tracefs_cpu_map(struct tracefs_cpu_map_desc *desc, int cpu) if (desc->cpu_fd < 0) return -ENODEV; +again: map = mmap(NULL, page_size, PROT_READ, MAP_SHARED, desc->cpu_fd, 0); if (map == MAP_FAILED) return -errno; desc->meta = (struct trace_buffer_meta *)map; + /* the meta-page is bigger than the original mapping */ + if (page_size < desc->meta->meta_struct_len) { + int meta_page_size = desc->meta->meta_page_size; + + munmap(desc->meta, page_size); + page_size = meta_page_size; + goto again; + } + return 0; } -- 2.46.0.598.g6f2099f65c-goog ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system 2024-09-10 16:23 ` [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system Vincent Donnefort @ 2024-09-10 16:45 ` Steven Rostedt 2024-09-10 18:50 ` Shuah Khan 0 siblings, 1 reply; 11+ messages in thread From: Steven Rostedt @ 2024-09-10 16:45 UTC (permalink / raw) To: Vincent Donnefort Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, Shuah Khan, linux-kselftest Shuah, Can you take this through your tree? Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> -- Steve On Tue, 10 Sep 2024 17:23:35 +0100 Vincent Donnefort <vdonnefort@google.com> wrote: > Handle the case where the meta-page content is bigger than the system > page-size. This prepares the ground for extending features covered by > the meta-page. > > Cc: Shuah Khan <skhan@linuxfoundation.org> > Cc: linux-kselftest@vger.kernel.org > Signed-off-by: Vincent Donnefort <vdonnefort@google.com> > > diff --git a/tools/testing/selftests/ring-buffer/map_test.c b/tools/testing/selftests/ring-buffer/map_test.c > index ba12fd31de87..d10a847130fb 100644 > --- a/tools/testing/selftests/ring-buffer/map_test.c > +++ b/tools/testing/selftests/ring-buffer/map_test.c > @@ -92,12 +92,22 @@ int tracefs_cpu_map(struct tracefs_cpu_map_desc *desc, int cpu) > if (desc->cpu_fd < 0) > return -ENODEV; > > +again: > map = mmap(NULL, page_size, PROT_READ, MAP_SHARED, desc->cpu_fd, 0); > if (map == MAP_FAILED) > return -errno; > > desc->meta = (struct trace_buffer_meta *)map; > > + /* the meta-page is bigger than the original mapping */ > + if (page_size < desc->meta->meta_struct_len) { > + int meta_page_size = desc->meta->meta_page_size; > + > + munmap(desc->meta, page_size); > + page_size = meta_page_size; > + goto again; > + } > + > return 0; > } > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system 2024-09-10 16:45 ` Steven Rostedt @ 2024-09-10 18:50 ` Shuah Khan 2024-09-11 16:07 ` Shuah Khan 0 siblings, 1 reply; 11+ messages in thread From: Shuah Khan @ 2024-09-10 18:50 UTC (permalink / raw) To: Steven Rostedt, Vincent Donnefort Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest, Shuah Khan On 9/10/24 10:45, Steven Rostedt wrote: > > Shuah, > > Can you take this through your tree? > > Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Yes I can take it through my tree. > > -- Steve > > On Tue, 10 Sep 2024 17:23:35 +0100 > Vincent Donnefort <vdonnefort@google.com> wrote: > >> Handle the case where the meta-page content is bigger than the system >> page-size. This prepares the ground for extending features covered by >> the meta-page. >> >> Cc: Shuah Khan <skhan@linuxfoundation.org> >> Cc: linux-kselftest@vger.kernel.org >> Signed-off-by: Vincent Donnefort <vdonnefort@google.com> Vincent, Can you please rebase these on linux-kselftest next branch and resend. This patch doesn't apply. Also please fix the subject to say: selfttests/ring-buffer thanks, -- Shuah ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system 2024-09-10 18:50 ` Shuah Khan @ 2024-09-11 16:07 ` Shuah Khan 2024-09-11 16:21 ` Steven Rostedt 0 siblings, 1 reply; 11+ messages in thread From: Shuah Khan @ 2024-09-11 16:07 UTC (permalink / raw) To: Steven Rostedt, Vincent Donnefort Cc: mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest, Shuah Khan On 9/10/24 12:50, Shuah Khan wrote: > On 9/10/24 10:45, Steven Rostedt wrote: >> >> Shuah, >> >> Can you take this through your tree? >> >> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> > > Yes I can take it through my tree. > >> >> -- Steve >> >> On Tue, 10 Sep 2024 17:23:35 +0100 >> Vincent Donnefort <vdonnefort@google.com> wrote: >> >>> Handle the case where the meta-page content is bigger than the system >>> page-size. This prepares the ground for extending features covered by >>> the meta-page. >>> >>> Cc: Shuah Khan <skhan@linuxfoundation.org> >>> Cc: linux-kselftest@vger.kernel.org >>> Signed-off-by: Vincent Donnefort <vdonnefort@google.com> > > Vincent, > > Can you please rebase these on linux-kselftest next branch and > resend. This patch doesn't apply. > > Also please fix the subject to say: > > selfttests/ring-buffer Once this is fixed: Steve, This is yours to take due to the dependency on linux-trace/ring-buffer/for-next Acked-by: Shuah Khan <skhan@linuxfoundation.org> thanks, -- Shuah ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system 2024-09-11 16:07 ` Shuah Khan @ 2024-09-11 16:21 ` Steven Rostedt 0 siblings, 0 replies; 11+ messages in thread From: Steven Rostedt @ 2024-09-11 16:21 UTC (permalink / raw) To: Shuah Khan Cc: Vincent Donnefort, mhiramat, linux-kernel, linux-trace-kernel, kernel-team, linux-kselftest On Wed, 11 Sep 2024 10:07:40 -0600 Shuah Khan <skhan@linuxfoundation.org> wrote: > Once this is fixed: > > Steve, This is yours to take due to the dependency on linux-trace/ring-buffer/for-next > > Acked-by: Shuah Khan <skhan@linuxfoundation.org> Thanks, I'll add it to my for-next queue. -- Steve ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-09-11 16:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240910162335.2993310-1-vdonnefort@google.com>
2024-09-10 16:23 ` [PATCH RESEND 1/2] ring-buffer/selftest: Verify the entire meta-page padding Vincent Donnefort
2024-09-10 16:45 ` Steven Rostedt
2024-09-10 18:49 ` Shuah Khan
2024-09-11 7:52 ` Vincent Donnefort
2024-09-11 16:05 ` Shuah Khan
2024-09-11 16:20 ` Steven Rostedt
2024-09-10 16:23 ` [PATCH RESEND 2/2] ring-buffer/selftest: Handle meta-page bigger than the system Vincent Donnefort
2024-09-10 16:45 ` Steven Rostedt
2024-09-10 18:50 ` Shuah Khan
2024-09-11 16:07 ` Shuah Khan
2024-09-11 16:21 ` Steven Rostedt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox