From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 782D5C433F5 for ; Wed, 25 May 2022 00:55:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 951E38D0003; Tue, 24 May 2022 20:55:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9053A8D0001; Tue, 24 May 2022 20:55:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C7248D0003; Tue, 24 May 2022 20:55:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 696948D0001 for ; Tue, 24 May 2022 20:55:24 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3942B20986 for ; Wed, 25 May 2022 00:55:24 +0000 (UTC) X-FDA: 79502446968.11.6D1AE3F Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) by imf21.hostedemail.com (Postfix) with ESMTP id D9FCB1C002A for ; Wed, 25 May 2022 00:55:11 +0000 (UTC) Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-e93bbb54f9so24287530fac.12 for ; Tue, 24 May 2022 17:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=87TAdO7JVTyU4dJLZx4/twxaR3Jk7wL6ogRvawQDX/I=; b=JIv9rAjc5IAfYhvvJ4+4CyGclox8QGMjVLCV4cdp6JH0BX/N5umdP0MRbQAiEZW9iH Tepm36gZweXci0jyXQz/OHvziPK6hnlGztgxjOt/n/8mWMSFnW/LjcpcXudoYPCDJeKv N3lBWB1XkkmwNMm7/R4jUBR6jvftLDN2KLLFXaCdTgEQEoyAo8FdYCWODHViuca04dbk IUtXTEtK8+z0KmykxRAQrE1MMpzcNcGTeOGBHi/dhWq3Z6vZk+H0Qu67jQtyQUUJWz3C GhLvq0MPZFFlPmbbg0+zVgmeUyPgb50F9kht7pKLCOKFngI+956xeYdrtxxGIg1b5lnI yaBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=87TAdO7JVTyU4dJLZx4/twxaR3Jk7wL6ogRvawQDX/I=; b=4Hxh2ESri+I2tW2Txbl/o18kvAnjjHv/eyedDUoX1xW6vbJEdrqRIOatm7A15iLhLU TmIkKPJ+W7JEuPd1Kiy64C1AUkHJG93PNeH3VHAihscjRhccttMzTeDJkz3KpZM4J0RS 0AdP8WkZwe7N92P3Q65cIGZIapVIoZQrfd5sJxojjuCvMzeAA3xVG7jpFWEStriLGaSL lmt65tTbgsUlM5XSd0TWeHlHgm3OoDR27vJQxA9qnn+BpyLLlcWy5tF8Ls7oJD+kUkc3 Zs6dwqb3jD2aIrw+2PfMQNOQXK+uWzfgj44wJn1EwgR17zfDpM16gZ7qQ4l8T+3S7ZQH 4GTQ== X-Gm-Message-State: AOAM533rMQc44PwLhO6j7fjEfpN57fj1/QonCYr/Np01JexUkRSL743k /i8kkgPDaAIKGTW3mHwLkSh6n0SUzAuld0JwHVw7AQ== X-Google-Smtp-Source: ABdhPJwuIQfcxPE3CrjW3nGLNRxcyh8Nyr3XOH9nVNz3aP18UDS9v2PrgtCxeZabMgswSF/jtx1j7MFj7uvcmqz5eic= X-Received: by 2002:a05:6870:c683:b0:ed:efb9:ffe9 with SMTP id cv3-20020a056870c68300b000edefb9ffe9mr4067382oab.241.1653440122904; Tue, 24 May 2022 17:55:22 -0700 (PDT) MIME-Version: 1.0 References: <20220504182908.1322874-1-yuanchu@google.com> <20220504184537.130085-1-sj@kernel.org> In-Reply-To: <20220504184537.130085-1-sj@kernel.org> From: Yuanchu Xie Date: Tue, 24 May 2022 17:55:11 -0700 Message-ID: Subject: Re: [PATCH v3] selftests/damon: suppress compiler warnings for huge_count_read_write To: Shuah Khan Cc: SeongJae Park , Markus Boehme , David Rientjes , Andrew Morton , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D9FCB1C002A X-Stat-Signature: 8xm1bowfrrawp6rmzw99w1ezwc14mks3 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=JIv9rAjc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of yuanchu@google.com designates 209.85.160.43 as permitted sender) smtp.mailfrom=yuanchu@google.com X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1653440111-337820 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Shuah, On Wed, May 4, 2022 at 11:45 AM SeongJae Park wrote: > > Hi Yuanchu, > > On Wed, 4 May 2022 18:29:08 +0000 Yuanchu Xie 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 > > --- > > It would be a good practice to mention the changes from the previous vers= ion 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/to= ols/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 > > */ > > +#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 warn= ing > 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 =E2=80=98= #pragma GCC diagnostic=E2=80=99 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 th= at 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