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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 13063C48BE6 for ; Fri, 11 Jun 2021 23:59:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A34D6613C3 for ; Fri, 11 Jun 2021 23:59:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A34D6613C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 39DEB6B006C; Fri, 11 Jun 2021 19:59:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34CDC6B006E; Fri, 11 Jun 2021 19:59:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19FC76B0070; Fri, 11 Jun 2021 19:59:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id D9F456B006C for ; Fri, 11 Jun 2021 19:59:32 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 69837180ACEE4 for ; Fri, 11 Jun 2021 23:59:32 +0000 (UTC) X-FDA: 78243112584.31.DA8F106 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf08.hostedemail.com (Postfix) with ESMTP id C741E80192FE for ; Fri, 11 Jun 2021 23:59:25 +0000 (UTC) Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 47DAF1FD6D; Fri, 11 Jun 2021 23:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623455970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jkYV88gcwrIuzQz/Og6s3rvnhh/qL/rLuzjMF7ISLE=; b=GxQOPhQ2NpoMOHQVjbYUzK1BCpO0HXjuKdUFTXgDJGH4nUTif138ryh2K79rO/2sqdpIPt +m71EX+jR85g3XHMWTNmlSo+askxJqP2QecrmFBD3x34SyPLUiTsNa0b1WKvZhjmZ3ar/j LaMKm6EIEzP9ldqa6Qv2lB5apkbfstQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623455970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jkYV88gcwrIuzQz/Og6s3rvnhh/qL/rLuzjMF7ISLE=; b=JUiKD0NrfgWsMQ0dg/oBlYAfmiPQb1Kj0EjI7rIdIxjjauhIqAuRSeTJunbgK2+HsVYQKz JSPoAxpqSuFt6TDQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 29A1B118DD; Fri, 11 Jun 2021 23:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623455970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jkYV88gcwrIuzQz/Og6s3rvnhh/qL/rLuzjMF7ISLE=; b=GxQOPhQ2NpoMOHQVjbYUzK1BCpO0HXjuKdUFTXgDJGH4nUTif138ryh2K79rO/2sqdpIPt +m71EX+jR85g3XHMWTNmlSo+askxJqP2QecrmFBD3x34SyPLUiTsNa0b1WKvZhjmZ3ar/j LaMKm6EIEzP9ldqa6Qv2lB5apkbfstQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623455970; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4jkYV88gcwrIuzQz/Og6s3rvnhh/qL/rLuzjMF7ISLE=; b=JUiKD0NrfgWsMQ0dg/oBlYAfmiPQb1Kj0EjI7rIdIxjjauhIqAuRSeTJunbgK2+HsVYQKz JSPoAxpqSuFt6TDQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id Nv2UCeL4w2A6VQAALh3uQQ (envelope-from ); Fri, 11 Jun 2021 23:59:30 +0000 Subject: Re: [linux-next:master 7012/7430] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_183' declared with attribute error: unexpected size in kmalloc_index() To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: kernel test robot , kbuild-all@lists.01.org, Linux Memory Management List , Andrew Morton , Nathan Chancellor , Nick Desaulniers References: <202106051442.G1VJubTz-lkp@intel.com> <20210606110839.GA13828@hyeyoo> <20210607122550.GA752464@hyeyoo> <06af75da-ffe9-7070-1da8-bcb2cb7881d2@suse.cz> <20210607154957.GB927582@hyeyoo> <6e1d48f2-409c-0a71-4d04-a907fe4183b8@suse.cz> <20210608170528.GA28015@hyeyoo> <2d2d792e-e189-99a4-36cb-f1473a4df9ad@suse.cz> <20210608184501.GA5505@hyeyoo> <513f82e6-175c-d040-691c-5d0e7dacfb83@suse.cz> From: Vlastimil Babka Message-ID: Date: Sat, 12 Jun 2021 01:59:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C741E80192FE Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=GxQOPhQ2; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=JUiKD0Nr; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=GxQOPhQ2; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=JUiKD0Nr; spf=pass (imf08.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Stat-Signature: ez8471r5difqqh4inft1kf47audpsx5s X-HE-Tag: 1623455965-55363 Content-Transfer-Encoding: quoted-printable 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: On 6/11/21 1:56 PM, Hyeonggon Yoo wrote: > On Fri, Jun 11, 2021, 7:27 PM Vlastimil Babka > wrote: > I meant the the condition to use BUILD_BUG_ON instead of BUG_ON wou= ld include > !IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) >=20 >=20 > You mean this? (This will make kmalloc_index return -1 without BUG()) >=20 > if ((IS_ENABLED(CONFIG_CC_IS_GCC) || CONFIG_CLANG_VERSION >=3D 110000) = && > size_is_constant) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 BUILD_BUG_ON_MSG(!IS_ENABLED(CONFIG_PROFILE= _ALL_BRANCHES), "unexpected > size in kmalloc_index()"); > else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 BUG(); No, > Or This? >=20 > if ((IS_ENABLED(CONFIG_CC_IS_GCC) || CONFIG_CLANG_VERSION >=3D 110000) = && > size_is_constant && !IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 BUILD_BUG_ON_MSG(1, "unexpected size in kma= lloc_index()"); > else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 BUG(); >=20 > Maybe this version seems better Yeah, meant that. > But little bit worried :( > The code is getting too complicated... > How do you think? Yeah, I expected that problems like this could occur as we're poking at s= ome rare corner cases of compiler implementations here. But if that leads to = fixes in compilers, good for everyone I'd say. So I would try this, even if it becomes complicated.