Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2400993pxb; Sun, 16 Jan 2022 19:37:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4bUJplkhvyu5fD7DZKOEWE7gWezYTLzcJ6XD0IjPxaINK6Z8EiTu9gjDCTQv0OQIqrnvr X-Received: by 2002:a05:6a00:1c6c:b0:4be:ac47:c045 with SMTP id s44-20020a056a001c6c00b004beac47c045mr19071044pfw.57.1642390650981; Sun, 16 Jan 2022 19:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642390650; cv=none; d=google.com; s=arc-20160816; b=DkjCVJNWT9II1qwVwgw/+pnAFAvsVrXjAcSPMejtLXFKyEO3T+NUG+f1VToWYVYZHU QIN288kPIOCR4SbVbMnw2L8zeeLNF8YHiVcVGwLOOY53gO5p/8vUM0PH0k8bSGKo3TP1 cHYuF/PTxZhSyxfQNAZNZFto7oAblFNqJPja+N3P9F1VG/gaIes/DrwkKq7kSNZmKa9A 12K/CTaSyyqaVR53O2MWQNBJXtVeFJ/7yg9cx0xuQZtV+J/YSdlUelA5gX/MQaJxpJPn cujUR3E0QjyGcLEq/qysdylvEBZX3arJRSW5ZtRjztR1e7SMwLuBnTevlB9XVOTke/tD fpxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=JwrDXfhUGO4bKBv3e7n23/xTEN7JZrJ6cGgwYh8bjXY=; b=tnya62R1+Cy5c1N6JLOIKyIZ5Bfi9rS0nIXw6xO3ikAfav46WE3b8hYPaRHS2oUTAm pKFSKN6L0cozHFLQf/VakWnCu7mEFGlpKiLSBD9OvASOAXOUvOt/S2EOsKjO8XS3JvSv SfTYmTMiWd35xo6zoaX4Gv7qeonzxmTzSzo89e4s5vRsO1tygPMKm2LQ01o3AN3o5927 exyzY9M/Oz128UnihEmq6PDJL0qpNfUvjpNJB89mHR4wKPG+sGxTTetbT5bRlY1xuTHF n4DKxKvOTsVWhGy+cRdcPnB8LLSPlvmAOlc+i1uEqfWbHaEt2JaA8wkfg3CQ4fTl7alP a8RA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si12583970plr.111.2022.01.16.19.37.19; Sun, 16 Jan 2022 19:37:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234221AbiAPD7Z (ORCPT + 99 others); Sat, 15 Jan 2022 22:59:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234204AbiAPD7Y (ORCPT ); Sat, 15 Jan 2022 22:59:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2CEEC061574 for ; Sat, 15 Jan 2022 19:59:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 593B460C6C for ; Sun, 16 Jan 2022 03:59:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D903EC36AE9; Sun, 16 Jan 2022 03:59:21 +0000 (UTC) Date: Sat, 15 Jan 2022 22:59:20 -0500 From: Steven Rostedt To: Nathan Chancellor Cc: Yinan Liu , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , kernel test robot , kernel test robot , llvm@lists.linux.dev Subject: Re: [for-next][PATCH 10/31] scripts: ftrace - move the sort-processing in ftrace_init Message-ID: <20220115225920.0e5939aa@gandalf.local.home> In-Reply-To: References: <20220111173030.999527342@goodmis.org> <20220111173115.079437896@goodmis.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Jan 2022 13:36:04 -0700 Nathan Chancellor wrote: > Hi Steven and Yinan, > > On Tue, Jan 11, 2022 at 12:30:41PM -0500, Steven Rostedt wrote: > > From: Yinan Liu > > > > When the kernel starts, the initialization of ftrace takes > > up a portion of the time (approximately 6~8ms) to sort mcount > > addresses. We can save this time by moving mcount-sorting to > > compile time. > > > > Link: https://lkml.kernel.org/r/20211212113358.34208-2-yinan@linux.alibaba.com > > > > Signed-off-by: Yinan Liu > > Reported-by: kernel test robot > > Reported-by: kernel test robot > > Signed-off-by: Steven Rostedt > > This change as commit 72b3942a173c ("scripts: ftrace - move the > sort-processing in ftrace_init") in -next causes a bunch of warnings at > the beginning of the build when using clang as the host compiler: > > > Should mcount_sort_thread be zero initialized or is there something else > going on here? I am currently hunting down a bunch of other regressions > so apologies for just the report rather than a patch to fix it. Can this really happen? We have: if (pthread_create(&mcount_sort_thread, NULL, &sort_mcount_loc, &mstruct)) { fprintf(stderr, "pthread_create mcount_sort_thread failed '%s': %s\n", strerror(errno), fname); goto out; } [..] if (mcount_sort_thread) { void *retval = NULL; /* wait for mcount sort done */ rc = pthread_join(mcount_sort_thread, &retval); if (rc) { fprintf(stderr, "pthread_join failed '%s': %s\n", strerror(errno), fname); } else if (retval) { rc = -1; fprintf(stderr, "failed to sort mcount '%s': %s\n", (char *)retval, fname); } } Shouldn't the pthread_create() initialize it? And I'm not even sure if we need that if statement? Or is there a path to get there without pthread_create() initializing it? -- Steve