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 F1526C433EF for ; Thu, 27 Jan 2022 06:55:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5DA0D6B0071; Thu, 27 Jan 2022 01:55:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 589AB6B0072; Thu, 27 Jan 2022 01:55:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 477F26B0073; Thu, 27 Jan 2022 01:55:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id 350106B0071 for ; Thu, 27 Jan 2022 01:55:36 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E0753181C9BA1 for ; Thu, 27 Jan 2022 06:55:35 +0000 (UTC) X-FDA: 79075156230.09.3A95722 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id 349F5C0007 for ; Thu, 27 Jan 2022 06:55:35 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34F2CD6E; Wed, 26 Jan 2022 22:55:34 -0800 (PST) Received: from [10.163.42.218] (unknown [10.163.42.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C70A3F766; Wed, 26 Jan 2022 22:55:28 -0800 (PST) Subject: Re: [PATCH V2 2/2] mm/migration: Add trace events for base page and HugeTLB migrations From: Anshuman Khandual To: Andrew Morton Cc: kernel test robot , linux-mm@kvack.org, kbuild-all@lists.01.org, naoya.horiguchi@linux.dev, rostedt@goodmis.org, Ingo Molnar , Zi Yan , Naoya Horiguchi , John Hubbard , Matthew Wilcox References: <1643080105-11416-3-git-send-email-anshuman.khandual@arm.com> <202201251716.ncCstDar-lkp@intel.com> <53c3d1bb-7085-4947-772c-a3cbf94f02c8@arm.com> <20220126200715.705dee557534713d5f3414e5@linux-foundation.org> <8fc766cb-ae00-3e98-2cad-4db261c9b600@arm.com> Message-ID: <90934f7b-d342-b39d-b837-604939056773@arm.com> Date: Thu, 27 Jan 2022 12:25:34 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8fc766cb-ae00-3e98-2cad-4db261c9b600@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 349F5C0007 X-Stat-Signature: gqzpqnbjs1ho9tt65rw6wy489sayw4xu Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspam-User: nil X-HE-Tag: 1643266535-428662 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 1/27/22 10:22 AM, Anshuman Khandual wrote: > > > On 1/27/22 9:37 AM, Andrew Morton wrote: >> On Tue, 25 Jan 2022 15:58:34 +0530 Anshuman Khandual wrote: >> >>> >>> >>> >>> The following change should fix both the reported build problems. >>> >>> diff --git a/mm/rmap.c b/mm/rmap.c >>> index cce5dbae07f2..cae1c46440d6 100644 >>> --- a/mm/rmap.c >>> +++ b/mm/rmap.c >>> @@ -76,6 +76,7 @@ >>> >>> #include >>> >>> +#define CREATE_TRACE_POINTS >>> #include >>> #include >> >> My x86_64 allmodconfig is unhappy. >> >> lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x129: call to do_strncpy_from_user() with UACCESS enabled >> lib/strnlen_user.o: warning: objtool: strnlen_user()+0xc9: call to do_strnlen_user() with UACCESS enabled >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/rmap.o:(.data+0x13e0): multiple definition of `__SCK__tp_func_tlb_flush'; arch/x86/mm/init.o:(.data+0x980): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/rmap.o: in function `__traceiter_tlb_flush': >> (.text+0x0): multiple definition of `__traceiter_tlb_flush'; arch/x86/mm/init.o:(.text+0x0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/rmap.o:(__tracepoints+0x180): multiple definition of `__tracepoint_tlb_flush'; arch/x86/mm/init.o:(__tracepoints+0x0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/rmap.o: in function `__SCT__tp_func_tlb_flush': >> (.static_call.text+0x0): multiple definition of `__SCT__tp_func_tlb_flush'; arch/x86/mm/init.o:(.static_call.text+0x0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__SCT__tp_func_mm_migrate_pages': >> (.static_call.text+0x0): multiple definition of `__SCT__tp_func_mm_migrate_pages'; mm/rmap.o:(.static_call.text+0x8): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(.data+0x13a0): multiple definition of `__SCK__tp_func_remove_migration_pte'; mm/rmap.o:(.data+0xfe0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__traceiter_set_migration_pte': >> (.text+0x140): multiple definition of `__traceiter_set_migration_pte'; mm/rmap.o:(.text+0x1c0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(__tracepoints+0x120): multiple definition of `__tracepoint_mm_migrate_pages'; mm/rmap.o:(__tracepoints+0x120): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__traceiter_mm_migrate_pages': >> (.text+0x0): multiple definition of `__traceiter_mm_migrate_pages'; mm/rmap.o:(.text+0x80): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__SCT__tp_func_mm_migrate_pages_start': >> (.static_call.text+0x8): multiple definition of `__SCT__tp_func_mm_migrate_pages_start'; mm/rmap.o:(.static_call.text+0x10): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(.data+0x1420): multiple definition of `__SCK__tp_func_mm_migrate_pages_start'; mm/rmap.o:(.data+0x1060): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(.data+0x1460): multiple definition of `__SCK__tp_func_mm_migrate_pages'; mm/rmap.o:(.data+0x10a0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__traceiter_mm_migrate_pages_start': >> (.text+0xc0): multiple definition of `__traceiter_mm_migrate_pages_start'; mm/rmap.o:(.text+0x140): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__SCT__tp_func_remove_migration_pte': >> (.static_call.text+0x18): multiple definition of `__SCT__tp_func_remove_migration_pte'; mm/rmap.o:(.static_call.text+0x20): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(__tracepoints+0x60): multiple definition of `__tracepoint_set_migration_pte'; mm/rmap.o:(__tracepoints+0x60): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(__tracepoints+0x0): multiple definition of `__tracepoint_remove_migration_pte'; mm/rmap.o:(__tracepoints+0x0): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__traceiter_remove_migration_pte': >> (.text+0x1c0): multiple definition of `__traceiter_remove_migration_pte'; mm/rmap.o:(.text+0x240): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o: in function `__SCT__tp_func_set_migration_pte': >> (.static_call.text+0x10): multiple definition of `__SCT__tp_func_set_migration_pte'; mm/rmap.o:(.static_call.text+0x18): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(.data+0x13e0): multiple definition of `__SCK__tp_func_set_migration_pte'; mm/rmap.o:(.data+0x1020): first defined here >> /opt/crosstool/gcc-10.3.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/migrate.o:(__tracepoints+0xc0): multiple definition of `__tracepoint_mm_migrate_pages_start'; mm/rmap.o:(__tracepoints+0xc0): first defined here >> make: *** [vmlinux] Error 1 >> > > This also seems to be a problem for existing trace points as well like tlb_flush > , mm_migrate_pages_start and mm_migrate_pages . > Is there some cyclic dependency ? Regardless, I can recreate the build problem. > Will look into it. CREATE_TRACE_POINTS should be defined just once, even if the corresponding trace header file is included in multiple C files. mm/rmap.c is a better place to have CREATE_TRACE_POINTS defined as it gets built always with CONFIG_MMU. Because the file mm/rmap.c now includes both and , all existing CREATE_TRACE_POINTS (including inside platforms) for them need to be dropped. A similar problem got created for on powerpc as well, after the first patch. The following patch here fixes this problem. But I will do some more testing and respin the series. diff --git a/arch/powerpc/mm/book3s64/trace.c b/arch/powerpc/mm/book3s64/trace.c index b86e7b906257..ccd64b5e6cac 100644 --- a/arch/powerpc/mm/book3s64/trace.c +++ b/arch/powerpc/mm/book3s64/trace.c @@ -3,6 +3,5 @@ * This file is for defining trace points and trace related helpers. */ #ifdef CONFIG_TRANSPARENT_HUGEPAGE -#define CREATE_TRACE_POINTS #include #endif diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 4ba024d5b63a..d8cfce221275 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -31,7 +31,6 @@ * We need to define the tracepoints somewhere, and tlb.c * is only compiled when SMP=y. */ -#define CREATE_TRACE_POINTS #include #include "mm_internal.h" diff --git a/mm/migrate.c b/mm/migrate.c index 253dc5812949..79e3a553923a 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -54,7 +54,6 @@ #include -#define CREATE_TRACE_POINTS #include #include "internal.h"