Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp180264rwi; Sun, 9 Oct 2022 21:13:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sXVDALUatNhHMs27TwJg4ur09p7NiLRWsRfrPzOSrlTxs5c5yuHCE66Hhu0twy/iDsXpZ X-Received: by 2002:a63:ef18:0:b0:439:befc:d89c with SMTP id u24-20020a63ef18000000b00439befcd89cmr14541945pgh.504.1665375183765; Sun, 09 Oct 2022 21:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665375183; cv=none; d=google.com; s=arc-20160816; b=s132j+klSaxZkwdegud2jvTzNSAL/fYVxUrv+8i/Qpm96bJPzk47hziX2D6xa/BElg UescG+ApUJ76F4rjNopfklsoxd6xMUs6+yjQ2uzRTd1lvy+unl5R35jageKqEZlj6MFM 2DOWqyWTDsjuFW7PpS/1XeQyCPbJZFY+iI2ayCpFG9dkE5z4jNWMEgmrk7exMdVtUZZV uDnTIohav3V7asbqWU2UiNISi9Kuinj7UtJwgMjYd6BZADFyQdm5X9sISMH7z7UzBdls LeyMcl/q0YaVCHREj3s5KbrqrNgPRIwIaX20zEZ6NE+I9shw2Im/T2nlQyj6ORzKDvbd 3Slw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:subject:cc:to:from :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=J5uwdgwryFHFJzjWiH++bUzGyJn8a2qBYOFkqPQdUjA=; b=jnQ3alQKtrIZPGtzpMUiZC3ycT5MdkD2Gv5cQBaxXDQFNbbjoAEod5zWb9C4Xynz4q aEdllprftHWSswHZzuTNU9orNGnHQJ8cJHACKYCwRBeXwz+vCK5IxHKjGy4BUvGM/PbX A/fMMFcPkHsDkJX1brKUwciBNFbvY/ww/KV6LDYivvA6t26FaXN4s6gdpjAsj0dqWhks EeZzuSCgwyyflJ04DuCELBbwO1C0RqMWcYNZI2A0E/jSEgri9Ga0vpj/So+PXq14Il23 oqDWbhDqmOI3vRyb41drutcOe6eLM2KyTaKdbWLpPDodK+ZZQ1ThYKdd9hcmRi4wExbY Owfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JiFdjcQk; 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 35-20020a630a23000000b0043be9997ac1si10370386pgk.398.2022.10.09.21.12.51; Sun, 09 Oct 2022 21:13:03 -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=@gmail.com header.s=20210112 header.b=JiFdjcQk; 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 S230344AbiJJDt3 (ORCPT + 99 others); Sun, 9 Oct 2022 23:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiJJDt0 (ORCPT ); Sun, 9 Oct 2022 23:49:26 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773D73DF2C; Sun, 9 Oct 2022 20:49:25 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id g8-20020a17090a128800b0020c79f987ceso4213078pja.5; Sun, 09 Oct 2022 20:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=J5uwdgwryFHFJzjWiH++bUzGyJn8a2qBYOFkqPQdUjA=; b=JiFdjcQkZ722P7s3iZCsJihWdE0H8Hb1Xp9mToLMy6UTMLVa1tCTeAPRwv7fmvPIq+ 8rvkFwCUxFcrDK+3fTfvaFaZAMEyltqjrDVz/PytWUer59eQV1Yyqgh50XgVXauL7Vog oGJr3dns0VUrublr5DdF0JtWb3Ga6TwT8XaZFY25dQ9QbyH1CVyrfzOBtJ3dDtFi+6bM 4FaBnTDKc+z1tQ7omh/CnHGX6k/xaRAexHIyAFJH6zA+2/22JywqrL2DD4ZlGMSFimKp eCkRhSDSC5gVtOsYw2u/w2UPJ3VttbeIgjRY1oFln+qveMnci4poe3khwXzntilyOBUx hiNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=J5uwdgwryFHFJzjWiH++bUzGyJn8a2qBYOFkqPQdUjA=; b=45XozZTSMTEGkmOhU8g7c2tFeJQx5G/A8ipc9WJu8r8Y1jW8NMClXXeJ22mNWDuBaB gR0xLLD8tG/hsPVmQHu/xqjUhu/CU/utendLtFacxwGytYiIa2iZm5/0WvQMXdpYI6j/ tY7Tj7VsIPx5o3H1b5biuaoT8HlSYo0OWM5e3HCZ+YF44tWZXHapzH3K6ruc4tj5ONqw BCTl01tp38E3fvI81ZL4M9iraDbC3jztPJ9gVGKNC3Ech4/kML9zwVlAU6H1v7tx6PVg SGDxQbli+EK9eTCsft7AVJf938wT2Ynl6Z5M+LBOUB3lmt8obOAWlQhtHeuRCpP2ZIE0 b/vA== X-Gm-Message-State: ACrzQf3zcXVxzp72o6a1BsbtYWYwzSMm2OSzFaI96Fty6gW2nWyceUoq uTF5fsV9MhHuYy72ivtPZgI= X-Received: by 2002:a17:902:7084:b0:181:5304:fef4 with SMTP id z4-20020a170902708400b001815304fef4mr8742887plk.57.1665373764964; Sun, 09 Oct 2022 20:49:24 -0700 (PDT) Received: from localhost ([118.208.156.99]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b001788ccecbf5sm5468419plf.31.2022.10.09.20.49.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 20:49:24 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 10 Oct 2022 13:49:18 +1000 Message-Id: From: "Nicholas Piggin" To: "Zhouyi Zhou" Cc: , , , , , , , Subject: Re: [PATCH linux-next][RFC] powerpc: avoid lockdep when we are offline X-Mailer: aerc 0.11.0 References: <20220927014823.11439-1-zhouzhouyi@gmail.com> In-Reply-To: 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 On Thu Sep 29, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote: > On Wed, Sep 28, 2022 at 10:51 AM Nicholas Piggin wrot= e: > > > > On Wed Sep 28, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote: > > > Thank Nick for reviewing my patch > > > > > > On Tue, Sep 27, 2022 at 12:25 PM Nicholas Piggin = wrote: > > > > > > > > On Tue Sep 27, 2022 at 11:48 AM AEST, Zhouyi Zhou wrote: > > > > > This is second version of my fix to PPC's "WARNING: suspicious R= CU usage", > > > > > I improved my fix under Paul E. McKenney's guidance: > > > > > Link: https://lore.kernel.org/lkml/20220914021528.15946-1-zhouzho= uyi@gmail.com/T/ > > > > > > > > > > During the cpu offlining, the sub functions of xive_teardown_cpu = will > > > > > call __lock_acquire when CONFIG_LOCKDEP=3Dy. The latter function = will > > > > > travel RCU protected list, so "WARNING: suspicious RCU usage" wil= l be > > > > > triggered. > > > > > > > > > > Avoid lockdep when we are offline. > > > > > > > > I don't see how this is safe. If RCU is no longer watching the CPU = then > > > > the memory it is accessing here could be concurrently freed. I thin= k the > > > > warning is valid. > > > Agree > > > > > > > > powerpc's problem is that cpuhp_report_idle_dead() is called before > > > > arch_cpu_idle_dead(), so it must not rely on any RCU protection the= re. > > > > I would say xive cleanup just needs to be done earlier. I wonder wh= y it > > > > is not done in __cpu_disable or thereabouts, that's where the inter= rupt > > > > controller is supposed to be stopped. > > > Yes, I learn flowing events sequence from kgdb debugging > > > __cpu_disable -> pseries_cpu_disable -> set_cpu_online(cpu, false) = =3D > > > leads to =3D> do_idle: if (cpu_is_offline(cpu) -> arch_cpu_idle_dead > > > so xive cleanup should be done in pseries_cpu_disable. > > > > It's a good catch and a reasonable approach to the problem. > Thank Nick for your encouragement ;-) > > > > > But as a beginner, I afraid that I am incompetent to do above > > > sophisticated work without error although I am very like to, > > > Could any expert do this for us? > > > > This will be difficult for anybody, it's tricky code. I'm not an > > expert at it. > > > > It looks like the interrupt controller disable split has been there > > since long before xive. I would try just move them together than see > > if that works. > Yes, I use "git blame" (I learned "git blame" from Paul E. McKenny ;-) > ) to see the same. > and anticipate your great works! I was thinking you could try it and see if it works and what you find. If you are interested and have time to look into it? Thanks, Nick