Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp525844rdd; Tue, 9 Jan 2024 11:07:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEZw/VXHyo99GmedzlzXFa4/Uoi/IxyGLXheoIbok0EQHzgKXtOEQLhD7Gf5zgfZrvGlqm X-Received: by 2002:a05:620a:5623:b0:783:2961:79f3 with SMTP id vv3-20020a05620a562300b00783296179f3mr2493384qkn.43.1704827264912; Tue, 09 Jan 2024 11:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704827264; cv=none; d=google.com; s=arc-20160816; b=EFF4WbneVEfLKREHmXmvH9xlLe7TtuVby8ZML/rEzVhflbqdrfzRa1MOJoQpy765B6 YTyGpbu7sU2gEUsV13yFWW7JfKRt7K+0ln/sc5YYrRmxddR7etAFjtIrFr0kMdk1AQBm Lb9/Bsp5gjYZfrfKevCAIlX07vVIcv0s1F72TmaRWaTM/lTjC50OLHN2+WltmlxGWkhi 0TduEhsLryc1tus918/ebcShASrhA8gcTDk739VvG9Fk7Ui06l4WM5U1OUCYnckuaZRn UG6zPmwfPPWFtfuNAgC6klWPaXKgbJoIOWT4CoQ/eubyH4TH/Hyo6NrPP/ntfSkYWOA1 jUFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=T6Y5Pivt04re+kyCcX8pYnqFE68KW6gWjSJ3l4BNUsE=; fh=FA7A0865cMYlSXAtAb94OayD9BkjOW6QqbpHjHM3rbg=; b=JikLcGjHzMdeDCduPWWNG//HHCfe6oMf4nifdqpqNBjsLlv3QZxzk8q3KrqAj+cMvP +peA9/A417CGGP0vo8Q9ptIJ4ZKr6sZ0GTtG8mmdwT5HVwZCG4Y13s75mrYsADEcRXp5 G97L2Fgbnajt1GGV+z0R9ugKWl+GMvPb5VPRgvY9GbCVl0KBs0RsDMqN+AXwnFlwdqBi pNJK+G4/Nfk0YMmE3gL5KyDXumgfPhRmU7is/Dwrq/9yunuccAlsUE2UvAY11bafLb2j WQkrbGW6pUYJRqH4Z2RVFAjBhCq7MG2odQtfrX+qZxjzs/+JIVAa9BRREJivqAOaFt/q ZK6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=PxwLKX2O; spf=pass (google.com: domain of linux-kernel+bounces-21291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k11-20020a05620a07eb00b0078156a6a506si2562403qkk.157.2024.01.09.11.07.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 11:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=PxwLKX2O; spf=pass (google.com: domain of linux-kernel+bounces-21291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A77551C24CC8 for ; Tue, 9 Jan 2024 19:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34C1D3D0BD; Tue, 9 Jan 2024 19:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PxwLKX2O" Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C37839FC5; Tue, 9 Jan 2024 19:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3bbc648bed4so3140314b6e.3; Tue, 09 Jan 2024 11:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704827256; x=1705432056; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=vktayxzef92MMwztklBgwneA0iC/Pngrp/gUTyKh1oo=; b=PxwLKX2OAtegdREnedq01DCxdcW3gKX6q26Fi2X0IiFpyCjg7YkPPRHwH0HTYF4GyQ yMTU3DsfQt+nzXi/XWRG/fjeex5PnBsRIonmSDkt3A80GAtad/UI/TM3PvCYsap5u5Qx otKGrn4Wi91cGbHo0uzQMTz4wzsg5x4GeQOXbDEA/ansuQbkjAY0qz7sMXrUpZRb66zq HUPfmgtwjLuJzxJMgPrYbqwQPorKXtdMYzVEfjrbETKSyRwecdUsGQ3qG7bSZ2oXpp0V YZt3IPo8HQGwTORz6YRrBTEcIEBqi8aKJpXPClQ0DWwI+z589LtjKlh9CWDBHfy7BXDS cPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704827256; x=1705432056; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vktayxzef92MMwztklBgwneA0iC/Pngrp/gUTyKh1oo=; b=SdKtZOm0SehSboxY0p7J/kmDJkkszKe3dMKJJK/X3JEWMSm3u0wDtF4TMN7rRibo0B 6Z2ZsrvisUrWY1f+xKHDrNkt/Usrjw3ny/ob4G8WyN8gHIfvuFu27xtwgizRKeuexFsR Ry2fYLtJR6IIKEISu/WI/7Tx/UXL+UpuujRx8NEtJAxQrfxapAhwXgvBpNj2y3x0jC39 CCSr2DL9S4voRen8uBNnwWB8f/nYDyE8JnHTeO5jGptnNearRCmdTns9I0cwP4x2sHjT JVsVZKnGb7D/VD7P08fL8dU4lL/ZAXwzbmABfBci4aOt9/Jqa1kyUXo+9E1yYHjTGssn RcKw== X-Gm-Message-State: AOJu0YzVIEaZJdp6Zl8vu9NDqAoZamU3qh5SWa3T1COIEc0yu2eV/p5S rFpQFBZLp/vHGbHBSJgu8GY= X-Received: by 2002:a05:6358:71c3:b0:175:7748:bf65 with SMTP id u3-20020a05635871c300b001757748bf65mr5486553rwu.37.1704827255977; Tue, 09 Jan 2024 11:07:35 -0800 (PST) Received: from localhost ([2620:10d:c090:400::4:fd50]) by smtp.gmail.com with ESMTPSA id n41-20020a056a000d6900b006d9c1fb00c3sm2037702pfv.9.2024.01.09.11.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 11:07:35 -0800 (PST) Sender: Tejun Heo Date: Tue, 9 Jan 2024 09:07:34 -1000 From: Tejun Heo To: Andrea Righi Cc: Geert Uytterhoeven , Greg Kroah-Hartman , Alexei Starovoitov , linux-kernel@vger.kernel.org, Linux-Renesas Subject: Re: [PATCH] kernfs: convert kernfs_idr_lock to an irq safe raw spinlock Message-ID: References: <20231229074916.53547-1-andrea.righi@canonical.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 09, 2024 at 06:05:09PM +0100, Andrea Righi wrote: > On Tue, Jan 09, 2024 at 05:35:36PM +0100, Geert Uytterhoeven wrote: > > Reverting commit c312828c37a72fe2 fixes that. > > I have seen this issue on several Renesas arm32 and arm64 platforms. > > > > Also, I am wondering if the issue fixed by commit c312828c37a72fe2 > > can still be reproduced on v6.7-rc5 or later? > > Yep, I can still reproduce it (this is with v6.7): .. > I'm wondering if using a regular spinlock instead of a raw spinlock > could be a reasonable compromise. I don't think that'd work on RT as we can end up nesting mutex inside a raw spinlock. > We have a GFP_ATOMIC allocation in __kernfs_new_node(): > > raw_spin_lock_irqsave(&kernfs_idr_lock, irqflags); > ret = idr_alloc_cyclic(&root->ino_idr, kn, 1, 0, GFP_ATOMIC); > ... > raw_spin_unlock_irqrestore(&kernfs_idr_lock, irqflags); > > That should become valid using a > spin_lock_irqsave/spin_unlock_irqrestore(), right? Yeah, this part should be fine. I think the right thing to do here is making the idr RCU safe so that lookup path doesn't depend on the lock. Greg, can you please revert c312828c37a72fe2 for now? Thanks. -- tejun