Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3588685pxp; Tue, 15 Mar 2022 01:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEpHt6URmJiKL7L2vymznIQRw4imJSbcZ89jqHP/xKKvOFyJREamY3v7DG6Vyv6EMMZktA X-Received: by 2002:a17:902:c745:b0:151:e8fa:629b with SMTP id q5-20020a170902c74500b00151e8fa629bmr27565899plq.90.1647333910783; Tue, 15 Mar 2022 01:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647333910; cv=none; d=google.com; s=arc-20160816; b=s7Rv7QxXnd0QvNtDZq3BcH5HTFqnyBuQC5yBLq2PYEMagkl7vaOhYJGJsv70php2MA APbMYmjK690yLZIvIm5Vccf2nv3GIO5/0AE+K4nXCTdTQOAR1Lq1HQ/MgBfG5whxSkf1 qEZCPz+Y15om3ZYisQgybs5N9xzQZvAyyiS6KYvFOKrpxUre4kF9Fkv3bTSiRZNHRYg8 VBN6HYnViJnRO2IocUF4ykElKUUMHEozH1OAHGmrQLjkkmqkfH9R7WtCDF+3CfftbuMd pdsFLZ3PkdeXOx+SqtuyzhTguHq1vQ19ojWEz55+H0iqVtUfkYw80Z7nZ8OtaIFHP+AQ kmhw== 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=HKCWhGhmgQNmyLZgMKhvVoJ0lGpQP56eu5b2uBtkPQw=; b=D1JsXsfY/0xsY2350wqXd2ArBs8S6NubsOqUOgSvuim36sxekMdSq4EBS8BIfT77Pt KPxDtxGJgdYU4beG7zi6gwFzU8JLc6Ol3kacmK3O7eVrW16oYORBplzXTe0WhjfTGOuF FmMoxK8iSZCoFTY1Lf2uYa2fB/3NK260vi7tO8bN17uzmslwO+16Gjry9wVZD5jYfVxB K7JyA02fkAqUJKUdlop5OIerhXeRE1ulQEdzC3j4+IHXvj5Np90lcp87NS1Ph+rzTKRv zacpQxkSMRwno0wYLEHQFv/EaqWxzhcmNCVQn4lJ5V+c+jkixBlf9kGdYLKIMgE3SQ2J yF8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EFca1hvn; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a17090ade1300b001bd267ef9c0si1436914pjv.1.2022.03.15.01.44.59; Tue, 15 Mar 2022 01:45:10 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=EFca1hvn; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231822AbiCMBME (ORCPT + 99 others); Sat, 12 Mar 2022 20:12:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbiCMBME (ORCPT ); Sat, 12 Mar 2022 20:12:04 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 511C21B1B90; Sat, 12 Mar 2022 17:10:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id 00C20B80123; Sun, 13 Mar 2022 01:10:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AA67C340F7; Sun, 13 Mar 2022 01:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647133854; bh=WDhHtMMzDFG5VodBhA9/54gjgFe39ayzZKWGkP/LDK8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EFca1hvnGz3TxyEY897vI/6ZNFT6rs20DC1fNngBrgeE9lUgBNlvvn4OzAllO62Dy AnoIQfGYtdHGjdZLZOiiS/+2KjusgXbkzKRbGW2/U9IIWsQW8UneYi3oVSlj6c/mCM weMaLrcVrEW03gGp+ILrQpWOZZAugfeJLhfy4fGs2lXdKhbZufgRLrRTwMmv3FyTti nctgTdqhBMeRYPIZHW9RHlAupLYncbE9S+wQgQATScA8yjFGUm3K+nHP+ToofV2ZXL 8l3v4vBtdcjq8QV6zjQTHPHU8s5EPGuVlnCULUKWKRNQ64nD6KlN2FP6Z3f/c0AXuu Akl3zOOApbbXA== Received: by mail-ua1-f47.google.com with SMTP id j7so5258193uap.5; Sat, 12 Mar 2022 17:10:54 -0800 (PST) X-Gm-Message-State: AOAM531tKKDi5d/Trao5+ijZq+PYtYWl4beU25Kbe8ESUJzqBFRIkbHm aFiHGx2TIsfSOfgfwtdC43rmp02F2CU+o8vrRjo= X-Received: by 2002:ab0:26d9:0:b0:34c:609d:c23 with SMTP id b25-20020ab026d9000000b0034c609d0c23mr3534202uap.84.1647133853508; Sat, 12 Mar 2022 17:10:53 -0800 (PST) MIME-Version: 1.0 References: <20220312155603.1752193-1-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Sun, 13 Mar 2022 09:10:42 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] arch: patch_text: Fixup last cpu should be master To: Max Filippov Cc: Linux ARM , LKML , linux-csky@vger.kernel.org, linux-riscv , "open list:TENSILICA XTENSA PORT (xtensa)" , Guo Ren , Will Deacon , Catalin Marinas , Palmer Dabbelt , Masami Hiramatsu , Chris Zankel , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sun, Mar 13, 2022 at 7:50 AM Max Filippov wrote: > > Hi Guo Ren, > > On Sat, Mar 12, 2022 at 7:56 AM wrote: > > > > From: Guo Ren > > > > These patch_text implementations are using stop_machine_cpuslocked > > infrastructure with atomic cpu_count. The origin idea is that when > > The original > > > the master CPU patch_text, others should wait for it. But current > > implementation is using the first CPU as master, which couldn't > > guarantee continue CPUs are waiting. This patch changes the last > > guarantee that remaining CPUs are waiting. > > > CPU as the master to solve the potaintial risk. > > potential > > > > > Signed-off-by: Guo Ren > > Signed-off-by: Guo Ren > > Cc: Will Deacon > > Cc: Catalin Marinas > > Cc: Palmer Dabbelt > > Cc: Peter Zijlstra > Cc: Masami Hiramatsu > > Cc: Chris Zankel > > Cc: Max Filippov > > Cc: Arnd Bergmann > > --- > > arch/arm64/kernel/patching.c | 4 ++-- > > arch/csky/kernel/probes/kprobes.c | 2 +- > > arch/riscv/kernel/patch.c | 2 +- > > arch/xtensa/kernel/jump_label.c | 2 +- > > 4 files changed, 5 insertions(+), 5 deletions(-) > > Reviewed-by: Max Filippov > > I'm curious, is there a specific issue that prompted this patch? No, theoretical risk. > > -- > Thanks. > -- Max -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/