From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBE49C433EF for ; Thu, 14 Jul 2022 11:47:21 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LkCQc0SMFz3cdH for ; Thu, 14 Jul 2022 21:47:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=sMwnU3qb; dkim=fail reason="signature verification failed" header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=EAOmilPM; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=193.142.43.55; helo=galois.linutronix.de; envelope-from=john.ogness@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=sMwnU3qb; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=EAOmilPM; dkim-atps=neutral X-Greylist: delayed 8496 seconds by postgrey-1.36 at boromir; Thu, 14 Jul 2022 21:46:43 AEST Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LkCPv3TCPz30D0 for ; Thu, 14 Jul 2022 21:46:43 +1000 (AEST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1657799198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XN6FukeOkgwZ5eOLCbkFNEc5JFvPVvJVxrDFWQ+otX8=; b=sMwnU3qbV+b8Wv2npTUlOowTXHkY1kWpGzJfAqV4YVCJxANkFKt2Si4xHbZdVHZmuQ8oNd 0x/jdFnyZincBOLrzM1oqLSJBHgn1DYRWvk7MCje7WFxNFhMjYBOPe2JkfTfO4bFmPBP93 H92QNpoVphfL8nB7nJSC06WTQrcnw51Xto2dctxivEN+iqpNKo9LyeD+O4Fwr/6fa9FGSP KOEMf+e1sWH0jpaQ1xDrvs7pvx/gL/1BTqEPlb7aXuoeQkxN9slCWb9gH+VAmqWfjpji0K ENKsk3azHFWeIvxULM6tLdAjLSDP0Rr8cMblLbJk5Hkn+h+qmYSb5EvKusB8aA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1657799198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XN6FukeOkgwZ5eOLCbkFNEc5JFvPVvJVxrDFWQ+otX8=; b=EAOmilPMjV1ZoGyEoz8L/+yBYppgRVe56A9R2WG/mK2JtxNdpcOdFw9/KgUqfs0QaPEN2A ZlsaAKbdwL/2b0Bw== To: Zhouyi Zhou Subject: Re: [PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog In-Reply-To: References: <20220714013131.12648-1-zhouzhouyi@gmail.com> <87tu7k6o7n.fsf@jogness.linutronix.de> Date: Thu, 14 Jul 2022 13:52:37 +0206 Message-ID: <87pmi77w82.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pmladek@suse.com, "Paul E. McKenney" , rcu , linux-kernel , Nicholas Piggin , Julia.Lawall@inria.fr, paulus@samba.org, lance@osuosl.org, ldufour@linux.ibm.com, linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 2022-07-14, Zhouyi Zhou wrote: > Thank John for correcting me ;-) After looking more closely, I do not think disabling migration is the correct fix either. The per-cpu variable @wd_timer_tb is written from 2 functions: - watchdog_timer_interrupt() <-- irq handler - arch_touch_nmi_watchdog() <-- called from preemptible Since watchdog_timer_interrupt() is called from irq context, I expect that interrupts need to be disabled for the update in arch_touch_nmi_watchdog(). Perhaps a using a per-cpu local_lock_t with local_lock_irqsave() to protect write access to @wd_timer_tb? John Ogness From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3649C433EF for ; Thu, 14 Jul 2022 11:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238213AbiGNLql (ORCPT ); Thu, 14 Jul 2022 07:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiGNLqk (ORCPT ); Thu, 14 Jul 2022 07:46:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E428A5A44B; Thu, 14 Jul 2022 04:46:39 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1657799198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XN6FukeOkgwZ5eOLCbkFNEc5JFvPVvJVxrDFWQ+otX8=; b=sMwnU3qbV+b8Wv2npTUlOowTXHkY1kWpGzJfAqV4YVCJxANkFKt2Si4xHbZdVHZmuQ8oNd 0x/jdFnyZincBOLrzM1oqLSJBHgn1DYRWvk7MCje7WFxNFhMjYBOPe2JkfTfO4bFmPBP93 H92QNpoVphfL8nB7nJSC06WTQrcnw51Xto2dctxivEN+iqpNKo9LyeD+O4Fwr/6fa9FGSP KOEMf+e1sWH0jpaQ1xDrvs7pvx/gL/1BTqEPlb7aXuoeQkxN9slCWb9gH+VAmqWfjpji0K ENKsk3azHFWeIvxULM6tLdAjLSDP0Rr8cMblLbJk5Hkn+h+qmYSb5EvKusB8aA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1657799198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XN6FukeOkgwZ5eOLCbkFNEc5JFvPVvJVxrDFWQ+otX8=; b=EAOmilPMjV1ZoGyEoz8L/+yBYppgRVe56A9R2WG/mK2JtxNdpcOdFw9/KgUqfs0QaPEN2A ZlsaAKbdwL/2b0Bw== To: Zhouyi Zhou Cc: Michael Ellerman , Benjamin Herrenschmidt , paulus@samba.org, Nicholas Piggin , ldufour@linux.ibm.com, pmladek@suse.com, Julia.Lawall@inria.fr, linuxppc-dev , linux-kernel , lance@osuosl.org, "Paul E. McKenney" , rcu Subject: Re: [PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog In-Reply-To: References: <20220714013131.12648-1-zhouzhouyi@gmail.com> <87tu7k6o7n.fsf@jogness.linutronix.de> Date: Thu, 14 Jul 2022 13:52:37 +0206 Message-ID: <87pmi77w82.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org On 2022-07-14, Zhouyi Zhou wrote: > Thank John for correcting me ;-) After looking more closely, I do not think disabling migration is the correct fix either. The per-cpu variable @wd_timer_tb is written from 2 functions: - watchdog_timer_interrupt() <-- irq handler - arch_touch_nmi_watchdog() <-- called from preemptible Since watchdog_timer_interrupt() is called from irq context, I expect that interrupts need to be disabled for the update in arch_touch_nmi_watchdog(). Perhaps a using a per-cpu local_lock_t with local_lock_irqsave() to protect write access to @wd_timer_tb? John Ogness