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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7588C48BE5 for ; Fri, 11 Jun 2021 23:49:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4803D613B8 for ; Fri, 11 Jun 2021 23:49:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4803D613B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8FF2C6B006C; Fri, 11 Jun 2021 19:49:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AED66B006E; Fri, 11 Jun 2021 19:49:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 750376B0070; Fri, 11 Jun 2021 19:49:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 45F446B006C for ; Fri, 11 Jun 2021 19:49:15 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D89228249980 for ; Fri, 11 Jun 2021 23:49:14 +0000 (UTC) X-FDA: 78243086628.15.DA1D7D0 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf06.hostedemail.com (Postfix) with ESMTP id 99630C0042C0 for ; Fri, 11 Jun 2021 23:49:08 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id b12so3598209plg.11 for ; Fri, 11 Jun 2021 16:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h81oZvCoC7ygLDokppXdV5CdtgpMmz0M8WdT6M3ItGw=; b=f71FUvykrCPjPu7qRKn71Wx4486HsROGXnsHY14QBG7Ggl5NSlU14LKWL1F2e4ZEzz 5MCG44HJHy2rHI875W+11ONqiKvVR0yQpEIo87qpz516+sU4+WtlQzsn2InrLHuwH3ZX Ai3F6tRPq/aQoQ7Uo5iHhiflvh2nHdvoNAjEJelXDAknCf/brW5K1OcyznCZjzGVf1NL +xmmcdvGgwd3uUqJ4S2Ed5U9T3NA2ILWeMJd4h7Uy1BQ6LDrY6ufp9g5aXr0rc+/EWaR Z2tlwcwVLZbN9ZlWJlAhCXCqa0o+Pq6IORLp3aLkxw9Xe4JySPxqwccV4qVlcI7bVK1N fzVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h81oZvCoC7ygLDokppXdV5CdtgpMmz0M8WdT6M3ItGw=; b=MBnmVjDC4ajaw0cRombuvSf/OFytwNy/g7jWosEsWTe8wIU+AWb3V98uXNsNI/61Rg Yqjr8zz18fXDYplT3Jx1LGWZAZh3q5fTELTTAHZsa6NDM1BS7tya9TKWPDiNQ9WE1HrM IeqVA0LIn6WRb2pefGSurPb2ay/7DzL6Pa7zHFxYrZ2g1VhTx9neE4Xm/sapRXY03YI+ 27k8G/A1+DVOZfqfZxH0u4+51M0YuVPMru8xrPZpMwz7Dy6AGZXY4EyypBn0+qDnJA/r jGrAMivOW0s+ucxYrANFQ8sXvIG7eSeCkPCsmIcX5vBSC8TqOn6+6Qu3HEdDqpM4t8Pp eepw== X-Gm-Message-State: AOAM531IGWoS8UUO9+zaYD6h/uGiNLLBmcvyvqfo3x0h24TQEbfoDzCz NRxx08IO2LT7q4JgF3v3+BI/sh5dXsLXpTvQIao= X-Google-Smtp-Source: ABdhPJzGYTSLLnRSXzpm74v6TC4fLDIf+0mKdRHVh6mnoUs2Rsvm8ef0QGAK3OpEciA23Se6coCMkCqT13b4M18Ms/o= X-Received: by 2002:a17:90a:fe12:: with SMTP id ck18mr6694218pjb.27.1623455353601; Fri, 11 Jun 2021 16:49:13 -0700 (PDT) MIME-Version: 1.0 References: <202106120037.H1rz3bjq-lkp@intel.com> <20210611161034.fde4e1bcffb92eaec061014b@linux-foundation.org> In-Reply-To: <20210611161034.fde4e1bcffb92eaec061014b@linux-foundation.org> From: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sat, 12 Jun 2021 08:49:02 +0900 Message-ID: Subject: Re: [linux-next:master 7435/9209] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_236' declared with attribute error: unexpected size in kmalloc_index() To: Andrew Morton Cc: kernel test robot , kbuild-all@lists.01.org, Linux Memory Management List , Vlastimil Babka Content-Type: multipart/alternative; boundary="000000000000a8ffd805c4862711" Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=f71FUvyk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of 42hyeyoo@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=42hyeyoo@gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: qpnb87e19pehgrsswuzwaa9oxmwesrf9 X-Rspamd-Queue-Id: 99630C0042C0 X-HE-Tag: 1623455348-937476 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: --000000000000a8ffd805c4862711 Content-Type: text/plain; charset="UTF-8" On Sat, Jun 12, 2021, 8:10 AM Andrew Morton wrote: > On Sat, 12 Jun 2021 00:08:43 +0800 kernel test robot > wrote: > > > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: 25fe90f43fa312213b653dc1f12fd2d80f855883 > > commit: df2de13a32afec989c0e735beb3bc391b3de1dbd [7435/9209] mm, slub: > change run-time assertion in kmalloc_index() to compile-time > > config: sparc-randconfig-r005-20210611 (attached as .config) > > compiler: sparc64-linux-gcc (GCC) 9.3.0 > > reproduce (this is a W=1 build): > > wget > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross > -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=df2de13a32afec989c0e735beb3bc391b3de1dbd > > git remote add linux-next > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > git fetch --no-tags linux-next master > > git checkout df2de13a32afec989c0e735beb3bc391b3de1dbd > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross > ARCH=sparc > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All errors (new ones prefixed by >>): > > > > In file included from : > > In function 'kmalloc_index', > > inlined from 'kmalloc_node' at include/linux/slab.h:572:20, > > inlined from 'bpf_map_kmalloc_node.isra.0.part.0' at > include/linux/bpf.h:1319:9: > > >> include/linux/compiler_types.h:328:38: error: call to > '__compiletime_assert_236' declared with attribute error: unexpected size > in kmalloc_index() > > 328 | _compiletime_assert(condition, msg, __compiletime_assert_, > __COUNTER__) > > | ^ > > include/linux/compiler_types.h:309:4: note: in definition of macro > '__compiletime_assert' > > 309 | prefix ## suffix(); \ > > | ^~~~~~ > > include/linux/compiler_types.h:328:2: note: in expansion of macro > '_compiletime_assert' > > 328 | _compiletime_assert(condition, msg, __compiletime_assert_, > __COUNTER__) > > | ^~~~~~~~~~~~~~~~~~~ > > include/linux/build_bug.h:39:37: note: in expansion of macro > 'compiletime_assert' > > 39 | #define BUILD_BUG_ON_MSG(cond, msg) > compiletime_assert(!(cond), msg) > > | ^~~~~~~~~~~~~~~~~~ > > include/linux/slab.h:389:2: note: in expansion of macro > 'BUILD_BUG_ON_MSG' > > 389 | BUILD_BUG_ON_MSG(1, "unexpected size in kmalloc_index()"); > > | ^~~~~~~~~~~~~~~~ > > > > This log doesn't show which .c file was being compiled at the time. > Can this info be included? > > For me, it was kernel/bpf/local_storage.c. > Yes. the file It is kernel/bpf/local_storage.c > > I don't see anything wrong with the code. Did this gcc simply screw up > __builtin_constant_p()? It seems there is false positive when CONFIG_PROFILE_ALL_BRANCHES=y See this: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/45UNTPJX7VUKLB6TUYPJOS7DMREVW5US/ --000000000000a8ffd805c4862711 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Jun 12, 2021, 8:10 AM Andrew Morton <akpm@linux-foundation.org> wrote:
=
On Sat, 12 Jun 2021 00:08:43 +0800 ker= nel test robot <lkp@intel.com> wrote:

> tree:=C2=A0 =C2=A0https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git ma= ster
> head:=C2=A0 =C2=A025fe90f43fa312213b653dc1f12fd2d80f855883
> commit: df2de13a32afec989c0e735beb3bc391b3de1dbd [7435/9209] mm, slub:= change run-time assertion in kmalloc_index() to compile-time
> config: sparc-randconfig-r005-20210611 (attached as .config)
> compiler: sparc64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=3D1 build):
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wget https://raw.githubusercontent.com/intel/lkp-tests= /master/sbin/make.cross -O ~/bin/make.cross
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0chmod +x ~/bin/make.cross
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# htt= ps://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id= =3Ddf2de13a32afec989c0e735beb3bc391b3de1dbd
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0git remote add linux-next https://git.kernel.org/pub/scm/li= nux/kernel/git/next/linux-next.git
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0git fetch --no-tags linux-next master=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0git checkout df2de13a32afec989c0e735b= eb3bc391b3de1dbd
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# save the attached .config to linux = build tree
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0COMPILER_INSTALL_PATH=3D$HOME/0day CO= MPILER=3Dgcc-9.3.0 make.cross ARCH=3Dsparc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
>=C2=A0 =C2=A0 In file included from <command-line>:
>=C2=A0 =C2=A0 In function 'kmalloc_index',
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 inlined from 'kmalloc_node' at incl= ude/linux/slab.h:572:20,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 inlined from 'bpf_map_kmalloc_node.isra= .0.part.0' at include/linux/bpf.h:1319:9:
> >> include/linux/compiler_types.h:328:38: error: call to '__= compiletime_assert_236' declared with attribute error: unexpected size = in kmalloc_index()
>=C2=A0 =C2=A0 =C2=A0 328 |=C2=A0 _compiletime_assert(condition, msg, __= compiletime_assert_, __COUNTER__)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ^
>=C2=A0 =C2=A0 include/linux/compiler_types.h:309:4: note: in definition= of macro '__compiletime_assert'
>=C2=A0 =C2=A0 =C2=A0 309 |=C2=A0 =C2=A0 prefix ## suffix();=C2=A0 =C2= =A0 \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 ^~~~~~
>=C2=A0 =C2=A0 include/linux/compiler_types.h:328:2: note: in expansion = of macro '_compiletime_assert'
>=C2=A0 =C2=A0 =C2=A0 328 |=C2=A0 _compiletime_assert(condition, msg, __= compiletime_assert_, __COUNTER__)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 ^~~~~~~~~~~~~~~~~~~
>=C2=A0 =C2=A0 include/linux/build_bug.h:39:37: note: in expansion of ma= cro 'compiletime_assert'
>=C2=A0 =C2=A0 =C2=A0 =C2=A039 | #define BUILD_BUG_ON_MSG(cond, msg) com= piletime_assert(!(cond), msg)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~
>=C2=A0 =C2=A0 include/linux/slab.h:389:2: note: in expansion of macro &= #39;BUILD_BUG_ON_MSG'
>=C2=A0 =C2=A0 =C2=A0 389 |=C2=A0 BUILD_BUG_ON_MSG(1, "unexpected s= ize in kmalloc_index()");
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 ^~~~~~~~~~~~~~~~
>

This log doesn't show which .c file was being compiled at the time. Can this info be included?

For me, it was kernel/bpf/local_storage.c.

Yes. the file It is kernel/bpf/lo= cal_storage.c


I don't see anything wrong with the code.=C2=A0 Did this gcc simply scr= ew up
__builtin_constant_p()?

It seems there is false positive when = CONFIG_PROFILE_ALL_BRANCHES=3Dy

<= /div> --000000000000a8ffd805c4862711--