Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp855727pxb; Fri, 22 Apr 2022 12:43:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3lVNyJw8VLEpLun6sy92ga9SreltJt2oh7iM6alkjMMv17sgWPO19FUDWr9zz00x3PQfG X-Received: by 2002:a17:902:d717:b0:156:20a9:d388 with SMTP id w23-20020a170902d71700b0015620a9d388mr6199917ply.19.1650656596186; Fri, 22 Apr 2022 12:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650656596; cv=none; d=google.com; s=arc-20160816; b=Gix15lE+xsOILynibKw2Gk3powE59VIYpIqyj8T/aqAJCdwv7Mb5WzzlWBOn+vP72s agLVE/0Tb0zNDfvY9fJwvFOArfCijXJsCwdCZyuusSnpSqVkznmhXPfDBud46E+0dlIh 6u73dowOmRs1N3n7D32uiTMRpXsOXWqAto1ZQZFHrsxYCdgLK1ymk8D/h99rdrg3lgxD xRsUIeiiVG9Nb7bVQ6lCwk2+MFDzE3vvuiryPtHGtTVdIxhBZXrGXoe6cBMf3ZrkaiVB yk092RBbFiL+O5NJJomy+48R3ARBoJMKcCxAOR8adcsC3Sn/rt478RKTNIUXOq3hpZQJ /13w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wGWQsodsPCEvTet53bPj88p4jYhZ/d++dMltkcbaEYI=; b=tYLj1Nto1vAl34Xi+pr+TcHlRlYO2nwpFnv2xLOKa2ogqi51stdAMkKpNu72wKqnvf 4MRnZX0Tiy/YVlzzw63CIMgalwsqExKsm949/x/cODUij16qiYXyT/Mw4CFnA05h8gf+ GfhH3LvBZ2STc5Q23N45jrrtpmwjwCaqjY7VZxKWJO6sj2VKGjAaHdqOCAQO9XhGjmsq NpLq08FaqiW6UOPtAo6j+Olp7aHbRkDqgP6S/Gix/4m4St2DeU7+yJYc1ezAB3jQNi67 KgqD9sy6xVhbvhPy1V6W620FE4fcUCBGLIuYaVrStY8kMCFNBChFJjMlhSkXpkZhrtow suEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mAgORrZD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 11-20020a630b0b000000b003aaa48117c6si4709505pgl.816.2022.04.22.12.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:43:16 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mAgORrZD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F24CA17036C; Fri, 22 Apr 2022 11:48:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446855AbiDVKsy (ORCPT + 99 others); Fri, 22 Apr 2022 06:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446851AbiDVKsx (ORCPT ); Fri, 22 Apr 2022 06:48:53 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD0E3FBFA; Fri, 22 Apr 2022 03:45:59 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id w1so13575928lfa.4; Fri, 22 Apr 2022 03:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wGWQsodsPCEvTet53bPj88p4jYhZ/d++dMltkcbaEYI=; b=mAgORrZD4oGwxnomgnH+TjiwLaKb2n8RwwlVy9gojA6VXZvgpCuQHQFkyqo+L5hSg7 P/CfljKHsQEkc4wyZRStj3cokDs5YI3oqJNK1uGWh3hbb2s22dB6WydHn15mu8u7mMO1 8xBbXHxbRZmFXP5y3CV4pHpt0MPycn8SbcxahMoLHnhpFRQkLqGn5XzYyhFRC8N8m2Wk KItYYPtNrYMxiSoEyFk/4cxmCOQ0eQoqfllAQBynyv5OpDO4/x98HAzYmVKwcgvFIjPS lV6xZfyH+TW+wVOrnPE+U18irxyThdJTg1usk374FlxJQ/bcWJ3is8Gcp91qT4ffBaXY 0Iuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wGWQsodsPCEvTet53bPj88p4jYhZ/d++dMltkcbaEYI=; b=Vnhzk3WCyxhFGKTD2kkKcTd1joc6W3il2yVzQaF+pEF2SjHk+wTKGhEIQkGRMMoMnD bQ57VxswqHvqUgk4I3LnMy9QFhxe0tfsYgTPnaQntknMf4Pxy0UEHaLnKLvHOqQoDXAD 7vebOzh2FYtYPxNyWTEVeqm+RThvUTaVK2Uo/riFEHkt9PNN0XNMaN75lB53MUFyeauh CBFb4mN77eozMBCg3jOrGJ+bBTbrzXx/GnMurjNzm+rsrmkyhgaJ3b5x4RqLALy8YBCK 0BM8accF8OYGUPzy/KdrT8mGPB6tPrAM/q7aXeg29ES/qekxn8jiNql83cWSo8ObhxeI KWFQ== X-Gm-Message-State: AOAM5316VYovy/GI6hcjgVIAxIPY0BNaQlmtN1rvJqtiI65PaUQXQpAE ZL44m9m7IxLYFLcZK/Gtuxng1gLW+6Iudf5GMq8= X-Received: by 2002:a05:6512:31cc:b0:471:d125:162c with SMTP id j12-20020a05651231cc00b00471d125162cmr2737873lfe.96.1650624357838; Fri, 22 Apr 2022 03:45:57 -0700 (PDT) MIME-Version: 1.0 References: <20220418043735.11441-1-patrick.wang.shcn@gmail.com> <20220418143404.55c8fcab@gandalf.local.home> <20220420114454.69ab108c@gandalf.local.home> <20220420122633.55d4ff6b@gandalf.local.home> <20220421085047.2cb8edf9@gandalf.local.home> In-Reply-To: <20220421085047.2cb8edf9@gandalf.local.home> From: patrick wang Date: Fri, 22 Apr 2022 18:45:46 +0800 Message-ID: Subject: Re: [PATCH] rcu: ftrace: avoid tracing a few functions executed in multi_cpu_stop() To: Steven Rostedt Cc: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 21, 2022 at 8:50 PM Steven Rostedt wrote: > > On Thu, 21 Apr 2022 19:36:06 +0800 > patrick wang wrote: > > > On Thu, Apr 21, 2022 at 12:26 AM Steven Rostedt wrote: > > > > > > On Wed, 20 Apr 2022 11:44:54 -0400 > > > Steven Rostedt wrote: > > > > > > > > > Interesting. On x86 when we used stop machine[*] it was not an issue to > > > modify the code that is being executed in stop machine. I'm curious to > > > exactly what the issue is if something does get traced in the stop machine > > > processing. Why does it crash? > > > > I looked up the commit history. When x86 turned to breakpoints, stop > > machine's state machine loop had no calls during waiting. So there > > was no function being called during modifying code. Which means > > there were no other cpus would load those instructions to be updated > > in this period. While the stop machine currently will call other functions > > and the call chain is fairly deep. So it may not quite be suitable for ftrace > > now because it can not make sure the instructions within its own call > > chain are updated atomically. > > Are you saying that the RISC-V stop machine implementation has code being > called on the other CPUs while they wait? > Yes, and not just RISC-V. It's arch-independent. It's the internal change of stop machine implementation. ---------------------------------------------------------------- Former stop machine wait loop: do { cpu_relax(); => macro ... } while (curstate != STOPMACHINE_EXIT); ----------------------------------------------------------------- Current stop machine wait loop: do { stop_machine_yield(cpumask); => function (notraced) ... touch_nmi_watchdog(); => function (notraced, inside calls also notraced) ... rcu_momentary_dyntick_idle(); => function (notraced, inside calls traced) } while (curstate != MULTI_STOP_EXIT); ------------------------------------------------------------------ Thanks, Patrick