Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp85494pxb; Wed, 24 Feb 2021 19:13:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk1dKUXcZFrHeHEYvct8Ahnkp+1+jr9F7rEpxx5i2fRE+SVzehveOZFIHxg2BegwnNIPm/ X-Received: by 2002:a17:906:379b:: with SMTP id n27mr688187ejc.454.1614222793572; Wed, 24 Feb 2021 19:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614222793; cv=pass; d=google.com; s=arc-20160816; b=YUhp4b/ITvQuql/o7V1lSpjAfELKRtzU4F7arSQkb5LkH18IIFy1Hue3ixRJDct4e2 FrBssYPq2LL03fwxQcWNqF57b3exRzcQSPBufeGW0vjSxY4vpHRTNyoroGNGeG+/hT44 j7em2ig68tQkV8XGlU4TR2N/O0Vuns7SeQeZpqAZbzNu4oTbO+itBLPLrPylrJI/3uvr oOlsrjU0PxbjpC2Cmo7yB01H4PkU7NEZpxEFtQl/q8XLeOSybcBiPfpL/Ti/sC1rcnF6 2sHUOnIrOEmRlczXYjagUlvL8e1opNqQibFxgJQqWrEA2EiKlL9JLfcfVHfQU5rhWpOf XGeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=j1Fid+9O00HHbV8ST2POgJL74twLkoyPuuWoymfXvO0=; b=A2ekJIwF2fZvWKIXHi0hANPzA5XK7eb61OGi33RSshl0Wc+UVgzd0ziYVGsRfMT6Of 8RB6SH2S+EDeFfJva3Vq88O7MS1PqOfk4wmPLQL4v5VFywnImIdLfBsw83qgHCu+csAs 6EK7uOJPPzrQM2m0NysAXNn0CCWq2PlXeyxX96TpASuDuCu+YqztFPKPzfGzXFnG71qm m5qM3EWNQGB/mr4ApYvH8sJzg6Wor/VZcIKhuTlm73uYyGXY0Knk1k8bHnhr8X1bPr5O vrYswkGkYQwn4r1hLKxMUvCfHd5gMPlXfGfPqqa/RikjhOkeHRhlM52Tf0JqziXKRpri PfNw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@prevas.dk header.s=selector1 header.b=Lun7fKta; arc=pass (i=1 spf=pass spfdomain=prevas.dk dkim=pass dkdomain=prevas.dk dmarc=pass fromdomain=prevas.dk); 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=REJECT sp=REJECT dis=NONE) header.from=prevas.dk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si2499849ejc.694.2021.02.24.19.12.49; Wed, 24 Feb 2021 19:13:13 -0800 (PST) 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=@prevas.dk header.s=selector1 header.b=Lun7fKta; arc=pass (i=1 spf=pass spfdomain=prevas.dk dkim=pass dkdomain=prevas.dk dmarc=pass fromdomain=prevas.dk); 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=REJECT sp=REJECT dis=NONE) header.from=prevas.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233844AbhBXThd (ORCPT + 99 others); Wed, 24 Feb 2021 14:37:33 -0500 Received: from mail-eopbgr130133.outbound.protection.outlook.com ([40.107.13.133]:35381 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233576AbhBXThb (ORCPT ); Wed, 24 Feb 2021 14:37:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IfOPrLXgG+orvOKb4Eh2QybTYsdTRB+woJaxnQsXD06zZjGQBYhxXEDXW92AcDgwWlZx4cPkkly6fQNBQorjLd9ZV44ut2amEzXco5HzYKNz4bADUJXiV032k0QxE/05cCPsomnHYO/OdqNc1P8n7BXhlKVTOe3hhcma/PhZGw5y5mk+vyAW8WessJTqRxRzhDN4Ffx6yIMQjhU9RWIfkPXh78OTBFiv15edClaXVqYbhHmsA0g8/sO3pKZ+CInByjuKijZwW/XD4n76q93Ewn0zSX/0mS1KspX5aZwznu8v8oy1cVNB+TB/m/GIku+LpYw4obup/a73njggFvdgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j1Fid+9O00HHbV8ST2POgJL74twLkoyPuuWoymfXvO0=; b=YEe8QdxAXUaT6JHyrr9Jg/XiKT2c+YqLA1Y+w1e6Ee9luzB3GP1BHyrjg4JVdggIF3q6SaI4fBLnrmuqizu/csxr/b2jSbT4ObpOK8YVbxObI6Qr+iQlIQMq5eWB/Zgu94pvKwJ+iv0Ncg4cczWoGJmrPn4jDypQe3N/SXTkWJztNRWW1zo48MH3ChCji3KdHiTWP+9R2CXhjsqQUi1ZL3MfmWmuQcmTCAiZZXCRXfc0PgxV3RlbtQ2GQjrkonWfeouwhOiFN4rPYgDd5vyE+xAO08IdIJiCIK7qshPi173y1uqjvNmwULqxpi1hx5rxQQMFHByyvKP0ItNjDxrCZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j1Fid+9O00HHbV8ST2POgJL74twLkoyPuuWoymfXvO0=; b=Lun7fKtaNxjwGt7Mx7X1DUc2zXePvDS95PX6PqFHA8pnLHDIINWu5BBF+FJrta10wwKcl0TeWsb5E7fkZPBvXyIwbbMYkN0pJPAg9q/I+ukZonE+rceQ+OjRZTqk6CuJzRQu18+fvJ8VoRBGrJLpXt0ww47QchCM88eBW/oygGA= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=prevas.dk; Received: from AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:2f::12) by AS8PR10MB4566.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:2b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Wed, 24 Feb 2021 19:36:41 +0000 Received: from AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM ([fe80::312c:d368:d6f:10c]) by AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM ([fe80::312c:d368:d6f:10c%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 19:36:41 +0000 Subject: Re: [GIT PULL] Modules updates for v5.12 To: Masahiro Yamada , Jessica Yu Cc: Linus Torvalds , Christoph Hellwig , Linux Kernel Mailing List , =?UTF-8?Q?=ef=bf=bcMiroslav_Benes?= , Emil Velikov References: <20210223200130.GA8059@lst.de> From: Rasmus Villemoes Message-ID: Date: Wed, 24 Feb 2021 20:36:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [80.208.71.141] X-ClientProxiedBy: AM6P193CA0043.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::20) To AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:2f::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.149] (80.208.71.141) by AM6P193CA0043.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 19:36:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c20283f-c973-4ca8-0b2c-08d8d8fb8294 X-MS-TrafficTypeDiagnostic: AS8PR10MB4566: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /D80bcLF9h2OaStwqrS+lBbV78KvgSgJh/pCXQwMHoSzYSCgghhPrMTGGqGwJz/lf7cPkMio83QD06bCciiMuX3NrsPQZ+7eFXc3osSDzLFgrPvArYPmppq1pKPuf+mzjSBR3WrFV8YmTp6AlOWQfIOfvxRVvvfIQFhMIUhQF0iSz4bOBVaODcc7tfc/CpYdVAG+F7aduvwaXZcSZGBbKQbhZBPmHaecOOH7o6FdFK3snZu4veXNynINDfFfydZdidoh7KERhL/tnSqfZEtfKz/zQ5X6JYTTDEkS18afMROnvpzQh5TGr1gW/3p+E8064ePg+U68pFcfNIP54SqwwDzQOnqJXnAcgePtYzBbmmJzF7afnpWwjN41sD44OmktvdLJI375/E1gpBBqtw4SqEtNxm9JYXbsbIuqtrc41TBsp2lY0FlVbQTuSB5KmR0vpvKxA84zVqVBFJTNDHcv0vcwZpzylVoY1xqrOirfDMxaeCtdVDVLA953s+yUqZlZZ0u6wp5+cWbpF7ugoJ9fgrVigSKoFgFBSfg8bH5kp9zrYg4D445zysdUOsCk2GTE8hYA7oSn8yqx2cYOck+hOkoCgdm7UDABzEL1xx1KOO0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(346002)(366004)(39830400003)(376002)(136003)(66946007)(66556008)(66476007)(16526019)(31686004)(26005)(8976002)(186003)(8676002)(8936002)(4326008)(2906002)(54906003)(31696002)(316002)(36756003)(52116002)(16576012)(5660300002)(53546011)(110136005)(6486002)(44832011)(2616005)(956004)(86362001)(478600001)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?WG42a1lkdTlnRVFvc0pza0w0Q1BvcERlWVlub3A0dnhTSEJLb011Wi9mTDls?= =?utf-8?B?ci9BeEcrcUx0clI2TzB1clRBOVF0cVhNcm93SW54cE0vZ2txSFp2bzFDaHpW?= =?utf-8?B?bEFDZjc0elY3Ym4xbUZwZWdSTytML08xUnU2T3VSMGhRLzlVVTYzWmh1cStj?= =?utf-8?B?cFpzQzNsWlRZM0dPVG9ncHJwS21pRWY4WmdzQzZwUyt2emozdHJRNkY0WXpU?= =?utf-8?B?dE84S0JySmNScWNKanRXdnFFZ3pKYXpzSjNGdnlTRWdMdW9SczF6SURvNGRN?= =?utf-8?B?d2tWcnUveXo4ZjN1QUZ2SE5TWUd6bnlSK1ZhTG84eHZjZUNORzZxemt0ZGRj?= =?utf-8?B?K2RpY2xaYUhBbFlyUUJFbWFzZTRjNS9KbFZWTStjK2hobExLQmZNRTRwL0VN?= =?utf-8?B?RWFMYUwzVDE2di9MR0pOZ2NQY0F4RlZHeVp0dzRFNzFQdFAxejhETnhUbzdn?= =?utf-8?B?UzYzRGUyQWV0SzJ4OXFPUXZuWWNwNFVueTNEajh2TEVSbFRwdDNCTlkxd1hE?= =?utf-8?B?QlVGQ2lJejR0cTBFcmlpbWlIRkFUSnlkcjFtRUh4M2NJOHFxTFM3dEhsSU1w?= =?utf-8?B?WjFPWGcvc1pqaDFqZFpiMkFpcGxpWFFTbm8vSkdLcDZ2a0FDb2F3UEplM29a?= =?utf-8?B?QzE2SU9uZ3VzVUtKZzVHTlV6K2UwbGk5N3Bkb0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XT09CaEJjWjM5YlRueGJHc1E1Tk94?= =?utf-8?B?RTdpeWMxRTRxcVMzb0N1T1JYS0ZpV2FSWDhmR3cvTU5vVDByaFQ4M0gxaEFE?= =?utf-8?B?NWNaZUlZRjJlNWNTS250YisyeTQvT3BaYjluUTVBaGdNYkxUclJyV056TGh1?= =?utf-8?Q?YykgNN7mKXaAex5zyt7YyIJ4Y4rBOVqPFBDbKrZ?= X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 5c20283f-c973-4ca8-0b2c-08d8d8fb8294 X-MS-Exchange-CrossTenant-AuthSource: AM6PR10MB1880.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 19:36:41.5844 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Eip8R0qR6nO0Q0YY2IzHglrZ4Nx02E/6m4SoJgGD2Lrte/6VFCNumvJUwEzN2otBdr72fXHip8+ecoI+Pd8uOfBDH18yu8NBr5O1aufsFj8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB4566 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/02/2021 15.40, Masahiro Yamada wrote: > On Wed, Feb 24, 2021 at 5:33 PM Jessica Yu wrote: >> >> +++ Linus Torvalds [23/02/21 12:03 -0800]: >>> On Tue, Feb 23, 2021 at 12:01 PM Christoph Hellwig wrote: >>>> >>>> Does your build now enable TRIM_UNUSED_KSYMS but previously didn't by >>>> chance? >>> >>> Crossed emails. >>> >>> This is plain "make allmodconfig", so yes, now it will enable TRIM_UNUSED_KSYMS. >>> >>> This is unacceptably slow. If that symbol trimming takes 30% of the >>> whole kernel build time, it needs to be fixed or removed. >> >> [ Adding Masahiro to CC ] >> >> It looks like CONFIG_TRIM_UNUSED_KSYMS had been hiding behind >> CONFIG_UNUSED_SYMBOLS all this time, and once the EXPORT_UNUSED_SYMBOL >> stuff was removed, it exposed that option to be selected by >> allyesconfig. That option had previously caused build issues on >> powerpc on linux-next, so I had temporarily marked that as BROKEN on >> powerpc until Masahiro's fix landed in linux-next. I was not aware of >> the additional build slowdown issue :/ In any case, Christoph's >> suggestion to invert the option sounds reasonable, since the mips >> defconfig selects it, it does not seem totally unused. > > > TRIM_UNUSED_KSYMS builds the tree twice by its concept. > > [1] 1st build > At this point of time, we do not know which EXPORT_SYMBOL() > is needed. So, EXPORT_SYMBOL() is enabled, or noop'ed > based on the temporal guess. > (in the fresh build, EXPORT_SYMBOL() are all nooped.) > > [2] Get the list of symbols needed to resolve all symbol references. > (this information is collected in include/generated/autoksyms.h) > > [3] 2nd build > Rebuild the objects whose EXPORT_SYMBOL() > must be flipped. I'm thinking we should be able to generate a linker script snippet from [2] and use that when linking vmlinux, so there's no recursion and no rebuild of individual .o files (and all the __cond_export_sym trickery goes away). The ksymtab entry for foo is already emitted in its own ___ksymtab+foo section (or ___ksymtab_gpl+foo). So if the sorted list of undefined symbols listed in the .mod files (plus the whitelist) consist of foo, bar and baz, generate a header to be included by vmlinux.lds.h that says #define KSYMTAB_SECTIONS \ ___ksymtab+foo \ ___ksymtab+bar \ ___ksymtab+baz \ #define KSYMTAB_GPL_SECTIONS \ ___ksymtab_gpl+foo \ ___ksymtab_gpl+bar \ ___ksymtab_gpl+baz \ with a !CONFIG_TRIM_UNUSED_KSYMS definition of these that just says #define KSYMTAB_SECTIONS ___ksymtab+* #define KSYMTAB_GPL_SECTIONS ___ksymtab_gpl+* and use that __ksymtab AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ KEEP(*(SORT(KSYMTAB_SECTIONS))) \ __stop___ksymtab = .; \ Only one of ___ksymtab+foo and ___ksymtab_gpl+foo will exist, but that doesn't matter (it's really no different from the fact that many files (i.e. the * before "(SORT") don't contain any section matching ___ksymtab_gpl+*). We may then have to add another discard section to put the remaining ___ksymtab_gpl+* sections in, but that's fine as long as that stanza just appears later in the linker script. If LD_DEAD_CODE_DATA_ELIMINATION was more widely supported (and I was surprised to see that it's not even available on arm or x86) one could also play another game, dropping the KEEP()s and instead create a linker script snippet containing EXTERN(__ksymtab_foo __ksymtab_bar ...), referencing the "struct kernel_symbol" elements themselves rather than the singleton sections they reside in. Rasmus