Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp44586lqp; Sat, 8 Jun 2024 05:44:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBTiSg5g+Gg8Tgbn0h39oo7AkJ5tCkynXL4HMIRF85THxMItwh8+hHvT096VLgefhrBqVDPa3VdharGA76O2OVRJnAYVW5nMI1RNQxhQ== X-Google-Smtp-Source: AGHT+IFIzR0ec3F7H+InUNK+opIrpb7VEcoJ8nj0A7B7IoTE8nvDZtixJXbet7Yr2Z/Xyi6hOhHE X-Received: by 2002:a05:6870:a104:b0:24c:5019:c1c6 with SMTP id 586e51a60fabf-254644e1c00mr5572702fac.21.1717850666795; Sat, 08 Jun 2024 05:44:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717850666; cv=pass; d=google.com; s=arc-20160816; b=zUH0RtGlyjJc4Dblvh4/dKoITyXwhDrmJON+C4nxSCjxjUjPj0hFK7b4USafYZEg7J mk98Js/Osj7iDvinYbcoZPYggYrjkc+QzzIjYTqFDvrvip8X+1Z9VUj1hSrbn5ngPtpC qEMeR809nyyUSMQ3VWYdjtjmgwr+rezB1ost1YZH0uKCZqXtqtgm8L3MSTHoDjjGeGbz Le/MuAyCGi7fRZ/Li/YpTJExtyvpktEvL62xQNBLuwwT70U4ViZt5W4rNApCfrLiRpxD /iBJCN8j9tlGMeyTE+GrZNjb4cp1QYes51bYWRYcSArxMJ7Z0Orj5de0dsZswFIvLXyR xbTQ== 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=W8F12haHfYCyQ4HIdNKmmvskxpuwC0L38ijQvXG9O1M=; fh=sxp4hESi2i6+1e1Lx6GUlAXXiHR1XYtpkF4zjCDJOEc=; b=UR2I6NmvnrmwIEjXy+oC/8MBQvh0uBYzxUVQw9KeY2af+Y8JG7NZtfdQ7HWIQW23JE //0PSVBHmc5En2ltWtvPyd7tv3Z70oT5fwFZA0uXHM/u8NgfwUjcP8qUg+lCv56qjrXB OpDb3VHzo9l/VkuuysgXwGh8XdvCa8G1p4XEuGm9KNFslPtRbZjEC18sd83cjL9V/Z5f gnIQqXRzaG1tqd8uvSVWQyht5OGZ1hmNBNJKqpwr0IdEJ3UWim15dQbuc9fKvQJSpiYJ +otgm+QYlun814OdGf/ccTvTrVxGDs/RXpaf+Vc66r+Vt1lpHeSodtvLxxXaUntqxs6Y B/qQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TqW5w2dE; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-207034-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-7041c38b5d3si1449265b3a.231.2024.06.08.05.44.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 05:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207034-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TqW5w2dE; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-207034-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207034-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C120282684 for ; Sat, 8 Jun 2024 12:44:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4F3313E035; Sat, 8 Jun 2024 12:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TqW5w2dE" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 430D9F9C8 for ; Sat, 8 Jun 2024 12:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717850660; cv=none; b=Omh/hErPU003hb7DmAaHY57HEPS945Wad0m2CDtoOUhwrM45b1ZB53RqzJnpFKyh2iVP6MaigasOA0tn39/c6RzWQLtoT/CvuyCdx3c+2xj5fN+48QtuE87oL1zimSqY3ErC/V1euFyMP8nXPrGBjve6OzNuvcs3AoTrD3Csk+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717850660; c=relaxed/simple; bh=W8F12haHfYCyQ4HIdNKmmvskxpuwC0L38ijQvXG9O1M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oLkodIfwD57iddv+/KBqYsmvKyvAO9eu1w+Ol1Ok1UGGDnJrChITfaHWfys6lQZqpX1uUTnOvZnLkoZjlEWQPtwqELAXS4x9V7pzMg4jQzQaOP4IZFMNb53oUHeC9MHj9EMzse3WiJ1Ji2XheqQg2RgrT/ECASryBUz/U/n0m0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TqW5w2dE; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717850658; 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=W8F12haHfYCyQ4HIdNKmmvskxpuwC0L38ijQvXG9O1M=; b=TqW5w2dEOw4nEjqFeT/GCyz8qUsHstbVvXEKxAnz+MUH6pfkb9DpekgO6+YpxnCIdwhWt9 Bg5VsHh4plcqqZ/aInc9TQo75rhOnnirC+VfCET9iQ4eMIYped8evsCiqfCl+tq8ILQuBy frr6XQAbkaxYtkB2MnkjWONkezrynMo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-whCyCT8YNZi7IO53CsbSEw-1; Sat, 08 Jun 2024 08:44:14 -0400 X-MC-Unique: whCyCT8YNZi7IO53CsbSEw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 507E9800173; Sat, 8 Jun 2024 12:44:13 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.55]) by smtp.corp.redhat.com (Postfix) with SMTP id F104CC15BB1; Sat, 8 Jun 2024 12:44:07 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 8 Jun 2024 14:42:43 +0200 (CEST) Date: Sat, 8 Jun 2024 14:42:37 +0200 From: Oleg Nesterov To: Wei Fu Cc: Sudhanva.Huruli@microsoft.com, akpm@linux-foundation.org, apais@linux.microsoft.com, axboe@kernel.dk, boqun.feng@gmail.com, brauner@kernel.org, ebiederm@xmission.com, frederic@kernel.org, j.granados@samsung.com, jiangshanlai@gmail.com, joel@joelfernandes.org, josh@joshtriplett.org, linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, michael.christie@oracle.com, mjguzik@gmail.com, neeraj.upadhyay@kernel.org, paulmck@kernel.org, qiang.zhang1211@gmail.com, rachelmenge@linux.microsoft.com, rcu@vger.kernel.org, rostedt@goodmis.org, weifu@microsoft.com Subject: Re: [RCU] zombie task hung in synchronize_rcu_expedited Message-ID: <20240608124237.GC7947@redhat.com> References: <20240607062531.GA30954@redhat.com> <20240607150443.2096063-1-fuweid89@gmail.com> <20240607212116.GA7258@redhat.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: <20240607212116.GA7258@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 06/07, Oleg Nesterov wrote: > > On 06/07, Wei Fu wrote: > > > > Yes. I applied your patch on v5.15.160 and run reproducer for 5 hours. > > I didn't see this issue. Currently, it looks good!. I will continue that test > > on this weekend. > > Great, thanks! > > > In last reply, you mentioned TIF_NOTIFY_SIGNAL related to busy-wait loop. > > Would you please explain why flag-clear works here? > > Sure, I'll write the changelog with the explanation and send the patch on > weekend. If it passes your testing. Please see the patch I've sent. The changelog doesn't bother to describe this particular problem because busy-waiting can obviously cause multiple problems, especially without CONFIG_PREEMPT or if rt_task(). So let me add more details about this particular deadlock here. The sub-namespace init task T spins in a tight loop calling kernel_wait4() which returns -EINTR without sleeping because its child C has not exited yet and signal_pending(T) is true due to TIF_NOTIFY_SIGNAL. The exiting child C sleeps in synchronize_rcu() which hangs exactly because T never calls schedule/rcu_note_context_switch, it can't be preempted because CONFIG_PREEMPT is not enabled. Note also that without PREEMPT_RCU __rcu_read_lock() is just preempt_disable() which is nop without CONFIG_PREEMPT. Oleg.