* [PATCH RESEND] selftests/damon: add damon to selftests root Makefile @ 2022-04-18 20:20 Yuanchu Xie 2022-04-24 19:35 ` David Rientjes 0 siblings, 1 reply; 16+ messages in thread From: Yuanchu Xie @ 2022-04-18 20:20 UTC (permalink / raw) To: Shuah Khan, Markus Boehme, SeongJae Park Cc: rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Yuanchu Xie Currently the damon selftests are not built with the rest of the selftests. We add damon to the list of targets. Fixes: b348eb7abd09 ("mm/damon: add user space selftests") Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Yuanchu Xie <yuanchu@google.com> --- tools/testing/selftests/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index d08fe4cfe811..ffe453760a12 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -9,6 +9,7 @@ TARGETS += clone3 TARGETS += core TARGETS += cpufreq TARGETS += cpu-hotplug +TARGETS += damon TARGETS += drivers/dma-buf TARGETS += efivarfs TARGETS += exec -- 2.35.1.265.g69c8d7142f-goog ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH RESEND] selftests/damon: add damon to selftests root Makefile 2022-04-18 20:20 [PATCH RESEND] selftests/damon: add damon to selftests root Makefile Yuanchu Xie @ 2022-04-24 19:35 ` David Rientjes 2022-04-25 19:37 ` Shuah Khan 0 siblings, 1 reply; 16+ messages in thread From: David Rientjes @ 2022-04-24 19:35 UTC (permalink / raw) To: Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, Andrew Morton, linux-mm, linux-kselftest, linux-kernel On Mon, 18 Apr 2022, Yuanchu Xie wrote: > Currently the damon selftests are not built with the rest of the > selftests. We add damon to the list of targets. > > Fixes: b348eb7abd09 ("mm/damon: add user space selftests") > Reviewed-by: SeongJae Park <sj@kernel.org> > Signed-off-by: Yuanchu Xie <yuanchu@google.com> Acked-by: David Rientjes <rientjes@google.com> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RESEND] selftests/damon: add damon to selftests root Makefile 2022-04-24 19:35 ` David Rientjes @ 2022-04-25 19:37 ` Shuah Khan 2022-04-25 20:03 ` Shuah Khan 0 siblings, 1 reply; 16+ messages in thread From: Shuah Khan @ 2022-04-25 19:37 UTC (permalink / raw) To: David Rientjes, Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Shuah Khan On 4/24/22 1:35 PM, David Rientjes wrote: > On Mon, 18 Apr 2022, Yuanchu Xie wrote: > >> Currently the damon selftests are not built with the rest of the >> selftests. We add damon to the list of targets. >> >> Fixes: b348eb7abd09 ("mm/damon: add user space selftests") >> Reviewed-by: SeongJae Park <sj@kernel.org> >> Signed-off-by: Yuanchu Xie <yuanchu@google.com> > > Acked-by: David Rientjes <rientjes@google.com> > Thank you. Applied to linux-kselftest next for 5.19-rc1. thanks, -- Shuah ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RESEND] selftests/damon: add damon to selftests root Makefile 2022-04-25 19:37 ` Shuah Khan @ 2022-04-25 20:03 ` Shuah Khan 2022-05-04 0:03 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write Yuanchu Xie 0 siblings, 1 reply; 16+ messages in thread From: Shuah Khan @ 2022-04-25 20:03 UTC (permalink / raw) To: Yuanchu Xie, SeongJae Park Cc: Shuah Khan, Markus Boehme, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Shuah Khan, David Rientjes On 4/25/22 1:37 PM, Shuah Khan wrote: > On 4/24/22 1:35 PM, David Rientjes wrote: >> On Mon, 18 Apr 2022, Yuanchu Xie wrote: >> >>> Currently the damon selftests are not built with the rest of the >>> selftests. We add damon to the list of targets. >>> >>> Fixes: b348eb7abd09 ("mm/damon: add user space selftests") >>> Reviewed-by: SeongJae Park <sj@kernel.org> >>> Signed-off-by: Yuanchu Xie <yuanchu@google.com> >> >> Acked-by: David Rientjes <rientjes@google.com> >> > > Thank you. Applied to linux-kselftest next for 5.19-rc1. > The test builds with warnings. Would you like to fix these as well? make gcc huge_count_read_write.c -o linux_5.18/tools/testing/selftests/damon/huge_count_read_write huge_count_read_write.c: In function ‘write_read_with_huge_count’: huge_count_read_write.c:23:9: warning: ‘write’ reading 4294967295 bytes from a region of size 1 [-Wstringop-overread] 23 | write(filedesc, "", 0xfffffffful); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from huge_count_read_write.c:8: /usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’ 378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur | ^~~~~ huge_count_read_write.c:25:15: warning: ‘read’ writing 4294967295 bytes into a region of size 25 overflows the destination [-Wstringop-overflow=] 25 | ret = read(filedesc, buf, 0xfffffffful); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ huge_count_read_write.c:14:14: note: destination object ‘buf’ of size 25 14 | char buf[25]; | ^~~ In file included from huge_count_read_write.c:8: /usr/include/unistd.h:371:16: note: in a call to function ‘read’ declared with attribute ‘access (write_only, 2, 3)’ 371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur | ^~~~ thanks, -- Shuah ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-04-25 20:03 ` Shuah Khan @ 2022-05-04 0:03 ` Yuanchu Xie 2022-05-04 0:03 ` [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile Yuanchu Xie 2022-05-04 0:11 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write SeongJae Park 0 siblings, 2 replies; 16+ messages in thread From: Yuanchu Xie @ 2022-05-04 0:03 UTC (permalink / raw) To: Shuah Khan, Markus Boehme, SeongJae Park Cc: rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Yuanchu Xie The test case added in commit db7a347b26fe ("mm/damon/dbgfs: use '__GFP_NOWARN' for user-specified size buffer allocation") intentionally writes and reads with a large count to cause allocation failure and check for kernel warnings. We suppress the compiler warnings for these calls as they work as intended. Signed-off-by: Yuanchu Xie <yuanchu@google.com> --- tools/testing/selftests/damon/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile index 0470c5f3e690..a300b4c5b373 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -1,6 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for damon selftests +CFLAGS += -Wno-stringop-overread +CFLAGS += -Wno-stringop-overflow + TEST_GEN_FILES += huge_count_read_write TEST_FILES = _chk_dependency.sh _debugfs_common.sh -- 2.36.0.464.gb9c8b46e94-goog ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile 2022-05-04 0:03 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write Yuanchu Xie @ 2022-05-04 0:03 ` Yuanchu Xie 2022-05-04 0:16 ` SeongJae Park 2022-05-04 4:50 ` David Rientjes 2022-05-04 0:11 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write SeongJae Park 1 sibling, 2 replies; 16+ messages in thread From: Yuanchu Xie @ 2022-05-04 0:03 UTC (permalink / raw) To: Shuah Khan, Markus Boehme, SeongJae Park Cc: rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Yuanchu Xie Currently the damon selftests are not built with the rest of the selftests. We add damon to the list of targets. Fixes: b348eb7abd09 ("mm/damon: add user space selftests") Signed-off-by: Yuanchu Xie <yuanchu@google.com> --- tools/testing/selftests/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 2319ec87f53d..bd2ac8b3bf1f 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -9,6 +9,7 @@ TARGETS += clone3 TARGETS += core TARGETS += cpufreq TARGETS += cpu-hotplug +TARGETS += damon TARGETS += drivers/dma-buf TARGETS += efivarfs TARGETS += exec -- 2.36.0.464.gb9c8b46e94-goog ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile 2022-05-04 0:03 ` [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile Yuanchu Xie @ 2022-05-04 0:16 ` SeongJae Park 2022-05-04 4:50 ` David Rientjes 1 sibling, 0 replies; 16+ messages in thread From: SeongJae Park @ 2022-05-04 0:16 UTC (permalink / raw) To: Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel On Wed, 4 May 2022 00:03:58 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > Currently the damon selftests are not built with the rest of the > selftests. We add damon to the list of targets. > > Fixes: b348eb7abd09 ("mm/damon: add user space selftests") > Signed-off-by: Yuanchu Xie <yuanchu@google.com> Reviewed-by: SeongJae Park <sj@kernel.org> Thanks, SJ > --- > tools/testing/selftests/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile > index 2319ec87f53d..bd2ac8b3bf1f 100644 > --- a/tools/testing/selftests/Makefile > +++ b/tools/testing/selftests/Makefile > @@ -9,6 +9,7 @@ TARGETS += clone3 > TARGETS += core > TARGETS += cpufreq > TARGETS += cpu-hotplug > +TARGETS += damon > TARGETS += drivers/dma-buf > TARGETS += efivarfs > TARGETS += exec > -- > 2.36.0.464.gb9c8b46e94-goog ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile 2022-05-04 0:03 ` [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile Yuanchu Xie 2022-05-04 0:16 ` SeongJae Park @ 2022-05-04 4:50 ` David Rientjes 1 sibling, 0 replies; 16+ messages in thread From: David Rientjes @ 2022-05-04 4:50 UTC (permalink / raw) To: Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, Andrew Morton, linux-mm, linux-kselftest, linux-kernel On Wed, 4 May 2022, Yuanchu Xie wrote: > Currently the damon selftests are not built with the rest of the > selftests. We add damon to the list of targets. > > Fixes: b348eb7abd09 ("mm/damon: add user space selftests") > Signed-off-by: Yuanchu Xie <yuanchu@google.com> Acked-by: David Rientjes <rientjes@google.com> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 0:03 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write Yuanchu Xie 2022-05-04 0:03 ` [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile Yuanchu Xie @ 2022-05-04 0:11 ` SeongJae Park 2022-05-04 18:29 ` [PATCH v3] " Yuanchu Xie 1 sibling, 1 reply; 16+ messages in thread From: SeongJae Park @ 2022-05-04 0:11 UTC (permalink / raw) To: Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi Yuanchu, thank you for this patch! On Wed, 4 May 2022 00:03:57 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > use '__GFP_NOWARN' for user-specified size buffer allocation") > intentionally writes and reads with a large count to cause > allocation failure and check for kernel warnings. We suppress > the compiler warnings for these calls as they work as intended. > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> Reviewed-by: SeongJae Park <sj@kernel.org> Thanks, SJ [...] > --- > tools/testing/selftests/damon/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile > index 0470c5f3e690..a300b4c5b373 100644 > --- a/tools/testing/selftests/damon/Makefile > +++ b/tools/testing/selftests/damon/Makefile > @@ -1,6 +1,9 @@ > # SPDX-License-Identifier: GPL-2.0 > # Makefile for damon selftests > > +CFLAGS += -Wno-stringop-overread > +CFLAGS += -Wno-stringop-overflow > + > TEST_GEN_FILES += huge_count_read_write > > TEST_FILES = _chk_dependency.sh _debugfs_common.sh > -- > 2.36.0.464.gb9c8b46e94-goog > ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 0:11 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write SeongJae Park @ 2022-05-04 18:29 ` Yuanchu Xie 2022-05-04 18:32 ` Yuanchu Xie 2022-05-04 18:45 ` SeongJae Park 0 siblings, 2 replies; 16+ messages in thread From: Yuanchu Xie @ 2022-05-04 18:29 UTC (permalink / raw) To: Shuah Khan, Markus Boehme, SeongJae Park Cc: rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel, Yuanchu Xie The test case added in commit db7a347b26fe ("mm/damon/dbgfs: use '__GFP_NOWARN' for user-specified size buffer allocation") intentionally writes and reads with a large count to cause allocation failure and check for kernel warnings. We suppress the compiler warnings for these calls as they work as intended. Signed-off-by: Yuanchu Xie <yuanchu@google.com> --- tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c index ad7a6b4cf338..91bd80c75cd9 100644 --- a/tools/testing/selftests/damon/huge_count_read_write.c +++ b/tools/testing/selftests/damon/huge_count_read_write.c @@ -2,6 +2,8 @@ /* * Author: SeongJae Park <sj@kernel.org> */ +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Wstringop-overread" #include <fcntl.h> #include <stdlib.h> -- 2.36.0.464.gb9c8b46e94-goog ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 18:29 ` [PATCH v3] " Yuanchu Xie @ 2022-05-04 18:32 ` Yuanchu Xie 2022-05-04 18:45 ` SeongJae Park 1 sibling, 0 replies; 16+ messages in thread From: Yuanchu Xie @ 2022-05-04 18:32 UTC (permalink / raw) To: Shuah Khan, Markus Boehme, SeongJae Park Cc: David Rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi SeongJae, Instead of adding the exception to the Makefile, these two pragmas can be added to the offending c file instead. Although it is fairly minor and either one works but I think this is cleaner. Thanks, Yuanchu ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 18:29 ` [PATCH v3] " Yuanchu Xie 2022-05-04 18:32 ` Yuanchu Xie @ 2022-05-04 18:45 ` SeongJae Park 2022-05-04 22:12 ` Yuanchu Xie 2022-05-25 0:55 ` Yuanchu Xie 1 sibling, 2 replies; 16+ messages in thread From: SeongJae Park @ 2022-05-04 18:45 UTC (permalink / raw) To: Yuanchu Xie Cc: Shuah Khan, Markus Boehme, SeongJae Park, rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi Yuanchu, On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > use '__GFP_NOWARN' for user-specified size buffer allocation") > intentionally writes and reads with a large count to cause > allocation failure and check for kernel warnings. We suppress > the compiler warnings for these calls as they work as intended. > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> > --- It would be a good practice to mention the changes from the previous version of this patch here[1]. [1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format > tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c > index ad7a6b4cf338..91bd80c75cd9 100644 > --- a/tools/testing/selftests/damon/huge_count_read_write.c > +++ b/tools/testing/selftests/damon/huge_count_read_write.c > @@ -2,6 +2,8 @@ > /* > * Author: SeongJae Park <sj@kernel.org> > */ > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > +#pragma GCC diagnostic ignored "-Wstringop-overread" I agree that this must be the cleaner way than v2. But, I get below warning after applying this: $ sudo make -C tools/testing/selftests/damon run_tests make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] 6 | #pragma GCC diagnostic ignored "-Wstringop-overread" | ^~~~~~~~~~~~~~~~~~~~~ My gcc version is: $ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Thanks, SJ > > #include <fcntl.h> > #include <stdlib.h> > -- > 2.36.0.464.gb9c8b46e94-goog > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 18:45 ` SeongJae Park @ 2022-05-04 22:12 ` Yuanchu Xie 2022-05-17 1:07 ` Yuanchu Xie 2022-05-25 0:55 ` Yuanchu Xie 1 sibling, 1 reply; 16+ messages in thread From: Yuanchu Xie @ 2022-05-04 22:12 UTC (permalink / raw) To: SeongJae Park Cc: Shuah Khan, Markus Boehme, David Rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi SeongJae, On Wed, May 4, 2022 at 11:45 AM SeongJae Park <sj@kernel.org> wrote: > > Hi Yuanchu, > > On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > > > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > > use '__GFP_NOWARN' for user-specified size buffer allocation") > > intentionally writes and reads with a large count to cause > > allocation failure and check for kernel warnings. We suppress > > the compiler warnings for these calls as they work as intended. > > > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> > > --- > > It would be a good practice to mention the changes from the previous version of > this patch here[1]. > > [1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format > Thank you, I missed this when trying to figure out how to add additional comments for a revision. > > tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c > > index ad7a6b4cf338..91bd80c75cd9 100644 > > --- a/tools/testing/selftests/damon/huge_count_read_write.c > > +++ b/tools/testing/selftests/damon/huge_count_read_write.c > > @@ -2,6 +2,8 @@ > > /* > > * Author: SeongJae Park <sj@kernel.org> > > */ > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > > +#pragma GCC diagnostic ignored "-Wstringop-overread" > > I agree that this must be the cleaner way than v2. But, I get below warning > after applying this: > > $ sudo make -C tools/testing/selftests/damon run_tests > make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' > gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write > huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] > 6 | #pragma GCC diagnostic ignored "-Wstringop-overread" > | ^~~~~~~~~~~~~~~~~~~~~ > > My gcc version is: > > $ gcc --version > gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 I see, I'm running $ gcc --version gcc (Debian 11.2.0-16+build1) 11.2.0 I believe this is a new warning for gcc-11 [1], and somewhat unfortunate that it results in a warning for gcc-9.4. I'm not sure what the preference is here. [1] https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc/Warning-Options.html Thanks, Yuanchu ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 22:12 ` Yuanchu Xie @ 2022-05-17 1:07 ` Yuanchu Xie 2022-05-17 16:04 ` SeongJae Park 0 siblings, 1 reply; 16+ messages in thread From: Yuanchu Xie @ 2022-05-17 1:07 UTC (permalink / raw) To: SeongJae Park Cc: Shuah Khan, Markus Boehme, David Rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel SeongJae, Do you have a preference on how this should be handled? Thanks, Yuanchu On Wed, May 4, 2022 at 6:12 PM Yuanchu Xie <yuanchu@google.com> wrote: > > Hi SeongJae, > > On Wed, May 4, 2022 at 11:45 AM SeongJae Park <sj@kernel.org> wrote: > > > > Hi Yuanchu, > > > > On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > > > > > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > > > use '__GFP_NOWARN' for user-specified size buffer allocation") > > > intentionally writes and reads with a large count to cause > > > allocation failure and check for kernel warnings. We suppress > > > the compiler warnings for these calls as they work as intended. > > > > > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> > > > --- > > > > It would be a good practice to mention the changes from the previous version of > > this patch here[1]. > > > > [1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format > > > Thank you, I missed this when trying to figure out how to add > additional comments for a revision. > > > > tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c > > > index ad7a6b4cf338..91bd80c75cd9 100644 > > > --- a/tools/testing/selftests/damon/huge_count_read_write.c > > > +++ b/tools/testing/selftests/damon/huge_count_read_write.c > > > @@ -2,6 +2,8 @@ > > > /* > > > * Author: SeongJae Park <sj@kernel.org> > > > */ > > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > > > +#pragma GCC diagnostic ignored "-Wstringop-overread" > > > > I agree that this must be the cleaner way than v2. But, I get below warning > > after applying this: > > > > $ sudo make -C tools/testing/selftests/damon run_tests > > make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' > > gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write > > huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] > > 6 | #pragma GCC diagnostic ignored "-Wstringop-overread" > > | ^~~~~~~~~~~~~~~~~~~~~ > > > > My gcc version is: > > > > $ gcc --version > > gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 > I see, I'm running > > $ gcc --version > gcc (Debian 11.2.0-16+build1) 11.2.0 > > I believe this is a new warning for gcc-11 [1], and somewhat > unfortunate that it results in a warning for gcc-9.4. I'm not sure > what the preference is here. > [1] https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc/Warning-Options.html > > Thanks, > Yuanchu ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-17 1:07 ` Yuanchu Xie @ 2022-05-17 16:04 ` SeongJae Park 0 siblings, 0 replies; 16+ messages in thread From: SeongJae Park @ 2022-05-17 16:04 UTC (permalink / raw) To: Yuanchu Xie Cc: SeongJae Park, Shuah Khan, Markus Boehme, David Rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi Yuanchu, On Mon, 16 May 2022 21:07:25 -0400 Yuanchu Xie <yuanchu@google.com> wrote: > SeongJae, > > Do you have a preference on how this should be handled? Sorry for late response. I was thinking you were asking Shuah's opinion. I have no strong opinion but the approach you made in v2 looks slightly better for me. Thanks, SJ > > Thanks, > Yuanchu > > On Wed, May 4, 2022 at 6:12 PM Yuanchu Xie <yuanchu@google.com> wrote: > > > > Hi SeongJae, > > > > On Wed, May 4, 2022 at 11:45 AM SeongJae Park <sj@kernel.org> wrote: > > > > > > Hi Yuanchu, > > > > > > On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > > > > > > > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > > > > use '__GFP_NOWARN' for user-specified size buffer allocation") > > > > intentionally writes and reads with a large count to cause > > > > allocation failure and check for kernel warnings. We suppress > > > > the compiler warnings for these calls as they work as intended. > > > > > > > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> > > > > --- > > > > > > It would be a good practice to mention the changes from the previous version of > > > this patch here[1]. > > > > > > [1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format > > > > > Thank you, I missed this when trying to figure out how to add > > additional comments for a revision. > > > > > > tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c > > > > index ad7a6b4cf338..91bd80c75cd9 100644 > > > > --- a/tools/testing/selftests/damon/huge_count_read_write.c > > > > +++ b/tools/testing/selftests/damon/huge_count_read_write.c > > > > @@ -2,6 +2,8 @@ > > > > /* > > > > * Author: SeongJae Park <sj@kernel.org> > > > > */ > > > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > > > > +#pragma GCC diagnostic ignored "-Wstringop-overread" > > > > > > I agree that this must be the cleaner way than v2. But, I get below warning > > > after applying this: > > > > > > $ sudo make -C tools/testing/selftests/damon run_tests > > > make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' > > > gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write > > > huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] > > > 6 | #pragma GCC diagnostic ignored "-Wstringop-overread" > > > | ^~~~~~~~~~~~~~~~~~~~~ > > > > > > My gcc version is: > > > > > > $ gcc --version > > > gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 > > I see, I'm running > > > > $ gcc --version > > gcc (Debian 11.2.0-16+build1) 11.2.0 > > > > I believe this is a new warning for gcc-11 [1], and somewhat > > unfortunate that it results in a warning for gcc-9.4. I'm not sure > > what the preference is here. > > [1] https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc/Warning-Options.html > > > > Thanks, > > Yuanchu > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write 2022-05-04 18:45 ` SeongJae Park 2022-05-04 22:12 ` Yuanchu Xie @ 2022-05-25 0:55 ` Yuanchu Xie 1 sibling, 0 replies; 16+ messages in thread From: Yuanchu Xie @ 2022-05-25 0:55 UTC (permalink / raw) To: Shuah Khan Cc: SeongJae Park, Markus Boehme, David Rientjes, Andrew Morton, linux-mm, linux-kselftest, linux-kernel Hi Shuah, On Wed, May 4, 2022 at 11:45 AM SeongJae Park <sj@kernel.org> wrote: > > Hi Yuanchu, > > On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie <yuanchu@google.com> wrote: > > > The test case added in commit db7a347b26fe ("mm/damon/dbgfs: > > use '__GFP_NOWARN' for user-specified size buffer allocation") > > intentionally writes and reads with a large count to cause > > allocation failure and check for kernel warnings. We suppress > > the compiler warnings for these calls as they work as intended. > > > > Signed-off-by: Yuanchu Xie <yuanchu@google.com> > > --- > > It would be a good practice to mention the changes from the previous version of > this patch here[1]. > > [1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format > > > tools/testing/selftests/damon/huge_count_read_write.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c > > index ad7a6b4cf338..91bd80c75cd9 100644 > > --- a/tools/testing/selftests/damon/huge_count_read_write.c > > +++ b/tools/testing/selftests/damon/huge_count_read_write.c > > @@ -2,6 +2,8 @@ > > /* > > * Author: SeongJae Park <sj@kernel.org> > > */ > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > > +#pragma GCC diagnostic ignored "-Wstringop-overread" > > I agree that this must be the cleaner way than v2. But, I get below warning > after applying this: > > $ sudo make -C tools/testing/selftests/damon run_tests > make: Entering directory '/home/sjpark/linux/tools/testing/selftests/damon' > gcc huge_count_read_write.c -o /home/sjpark/linux/tools/testing/selftests/damon/huge_count_read_write > huge_count_read_write.c:6:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] > 6 | #pragma GCC diagnostic ignored "-Wstringop-overread" > | ^~~~~~~~~~~~~~~~~~~~~ > > My gcc version is: > > $ gcc --version > gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 $ gcc --version gcc (Debian 11.2.0-16+build1) 11.2.0 I believe this is a new warning for gcc-11 [1], and somewhat unfortunate that it results in a warning for gcc-9.4. So a patch that would resolve the test warnings for gcc 11 would introduce a new warning for gcc 9, and vice versa. What's the preferred solution here? [1] https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc/Warning-Options.html Thanks, Yuanchu ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2022-05-25 0:55 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-04-18 20:20 [PATCH RESEND] selftests/damon: add damon to selftests root Makefile Yuanchu Xie 2022-04-24 19:35 ` David Rientjes 2022-04-25 19:37 ` Shuah Khan 2022-04-25 20:03 ` Shuah Khan 2022-05-04 0:03 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write Yuanchu Xie 2022-05-04 0:03 ` [PATCH v2 2/2] selftests/damon: add damon to selftests root Makefile Yuanchu Xie 2022-05-04 0:16 ` SeongJae Park 2022-05-04 4:50 ` David Rientjes 2022-05-04 0:11 ` [PATCH v2 1/2] selftests/damon: suppress compiler warnings for huge_count_read_write SeongJae Park 2022-05-04 18:29 ` [PATCH v3] " Yuanchu Xie 2022-05-04 18:32 ` Yuanchu Xie 2022-05-04 18:45 ` SeongJae Park 2022-05-04 22:12 ` Yuanchu Xie 2022-05-17 1:07 ` Yuanchu Xie 2022-05-17 16:04 ` SeongJae Park 2022-05-25 0:55 ` Yuanchu Xie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).