Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1735592pxj; Sun, 16 May 2021 02:31:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh1zbKQ15BpFwWW7+azReIQ0iRMgP4+vFtBwJr07T+cQotsmSPuHf90HaFIKLM29/y4A39 X-Received: by 2002:a17:906:f0cd:: with SMTP id dk13mr2107116ejb.11.1621157471912; Sun, 16 May 2021 02:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621157471; cv=none; d=google.com; s=arc-20160816; b=hfB9lPmVNK7oGT0TesA/dVozNyQtpxXyeEUv5fjGAlmPv3qr9DI3sCYOHcKW7fGAmU BxXQdG595njY6v2MDCvkB+UJ2Uqp0YsvCTEgVBznFvtmofSNJeO1OXw7DJ45tfRZx/GE nfBNhN7RgvDwMxQgU5yi1cJF79EwS1wsYlqskrbYieipYnAwZNuDC+x7YFPhlojcrfX3 /UH2fY7bHwVB+SngTCofYYjUg9EoV5zIetQw0pZ7QWCtHZ6o3JdijA1fR9Z0R1zVdowv J89WBdk2Hsfpf8EHiCqtbsPfDOKppapzXa5+tR5iE5i8GQrKpLr23GmS9rzISuHq4vdD nfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aYZAtsF7xEgxqNZKNcxlm0Wj61L74IXoCGhZC5SQH54=; b=viEXZinWraRCIxXeWt8OnPUUhlXmC1/BMXbUmoBBjYhCd3H2eayp3O2wvODLzoHHcA oWKYO344WaJsJzIuuKn2WSDEGVEPFO7becsS4MD7RgOjemBF5Uf84kM5Hg4QWrJ10Cf3 MP3SOml+xvxLIOfSfRnwh+T2bcbq5EvfmUJ2o8bkMPfsYmnl1mK7cjuBuAlR1CVcjWAI 1N80kegrXHcAvDG8usVeGgw7TsgQZHQMUR8osbDJaUu4I0zEdK6lwR12t/UQo+iGms2o Ji8ei+mhyclukBQhkk3zN3riZEmKnxAXjmXTfHBFfzlRsinvGJDQF2rIda07RrLBXW+9 Hfaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z9GvsUXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zg9si12487179ejb.436.2021.05.16.02.30.48; Sun, 16 May 2021 02:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z9GvsUXC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235157AbhEOV6K (ORCPT + 99 others); Sat, 15 May 2021 17:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235126AbhEOV6J (ORCPT ); Sat, 15 May 2021 17:58:09 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B1AC061573; Sat, 15 May 2021 14:56:55 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id t11so1766261pjm.0; Sat, 15 May 2021 14:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aYZAtsF7xEgxqNZKNcxlm0Wj61L74IXoCGhZC5SQH54=; b=Z9GvsUXCRBio9+f0zOgCgrbeKFMNn4BSBlw7C9QiWjl8v9/j14TqF6E6+V2Tv0rdSn WTSq1TUpiDI0FQnHJ4H4usnSx25x2F7SRWlkrX4skgDaFz3S/qXPmdwJyLPj3g1jJg8l HThY/4JLd5Mh2QCC/zF30koe8oEKt+Affzqnc2eIu7hpTUDZZJxVHuhl7UBZWca+s/Xi MpoMCg+7lRektYzKIIZj4Jag/z+C2D7M/wxXU7F+R7a2jjqQunfgsCKMY8aPL0uSB0r+ BwMCi6ldGKr+12PhDq+QFbl9O2flEwn28F4ncOiCCb3cv2Se21UZU2ShGwPUKMlkDzNg V9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aYZAtsF7xEgxqNZKNcxlm0Wj61L74IXoCGhZC5SQH54=; b=HosULz6sOiqA8B9FkZAwZovXwF27HaYHv6jI366u94p0WvjxoxYdQdmo0CgrP9k3cJ Wx9QRGReFg+t7caSjuegz7UI7suH0WQJpucDAihXq4cplz1cBKTl6fcFVEfg9IbJCiJq HZrk2c827xkweP1Vgug0u+VAsh3IDHE4mxGMgGgvjlgQKUjdFH80wQ3ARASDHwur1pbW o8XPu4cH2x4vlEOy3cj9LksuiUK62jcK9c2AqcLx/jUm6wta8GWkywiCD4xQvcAWY009 YxO/QSgXqnnHhyW2e/o1wHhtlnVW1j5a7CuS8RqdnU+IaAVNr5bgO0woouKqxoq52vK+ +CPg== X-Gm-Message-State: AOAM532JAPyLZQ3bbQKtbmsFRBdpWVA4eoJTImFnjMC6JXP/JwxB9AlX jA59doj9yrMyoNyYwfa/XDY= X-Received: by 2002:a17:90a:1588:: with SMTP id m8mr18534229pja.31.1621115815294; Sat, 15 May 2021 14:56:55 -0700 (PDT) Received: from hyeyoo ([121.135.181.35]) by smtp.gmail.com with ESMTPSA id l62sm6592567pfl.88.2021.05.15.14.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 May 2021 14:56:55 -0700 (PDT) Date: Sun, 16 May 2021 06:56:47 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, rientjes@google.com, penberg@kernel.org, cl@linux.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, nathan@kernel.org, naresh.kamboju@linaro.org, clang-built-linux@googlegroups.com, linux-next@vger.kernel.org, ndesaulniers@google.com, lkft-triage@lists.linaro.org, sfr@canb.auug.org.au, arnd@arndb.de, Marco Elver Subject: Re: [PATCH v3] mm, slub: change run-time assertion in kmalloc_index() to compile-time Message-ID: <20210515215647.GA61684@hyeyoo> References: <20210511173448.GA54466@hyeyoo> <20210515210950.GA52841@hyeyoo> <41c65455-a35b-3ad3-54f9-49ca7105bfa9@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41c65455-a35b-3ad3-54f9-49ca7105bfa9@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 15, 2021 at 11:24:25PM +0200, Vlastimil Babka wrote: > > That's a misunderstanding. __kmalloc() is not a dummy function, you > probably found only the header declaration. > Sorry, that was totally my misunderstanding. I was reading dummy function in arch/alpha/boot/bootpz.c:415. I wrongly configured the tool. > It appears clang 10.0.1 is mistakenly evaluating __builtin_constant_p() > as true. Probably something to do with LTO, because MAX_OPTINSN_SIZE > seems it could be a "link-time constant". That is what I was missing. Thank you for kindly explaining it. > Maybe we could extend Marco Elver's followup patch that uses > BUILD_BUG_ON vs BUG() depending on size_is_constant parameter. It could > use BUG() also if the compiler is LLVM < 11 or something. What would be > the proper code for this condition? Fixing clang's bug in linux kernel doesn't seem to be a solution. So now I understand why Nathan said we might require LLVM > 11. I thought I should do something to fix it because I sent the patch. but I was misunderstanding a lot. Thank you sincerely for letting me know. Thanks, Hyeonggon