Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp348476lqp; Tue, 11 Jun 2024 06:32:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXapERnzEdTA6voA/kT3cz/+Xr2EfP+1mxo/cuGJiC8r56d6DbOj2eOmGL2K5TRyOqv40cpS5tBDWPtB+DZkoFWo/NFRK/CyPyBwdvjqg== X-Google-Smtp-Source: AGHT+IHD8EwX57phZHPyTiM/h02bl2wyBA8oJ8aUc7jL9kqCXZ/MzU+lbQLEADlGw4LKOpCnMY72 X-Received: by 2002:a05:6a20:da81:b0:1b6:dc44:8211 with SMTP id adf61e73a8af0-1b86bbacdf6mr3730838637.1.1718112739126; Tue, 11 Jun 2024 06:32:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718112739; cv=pass; d=google.com; s=arc-20160816; b=a2hH+KxiiaJdtJHcJ4hepPz9GQpy0V7TeOF47Wasv/7IoEDZ4lH8MEzb3MMFggYDa0 VcMApdIAP3uVv14W8SzthuIRZZHA1ldaQIvpcf76eGOT9gUyb0iPUoZY6MJKG+FiNZor pFvqdE8WrmcT6eTeoP4B69xdHSl6wo5ppUl46l7AVOrXHysTU/9LJnArL2dWZnoMqsxd AFMaX/4OCII8AAy8ogZTIBIJ2lu/R1e1PiD1mYPmrWTRSkw4b1HuzCtiJo5CZpeGqjKS QsLHtgaoP6dzahkwd/Vf5m6YR5bqmtcYdUEle4Nlv4fDEayn0Cs4E3Qhkod7WMD95feZ cX3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=o0DqNIZ2fkLo6z8QESOonTasJoXWxjg6TNbDof5tmJA=; fh=ofBxID1P5Hr4A1i3ohhwmpe5RLx3jHU6kQfYaNgQj4c=; b=C2sGnvrhNyIEWGvjF6vunJfbpOICV2mvR9vPB7qvEKNIDH2yB3ot9vHHraHNiXXSny LFvNQF3u9AKwWYXIxsDVq2UEGJ7904T0MlorKtekkFwM9ek442x5EAhApjaN0c0Pwztj 2Vy/BraAF5W+yqOKf5T+EOdL1FDs5nwx3fX8ySqPYIVFh8oOd9cpCDtorx55tU0oYqg+ 1z25kTb70tvL+oGYfSgp46MSzY8DPDBBC7xGq4T7XfYQaqy68ZoSCOrml4CmCB1JqhJ6 ICc065Pxbb7wIxBSEqHTkmv840vICXdk0nPYaNZQyFQkSmGni7lhkbqYRTZRCAdoZm2f zKrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SQesdpJe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-209924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd56c545si6378515b3a.345.2024.06.11.06.32.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:32:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SQesdpJe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-209924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E07D6B26183 for ; Tue, 11 Jun 2024 13:20:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F45A17C9F5; Tue, 11 Jun 2024 13:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SQesdpJe" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 5D1B41E49E; Tue, 11 Jun 2024 13:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718112003; cv=none; b=iRf/sPFH7NVaAJyHGKrExZuffYIjgeXHSl5MvrhIKdM6CXb2lnhfHuGIJ8ihBihqhxZngTLlBNBQbQoTrWq/nzrXnioqfzTSUPn6GckOVkEhWTherhX6a+DpRDL4CQWXsm9TjT4MY+R1o/SYgcqFT90od/OZWQ32gtbuc4Vv6pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718112003; c=relaxed/simple; bh=sdPLfiowNbYg6TIhZYX/HLOnceUJA2pderFfCXtAaeM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u8VNcoHgE4qBAzxMY7V86Vtam6UhR/tO/iM3nota30C8v/pZDv2TqH9eMpg9VSNSJaCKQ376XWzBXxkQYsAJpDod2o98TbXAyVmjxKB+WxK6GIqYrke3+OR4J1d4xTwJI9YdA3FIEJnmBIWsllO4NeEwPoxlpZtU/bVLn15v9+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SQesdpJe; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2c327a0d4c9so880910a91.1; Tue, 11 Jun 2024 06:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718112001; x=1718716801; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=o0DqNIZ2fkLo6z8QESOonTasJoXWxjg6TNbDof5tmJA=; b=SQesdpJe9KRKeRITSrcNLSevjGAlNZ8pV5KsdkmnMpUJj6DoBwGET78wQVyDSt+rTF MwxAwG5z1io1U9GWq5ZPb83/Rmq4ZoYNlIAYWSKq7KsgBRvTbBf8gP6X+Nxyiqvwrtco 8f4yxi0zxxECVBU6YziSlsq3ikLX1faot8wnvyYvnDm2O68nU1vmkaKloT6dSaEok/X6 IedNnCB1vXlkv7XmZI0ZM7aPinT4gjxpjJeYheGG0RyoETfxJYalOoWdA0SHFn47CWu4 umqGvgqIKvtryl1/dEGTAmO/IfmLtxohVptQWnz3m//gU6GVTmF/SvsNL+d17XjsUBkq iHmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718112001; x=1718716801; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0DqNIZ2fkLo6z8QESOonTasJoXWxjg6TNbDof5tmJA=; b=UWEDezV8VyEUgx2SaiNhEW2Y1um3EYQz3msIn9/gc3jSWfSFZv6kVisy2kNGllp6ee ktVX5jInkjO6mnX0eYzcGK1Vp5wRNAhTZrU8zD2diOA4MVR1BnkaV0jF6bJhMb12zURI 3RBUmxmoGBZTkDUzFnU8ukR7ICgk4a0rO8l0yF0khWM7DjykepEpp9dKCHshWkVq1IgU /T3b5LEsmsBCqOxM37I7BJMnXGzN7zWuNMW1d1/H0dDJAF55jpw52YrLpfZzY81McuTO c7+YAD+TBrfTpxMHUwbKeU7ZllJ05JIupkrL/4cd4bz7y7lR0il6JgAY27il1vwtHXV6 ootw== X-Forwarded-Encrypted: i=1; AJvYcCWmp2gLJBbAiHWI6MQ3l7Ripx029pLXo3UCb/T76+NGYP7CiUKgGN3IBPDxNOjqO8hwA4vBgc0oqfliImrJ/9JbSGhJ8lrwnq2hIcoYPtjLpNxiA/jzFUasgyJ2jVWFddvLPofb X-Gm-Message-State: AOJu0Yy7FDils2HuYOwd9f4QW2lHwKppKTN7/eI5o9uDKgz0JXv3xnyH /ovWmNmXll872exiRnNlMUVyam5APZddmgNZ7iZeoo24zo5QFw6X X-Received: by 2002:a17:90b:19d2:b0:2c3:2f5a:17d4 with SMTP id 98e67ed59e1d1-2c32f5a2ae7mr2962806a91.4.1718112001471; Tue, 11 Jun 2024 06:20:01 -0700 (PDT) Received: from iZj6chx1xj0e0buvshuecpZ ([47.75.1.235]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c304fe9622sm4536521a91.18.2024.06.11.06.19.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jun 2024 06:20:00 -0700 (PDT) Date: Tue, 11 Jun 2024 21:19:57 +0800 From: Peng Liu To: Thomas Gleixner , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, maz@kernel.org, iwtbavbm@gmail.com Subject: Re: [PATCH] genirq: Keep handle_nested_irq() from touching desc->threads_active Message-ID: <20240611131957.GA16967@iZj6chx1xj0e0buvshuecpZ> References: <20240609183046.GA14050@iZj6chx1xj0e0buvshuecpZ> <877cewwtbm.ffs@tglx> 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: <877cewwtbm.ffs@tglx> User-Agent: Mutt/1.9.4 (2018-02-28) On Mon, Jun 10, 2024 at 08:23:09PM +0200, Thomas Gleixner wrote: > On Mon, Jun 10 2024 at 02:30, Peng Liu wrote: > > handle_nested_irq() is supposed to be running inside the parent thread > > handler context. It per se has no dedicated kernel thread, thus shouldn't > > touch desc->threads_active. The parent kernel thread has already taken > > care of this. > > No it has not. The parent thread has marked itself in the parent threads > interrupt descriptor. > > How does that help synchronizing the nested interrupt, which has a > separate interrupt descriptor? Right, I never thought there would be more than one interrupt descriptors involved which is quite common. > > > Fixes: e2c12739ccf7 ("genirq: Prevent nested thread vs synchronize_hardirq() deadlock") > > Cc: stable@vger.kernel.org > > There is nothing to fix. > > > Signed-off-by: Peng Liu > > --- > > > > Despite of its correctness, I'm afraid the testing on my only PC can't > > cover the affected code path. So the patch may be totally -UNTESTED-. > > Which correctness? > > The change log of the commit you want to "fix" says: > > Remove the incorrect usage in the nested threaded interrupt case and > instead re-use the threads_active / wait_for_threads mechanism to > wait for nested threaded interrupts to complete. > > It's very clearly spelled out, no? Indeed, due to my ignorance, I never thought there might be more descriptors involved. Now think about it, I never really understood the meaning of the above change log. Thanks for your time and concise explanation. Peng > > Thanks, > > tglx