Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5211131rwb; Mon, 21 Nov 2022 18:45:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sdWBx4Q+GNT0w/XjQoi021t75Fl3X6zR53xhUh09uwmm4jEiCJP8hMB2gDghhBEm0xV4c X-Received: by 2002:a17:902:e849:b0:186:dd96:ce45 with SMTP id t9-20020a170902e84900b00186dd96ce45mr2114081plg.73.1669085159563; Mon, 21 Nov 2022 18:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669085159; cv=none; d=google.com; s=arc-20160816; b=XaNGh5eL9+wYfNkwbrWmJp+It5JVISnR5wnE31L1Y9YztS5PiIFASTqklxM0LYk5nK vOyhVyJC9ccGwYPNWMjNPmeV+TWh6Km7tSegB8bv2dHbJcQfvMsLSrGmJql9Cdj4i5II TwT5EKfS9SQCks295HHQgPdaQ1JPgBS9GP5hA5LUk5jG1LMcZqFiX2YjcdIe8FlR3Vfs neSoeOtTC351swOxV9hQqxUXtGW3+q8DU/tTIUU0Eyf7EORJEyJPvOsMBuD5WD545PRL 3xcrgBOh0Lohnxgti+JljOdQmboiDgWefK16WuBOZPydTDtKSQ0tikdTukpDd7Vse4Os ODlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ipvlEWLVcseEXRvRfHEM9M98T6Rtc0U4LfZnodoKNls=; b=Z79UIE8pVmkyrR/XaqCyMMbfPEkEbAENVMzkbLChWNM5leFLv9kPbJBtZrt494Lpgi BmXHEsRUjS8I2QBasez8BL5DopN6F+wbtkQkFGXyHOSYxtyA6cu9nlBRG6F5avqXIb1u pgKfXEhvsbN0chG3eT0xhZ+QsUrseL1+itlP2t8oohBtdYdVGOwFMcCKYJu7Ja9Goh5m 1I251kHfkwbrUuFVHOaRa5iYsjyrgxAxwbXe/OC7LjKSXohpGtPOkUeZwTa6eLYm2gWZ WaQT9naHqrcrsAD2dk0M+RXOryYzjCMFbxlU6KpdkYnjow8k79RVV+iIU1/cCdr7mnSO 4/5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fjf9nZI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a056a00150200b0054d5253e7d7si12937837pfu.190.2022.11.21.18.45.44; Mon, 21 Nov 2022 18:45:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fjf9nZI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231512AbiKVChx (ORCPT + 91 others); Mon, 21 Nov 2022 21:37:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbiKVChu (ORCPT ); Mon, 21 Nov 2022 21:37:50 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA7AB10FD4 for ; Mon, 21 Nov 2022 18:37:48 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id 4so12352113pli.0 for ; Mon, 21 Nov 2022 18:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ipvlEWLVcseEXRvRfHEM9M98T6Rtc0U4LfZnodoKNls=; b=fjf9nZI1QoWNWZNM9Whtved1l5bqjqOjppbQ0nMxgofDCcaUZZ7WRQPcbNWogA5ILH txglhsFMwIcOejgB660t2AKFoi5XrlnggJgl0I0bdt8LoTrzqIZkfL4I0LlTO5Yzj61J t0K7gfvcGeUL2ep+rrxgKTRGa5nQRRUm2iIvD7H7ps+hzUv6/YuSX+mjWFqweWhbeOoD u6hBANmxTsPYRBg13beoyFDFsnMYpnPAMtk3Hh6x5J65TvH6kQa17eWlY6X8CZ8ONhvm ZmGkBx4SzyLmCeYgi8E6q8OVfqzsowMVQOuITsEH/2fAb6VntFs4UE/nWp2nTDgRKpGE rLkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ipvlEWLVcseEXRvRfHEM9M98T6Rtc0U4LfZnodoKNls=; b=ptDDWjEJcOcJxlvlPPrIjhmDrcXnWWu//BeDxXz0BZRaJDTkCCiI2j/yCuFf1Ueiau as2/3yRWfCfR3lGvjWhxLtzgN2zmYbQDEeLDjwPXM6tAx+DlCyIXvmuAwx9v/q75obGH hU8WGHAz1pI8jL3HFRD7qDVWnoE3ALCkUgWJ+ZMKexu82xmWA7Lji7iZ9UhUAPQAp6wj dnlFdjzm7KDC0rCHcI9go3RzivfQETNG6JhJQmhe4zI3fU980gMbOX+zRwndBITX6gNG rPkCIwQwf/9G0njYO9EJjuFPEJMDJ4OJy56Rfz3VWa+3kLXjFP9el6vbhJQKQXTbn56+ 9rvQ== X-Gm-Message-State: ANoB5plZqEKhsxQg9D58tCRffhZqgm2IxI1fBMKs8a5uuyF4fXWQy52x HljGOIvWYJAzGbQHjIhs0lqC7m/3jwzaVmF/HiJnkAy9s/k= X-Received: by 2002:a17:90a:7e87:b0:212:f810:a846 with SMTP id j7-20020a17090a7e8700b00212f810a846mr30299919pjl.71.1669084668261; Mon, 21 Nov 2022 18:37:48 -0800 (PST) MIME-Version: 1.0 References: <20221026132039.2236233-1-suagrfillet@gmail.com> <20221121213402.154adf09@rorschach.local.home> In-Reply-To: <20221121213402.154adf09@rorschach.local.home> From: Song Shuai Date: Tue, 22 Nov 2022 02:37:37 +0000 Message-ID: Subject: Re: [PATCH] ftrace: avoid replacing the list func with itself To: Steven Rostedt Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Steven Rostedt =E4=BA=8E2022=E5=B9=B411=E6=9C=8822=E6= =97=A5=E5=91=A8=E4=BA=8C 02:34=E5=86=99=E9=81=93=EF=BC=9A > > On Tue, 22 Nov 2022 02:28:25 +0000 > Song Shuai wrote: > > > Song Shuai =E4=BA=8E2022=E5=B9=B410=E6=9C=8826= =E6=97=A5=E5=91=A8=E4=B8=89 13:20=E5=86=99=E9=81=93=EF=BC=9A > > > > > > The list func (ftrace_ops_list_func) will be patched first > > > before the transition between old and new calls are set, > > > which fixed the race described in this commit `59338f75`. > > > > > > While ftrace_trace_function changes from the list func to a > > > ftrace_ops func, like unregistering the klp_ops to leave the only > > > global_ops in ftrace_ops_list, the ftrace_[regs]_call will be > > > replaced with the list func although it already exists. So there > > > should be a condition to avoid this. > > > > > > This patch backups saved_ftrace_func by saved_ftrace_func_old > > > which will be compared with the list func before trying to patch it. > > > > > Ping... > > Thanks for the ping. I had thought I had replied to this, but I don't > see it in my sent folder. I may have been distracted, and lost the > message. > > I'll take a look at it tomorrow. > > -- Steve No problem, thanks! -- Song