Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp437633rdb; Thu, 1 Feb 2024 12:57:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/yu67nqilcoLkcnpaayv9mzpSfmJnVQsTq+oqMdaVgZnNfQ27SKWZXnvdjYiExVCgs9Cx X-Received: by 2002:ac8:5786:0:b0:42a:4e51:985f with SMTP id v6-20020ac85786000000b0042a4e51985fmr318979qta.31.1706821035789; Thu, 01 Feb 2024 12:57:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706821035; cv=pass; d=google.com; s=arc-20160816; b=z+SmYHREP/SxgnfiYX3i1SQfR7AAHzkuGf3ZtqxfLzdJ2LUebwohxOmJ12anjcMxRb vj52yZT3usGARDTzrmxZWkGg6FNRr65TQoyE9SMze3hgz7NdlWSMmkgGbFXHbgm7gHL6 GvkUq/c4Ic71UF4BfM3JfTmlh48TaAmpJkTAOAVOEpiBa1N2QlN8PeMkgqIxRggZS43A n91NHsr/B5pHqMpn79XPaF1mIAthiWEYNRIG/K1geMTlpNgfUeXDmQZapj07Z4JhlgY4 OTQ/pEm4NEyoaSnADIOtmiaiUVjVMn5pIOgjnq+AJVHnxb1WUPt9RkPgqvLIvmRcymNT iipg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=+FFXbp+1HAqiP5p0rle86MEwsAGG8Lke6vnUeB5b9fc=; fh=0LbQ5+YQE1f/i/ddntG2NOyMqtogPcep0YTwW/nfRqY=; b=nGrL2WE4BIV05NioelD1Lqwfzu+EuoiftHSlfNigpY5nsoXs2dyhKbzEvFG9ZtMvKB M3WMEZjodcwtmb809ZgwMQ66a6wWwmanK2dbeoMv4Bwi8pTDFJLF8T9FV6E8w/WRRy5H uZhJmqrBRVuyZ3dpOwuazTDlgDEjbIiBm0fyZ5FpF56VuAo7exnWjci8El8nPW8AMvKB U7eULBxMSdgYtt3U1F4db3UzfLvmx+mY6GLN+X37Hp44906xBlQTVAmnj3q8hRFaN3DJ +SwUgvriNgNKBRab3qOO7TOwJXS32Q3D4wi+gg/atsGAForx7aoCHhg2O9vFsqH9HZgD IPzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org X-Forwarded-Encrypted: i=1; AJvYcCUSKVvRw7nw7CCu3rj+oTIEh4zs+7zN4hs5vHeEg00HsW1FT6y4Mw8AqPOlSCy7HIx0SaeFTDQiKPQuvO8hiAHlbpN0VH7PRh4Rx9Qqvw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p20-20020a05622a049400b0042a8e216627si343896qtx.251.2024.02.01.12.57.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 12:57:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48835-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.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 88F1E1C247BE for ; Thu, 1 Feb 2024 20:57:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EFE83F8DE; Thu, 1 Feb 2024 20:56:41 +0000 (UTC) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 649E33F8CC for ; Thu, 1 Feb 2024 20:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706821000; cv=none; b=fJGvbMx002cJvzibaHTO+Bai3nTSBAHmFo7BdRfq3Oa7rHcPdfpOU5DxTxQc7+3ZfidoqOC+kdbvRv7MBUIT66Dr9UDosQpXy9uwL06tQKduhkzmiIXYZjPwXVZj64aG20SJIHcF9iqio5QZksu5Lna4QQAKcRHlJji3vzuNOUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706821000; c=relaxed/simple; bh=BfG5LbFqIJNFLtIFJevV6JP66mOxWEe5j6NZgrNC/Qc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BA/+U7vikvhB8Fv+Rjit8nx87Rt50w6RUXhzSeQClslVOBieffd/oDQVdDoEONbAiZzm3fLNU/LUvEqOYAigFqRlCJmXT+vsZ5A6xEwLq074LQn+zcRk5G//o+rzLtk6picTWLtA5//TGql/ymAa91e70FJwAhIklLuqmt+hjEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d928a8dee8so17627795ad.1 for ; Thu, 01 Feb 2024 12:56:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706820998; x=1707425798; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+FFXbp+1HAqiP5p0rle86MEwsAGG8Lke6vnUeB5b9fc=; b=cPAGgIbycfXoLKNIYP6ndpzq4XArWW4wgSLNAhELYaYrh6fPFESx07d+XEbXSqmKZ5 MO/qnFzlDZU4/VZToAgyag1g+OFHMm29U1PRQhX57YejeqmJQJYiwclebyOxFUeEAB74 X0hA5WwNqXsomwcXul1A8Y73spODaJe4RT3/4VYUegdUdwzgTOFJ0q2l5n+6TmQFP8oW zZKsDdlaP2+19QtJ0NZ6t63Nhoy31mF1v9D/In9LfjTGzE0tzDCaIn69PTmwNnhp06F9 WvqMFJ1cJFc26RY8RGIpjcVPt9H/KvytOnytTX16MQcf2Hdd3Wc/OTUdAjZhsWTo9R3e uKPg== X-Gm-Message-State: AOJu0Yxvt1XWyxQtZ3ZbyAzc+PaIsg6P4ZNEt1DlPbcTHznD+nceEGit 7IqD4lnUqZmwIlpeiwTpXPj6EUlv9qkpPDCYcrFfAs6hObw+UTnL X-Received: by 2002:a17:903:22d0:b0:1d7:1a90:65ba with SMTP id y16-20020a17090322d000b001d71a9065bamr293063plg.25.1706820998244; Thu, 01 Feb 2024 12:56:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUoniBvy1+ZujmmdDIIP10uEKowxeXFc8sHlTOvkushYAILIWjPBsidp9YbnAT6blpn3e/Vv6ezRGtMGbKlFHBZoGO5Uc1QdZb1MaRfdRXjQ5IL6dmgwSkaZVQQNOaBQ2bhk5Q26wpuWXwSdqJbNhGqBsbfeSO6Ohcj8nzBfta+58ch5b4NKie0yF7rxU2HxKEH2ndTjv8wkBNNRSd46WrTUDL2Mjv8ug3H7mzRe+tWh8uE0qSqScsVj/oBQKRF8HZuyoSWQQb+SU93C0aGQRYPwrtC2UZGqbtBkoJVDTTWHs0OaMnTWvxYXnTQaJTWTWU= Received: from ?IPV6:2620:0:1000:8411:170e:a1a5:1887:adb2? ([2620:0:1000:8411:170e:a1a5:1887:adb2]) by smtp.gmail.com with ESMTPSA id mm4-20020a1709030a0400b001d8dbb867b1sm237967plb.179.2024.02.01.12.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Feb 2024 12:56:37 -0800 (PST) Message-ID: Date: Thu, 1 Feb 2024 12:56:36 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] lockdep: fix deadlock issue between lockdep and rcu Content-Language: en-US To: Boqun Feng Cc: Zhiguo Niu , peterz@infradead.org, mingo@redhat.com, will@kernel.org, longman@redhat.com, linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com, ke.wang@unisoc.com, xuewen.yan@unisoc.com, Carlos Llamas References: <1705477714-10467-1-git-send-email-zhiguo.niu@unisoc.com> <2d1f4f16-6d66-4449-a7b7-5e2b2a4eaeb3@acm.org> From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/1/24 11:58, Boqun Feng wrote: > On Thu, Feb 01, 2024 at 09:22:20AM -0800, Bart Van Assche wrote: >> On 1/16/24 23:48, Zhiguo Niu wrote: >>> /* >>> - * If there's anything on the open list, close and start a new callback. >>> - */ >>> - call_rcu_zapped(delayed_free.pf + delayed_free.index); >>> + * If there's anything on the open list, close and start a new callback. >>> + */ >>> + if (need_callback) >>> + call_rcu(&delayed_free.rcu_head, free_zapped_rcu); >> >> The comment above the if-statement refers to the call_rcu_zapped() function >> while call_rcu_zapped() has been changed into call_rcu(). So the comment is >> now incorrect. >> >> Additionally, what guarantees that the above code won't be triggered >> concurrently from two different threads? As you may know calling call_rcu() >> twice before the callback has been started is not allowed. I think that can >> happen with the above code. > > No, it's synchronized by the delayed_free.schedule. Only one thread/CPU > can schedule at a time. Or am I missing something subtle? Only call_rcu_zapped() reads and modifies delayed_free.scheduled. Direct call_rcu() calls do neither read nor modify delayed_free.scheduled. Bart.