From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Thu, 20 Feb 2020 11:08:06 +0000 Subject: [PATCH v2 1/2] sparc,x86: vdso: remove meaningless undefining CONFIG_OPTIMIZE_INLINING Message-Id: <20200220110807.32534-1-masahiroy@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrew Morton Cc: Arnd Bergmann , Ingo Molnar , Thomas Gleixner , x86@kernel.org, clang-built-linux@googlegroups.com, Miguel Ojeda , sparclinux@vger.kernel.org, Masahiro Yamada , Andy Lutomirski , Borislav Petkov , "David S. Miller" , "H. Peter Anvin" , linux-kernel@vger.kernel.org The code, #undef CONFIG_OPTIMIZE_INLINING, is not working as expected because is parsed before vclock_gettime.c since 28128c61e08e ("kconfig.h: Include compiler types to avoid missed struct attributes"). Since then, is included really early by using the '-include' option. So, you cannot negate the decision of in this way. You can confirm it by checking the pre-processed code, like this: $ make arch/x86/entry/vdso/vdso32/vclock_gettime.i There is no difference with/without CONFIG_CC_OPTIMIZE_FOR_SIZE. It is about two years since 28128c61e08e. Nobody has reported a problem (or, nobody has even noticed the fact that this code is not working). It is ugly and unreliable to attempt to undefine a CONFIG option from C files, and anyway the inlining heuristic is up to the compiler. Just remove the broken code. Signed-off-by: Masahiro Yamada Acked-by: Miguel Ojeda --- Changes in v2: - fix a type - add Acked-by arch/sparc/vdso/vdso32/vclock_gettime.c | 4 ---- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/arch/sparc/vdso/vdso32/vclock_gettime.c b/arch/sparc/vdso/vdso32/vclock_gettime.c index 026abb3b826c..d7f99e6745ea 100644 --- a/arch/sparc/vdso/vdso32/vclock_gettime.c +++ b/arch/sparc/vdso/vdso32/vclock_gettime.c @@ -4,10 +4,6 @@ #define BUILD_VDSO32 -#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE -#undef CONFIG_OPTIMIZE_INLINING -#endif - #ifdef CONFIG_SPARC64 /* diff --git a/arch/x86/entry/vdso/vdso32/vclock_gettime.c b/arch/x86/entry/vdso/vdso32/vclock_gettime.c index 9242b28418d5..3c26488db94d 100644 --- a/arch/x86/entry/vdso/vdso32/vclock_gettime.c +++ b/arch/x86/entry/vdso/vdso32/vclock_gettime.c @@ -1,10 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #define BUILD_VDSO32 -#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE -#undef CONFIG_OPTIMIZE_INLINING -#endif - #ifdef CONFIG_X86_64 /* -- 2.17.1 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 21F4CC11D07 for ; Thu, 20 Feb 2020 11:10:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E77ED24654 for ; Thu, 20 Feb 2020 11:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582197017; bh=60VA2FQECHKjg/Q3jLMCbmQADjAEl3LApJcQccf3SQE=; h=From:To:Cc:Subject:Date:List-ID:From; b=qfyQYWWw7Vc2Q351R9Tz4dSFEZgeLmdhe8W7kF3jlJCp7772/FmJngnAVcWM5LZnd vwLfLcxLK751/aWwoGAx6GWaYuhYhAL3hlsnA6kOTTHbua1FcQj8Eih8AeD0flvE0I caC8ZRbzD68o/4gSrkXegcqwWuqRpwKSRDW4ovb4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbgBTLKP (ORCPT ); Thu, 20 Feb 2020 06:10:15 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:60149 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgBTLKO (ORCPT ); Thu, 20 Feb 2020 06:10:14 -0500 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id 01KB8BM7031854; Thu, 20 Feb 2020 20:08:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 01KB8BM7031854 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582196893; bh=IDIlSd5PyoZKAMfckRhRo9czWMeumqnauQZkG16ECr0=; h=From:To:Cc:Subject:Date:From; b=ohxozsMkZQqPJSG/vE4fd4Pi9I/Isldb/uNqGLS2y3mmJU+lGT3bo9VXLfM96rxru x/5s5ExU0483f5Ot70D29mQXggg9PZqGFytLabUrgYvyNhru0n1U6yL4Lgw0pfovI2 HfLY5djw3co/fTp1PlMaARayvrQa8i34RteGbiN8eq0zdZUuUuu3bAPxpyYTomc1zb oHrCln3XXkZ/QYucxcJIHhbaGNUj6yanRzgsgapEFjpi20A8/haFxfS/qq5+0LYtfb AoHEyAiVktt2GJHmyetd/Mh8nM4P1eL1LcjMJDvcsHFzIKPEaIUMHXn6sUM0xA3xqd IlHlcR2LtaAOg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Arnd Bergmann , Ingo Molnar , Thomas Gleixner , x86@kernel.org, clang-built-linux@googlegroups.com, Miguel Ojeda , sparclinux@vger.kernel.org, Masahiro Yamada , Andy Lutomirski , Borislav Petkov , "David S. Miller" , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] sparc,x86: vdso: remove meaningless undefining CONFIG_OPTIMIZE_INLINING Date: Thu, 20 Feb 2020 20:08:06 +0900 Message-Id: <20200220110807.32534-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code, #undef CONFIG_OPTIMIZE_INLINING, is not working as expected because is parsed before vclock_gettime.c since 28128c61e08e ("kconfig.h: Include compiler types to avoid missed struct attributes"). Since then, is included really early by using the '-include' option. So, you cannot negate the decision of in this way. You can confirm it by checking the pre-processed code, like this: $ make arch/x86/entry/vdso/vdso32/vclock_gettime.i There is no difference with/without CONFIG_CC_OPTIMIZE_FOR_SIZE. It is about two years since 28128c61e08e. Nobody has reported a problem (or, nobody has even noticed the fact that this code is not working). It is ugly and unreliable to attempt to undefine a CONFIG option from C files, and anyway the inlining heuristic is up to the compiler. Just remove the broken code. Signed-off-by: Masahiro Yamada Acked-by: Miguel Ojeda --- Changes in v2: - fix a type - add Acked-by arch/sparc/vdso/vdso32/vclock_gettime.c | 4 ---- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/arch/sparc/vdso/vdso32/vclock_gettime.c b/arch/sparc/vdso/vdso32/vclock_gettime.c index 026abb3b826c..d7f99e6745ea 100644 --- a/arch/sparc/vdso/vdso32/vclock_gettime.c +++ b/arch/sparc/vdso/vdso32/vclock_gettime.c @@ -4,10 +4,6 @@ #define BUILD_VDSO32 -#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE -#undef CONFIG_OPTIMIZE_INLINING -#endif - #ifdef CONFIG_SPARC64 /* diff --git a/arch/x86/entry/vdso/vdso32/vclock_gettime.c b/arch/x86/entry/vdso/vdso32/vclock_gettime.c index 9242b28418d5..3c26488db94d 100644 --- a/arch/x86/entry/vdso/vdso32/vclock_gettime.c +++ b/arch/x86/entry/vdso/vdso32/vclock_gettime.c @@ -1,10 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #define BUILD_VDSO32 -#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE -#undef CONFIG_OPTIMIZE_INLINING -#endif - #ifdef CONFIG_X86_64 /* -- 2.17.1