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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DCC7C433FE for ; Mon, 14 Nov 2022 16:56:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1476E6B0074; Mon, 14 Nov 2022 11:56:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F9408E0002; Mon, 14 Nov 2022 11:56:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2ACE8E0001; Mon, 14 Nov 2022 11:56:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E4A186B0074 for ; Mon, 14 Nov 2022 11:56:28 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 900E540F30 for ; Mon, 14 Nov 2022 16:56:28 +0000 (UTC) X-FDA: 80132651256.17.3173E43 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id DE32B80011 for ; Mon, 14 Nov 2022 16:56:27 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3C8C22015B; Mon, 14 Nov 2022 16:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668444986; 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=cohWP967fM5k66eiwPyUCzOvFE5A3xQATFXcYzJTBgI=; b=x8PJN/88Rs3HDZEPW4SS73lszJ990ZTjc7y0jGLs1TsAm2/0hhzlKEz9nyBvf6x6OYDVbt /rCmgFK6yaPNV0zwY7qwMT2CmdSdnVlXyIrQ4k2B9qrTNRWspbz7+oIl79Qd6OQFofxHTN 6voNGvj6fjSfCQ6eDXyFwZlJJByGl50= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668444986; 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=cohWP967fM5k66eiwPyUCzOvFE5A3xQATFXcYzJTBgI=; b=RZcYSQu9jIglU+wUpMu9+XuS0nOFfr3z7sgt41Fe2Y52l6JV2t+2HrXL88xqAbNaDLLNm+ VZPSieo85RWXtfDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1A74F13A92; Mon, 14 Nov 2022 16:56:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eUHsBTpzcmMARgAAMHmgww (envelope-from ); Mon, 14 Nov 2022 16:56:26 +0000 Message-ID: <5dc7529d-9edf-4ea7-35d3-a5f3dc55dd5c@suse.cz> Date: Mon, 14 Nov 2022 17:56:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: include: linux: slab: kmalloc_trace undefined when compiling drivers Content-Language: en-US To: Ian Cowan , Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Randy Dunlap , cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1df133ef-d5e9-f323-7c67-fc9ffed04274@infradead.org> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668444988; a=rsa-sha256; cv=none; b=IjPlaZwy2MsqiIGbr/FG9AkpRQqJZcmEfJ9yzG3A2vllc2mTSf3dESF1EYjWcH3ZDOriHw aUqEEKWMMSqmIQgl93/cKg8ol9xlFVf0eq233KSuR0ljHsO3Po61Ju2ITpS6cKtoLyRExH H1lQpZEEqhw5lGL+eCx2YeZhGZmzcSI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="x8PJN/88"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=RZcYSQu9; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668444988; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=cohWP967fM5k66eiwPyUCzOvFE5A3xQATFXcYzJTBgI=; b=GYrCshEX7sNjDQ1rZOHa3UaPaIG1G/Z5v9+NfrmnEKobNRDMD1a8Rs9xjY2jERwgEtqxp6 UdachkYYJj7dk4HlOLrs9oTzxYk2yJTvE58pKBuCKUI3tHr+z5HFu9KaQEVwZaTaPooLx4 Fq4KF8VRZKK1kEvSdcFAMyG+aCokLtE= X-Rspam-User: X-Stat-Signature: w9awx9artkumcyzhq36fdmfcrqckm37g X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DE32B80011 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="x8PJN/88"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=RZcYSQu9; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-HE-Tag: 1668444987-51189 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 11/14/22 13:39, Ian Cowan wrote: > On Mon, Nov 14, 2022 at 05:59:06PM +0900, Hyeonggon Yoo wrote: >> On Sat, Nov 12, 2022 at 08:21:14PM -0500, Ian Cowan wrote: >> > On Sat, Nov 12, 2022 at 05:11:27PM -0800, Randy Dunlap wrote: >> > > >> > > >> > > On 11/12/22 16:43, Ian Cowan wrote: >> > > > On Sat, Nov 12, 2022 at 04:34:18PM -0800, Randy Dunlap wrote: >> > > >> >> > > >> >> > > >> On 11/12/22 13:59, Ian Cowan wrote: >> > > >>> On Sat, Nov 12, 2022 at 09:21:34AM -0800, Randy Dunlap wrote: >> > > >>>> Hi-- >> > > >>>> >> > > >>>> On 11/12/22 08:37, Ian Cowan wrote: >> > > >>>>> When compiling drivers (speficially drivers/pci/hotplug), I am receiving >> > > >>>>> the following modpost error for both `kmalloc_trace` and >> > > >>>>> `kmalloc_node_trace` on the staging/staging-next branch: >> > > >>>>> >> > > >> >> > > >> Ian, what do you mean by "on the staging/staging-next branch"? >> > > >> >> > > >> What kernel version are you trying to build? >> > > >> >> > > >> The .config that you sent is for v6.1.0-rc1. >> > > > >> > > > I am building from the staging repository (gregkh/staging) and my >> > > > working branch when building is staging-next. So I am trying to build >> > > > from staging and not a particular version. I have also run `make modules_prepare` >> > > > and updated the .config per that script. However, when I do build >> > > > v6.1.0-rc1 from the main repository (torvalds/linux), I run into the same problem. >> > > >> > > Have you built the entire kernel already and then you are trying to build >> > > only drivers/pci/hotplug? >> > Yes, I did build the entire kernel already and then I'm just trying to >> > rebuild that module. >> > >> > In `include/linux/slab.h` if I remove the lines between `#ifdef >> > CONFIG_TRACING` and `#else` (lines 473-480) and then the corresponding >> > `#endif` and leave lines 481-499, I'm able to compile that module >> > without issue. >> >> I don't get what the problem is. >> In case kmalloc[_node]_trace() is undefined, it's replaced with kmem_cache_alloc[_node]. >> >> Is the kernel built with same config on tree? > > Yes, the same config on tree with no errors or warnings. I was able to > trace it back to this commit - building on the commit immediately prior > builds without error or warning. It looks like this commit does some > refactoring of the kmem_cache_alloc[_node] and kmalloc[_node]_trace. > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?h=staging-next&id=26a40990ba052 As you can see in that diff, mm/slab_common.c does EXPORT_SYMBOL(kmalloc_trace) and EXPORT_SYMBOL(kmalloc_node_trace) so I don't see why they should be missing. Wonder if you have a stale mm/slab_common.o because for some reason it's not being recompiled (a file timestamp in the future?) Can you rm it and rebuild? And maybe also mm/built-in.a Or maybe a full make clean and/or a fresh checkout.