linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yuanchu Xie <yuanchu@google.com>
To: Shuah Khan <shuah@kernel.org>
Cc: SeongJae Park <sj@kernel.org>, Markus Boehme <markubo@amazon.de>,
	David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write
Date: Tue, 24 May 2022 17:55:11 -0700	[thread overview]
Message-ID: <CAJj2-QGUsqx8uRTamv7Hbw_-FRJOtrEnX6=fGEseZDJEtcnOaw@mail.gmail.com> (raw)
In-Reply-To: <20220504184537.130085-1-sj@kernel.org>

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

      parent reply	other threads:[~2022-05-25  0:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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='CAJj2-QGUsqx8uRTamv7Hbw_-FRJOtrEnX6=fGEseZDJEtcnOaw@mail.gmail.com' \
    --to=yuanchu@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=markubo@amazon.de \
    --cc=rientjes@google.com \
    --cc=shuah@kernel.org \
    --cc=sj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).