Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp199490lqs; Thu, 13 Jun 2024 07:51:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmepDrqalS1fdK3dyOn/eE5y8rNLtKZ+5FUEaEvBYp1lRP3/aHV0WgV8p42UFwJNzs7mq+ITkIczCWcTIAbJc1phXniidLoUaKWJaVRg== X-Google-Smtp-Source: AGHT+IH76i+ZNh2Tt7raIn5MEryKm8c4RItrFI+gZEZj+RROHrVhqBRGF61wDfwkMimSTRp7XiFr X-Received: by 2002:a2e:7218:0:b0:2ea:e759:749f with SMTP id 38308e7fff4ca-2ec0e5b5347mr262751fa.11.1718290271099; Thu, 13 Jun 2024 07:51:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718290271; cv=pass; d=google.com; s=arc-20160816; b=xGMgn/JDHXOxG76kLpxdGa+ICgKytiEs0J92405q8XERYoBUYL/63QzPZWu2ExmHud /45lasNpkg7PgqeUitC9I9Muz9II9BelfUNA9WxW7b8y+FSIMMYtzUEmDP+WBLIyg3Ur SyseEWW1qWcTlDiMzgG0OWkZvb9IkLwz5l0nCyh06VhR+lN8oR/pr8Wglljz03ffwgvL +rIuzQdfsOBA4G6CQdjeh+yxjJNz0Qa2h6CCs/5nPoI0YTTGM8a+hmawHuKGCp4eINx0 chKmBcY9iWY3XTeoKHL+gdAiS718rfByOxlVKSJc1pFmjR6qo+VORESpkFkm9sfPbMHg b0yg== 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=Y0WoLZ5dKwSO1CNiA0o+3a8cM1lM7Z8l0lW7Mgayr54=; fh=DiRh6cmwDG4Hm0gRXDq2cSWq9W+16r+XiHC3tJcGedA=; b=eUFPGKLE5I4GsBQO+Wlyn6D5745PZGZf3uUDtxzUHxcFDQO2R59B96aErDouLP7Fkr Oiub2NSORYHCYGZdMUvSnOKZts+4eidgIF8w0qxr8/U3AoxlouYeaHrWoTY+g7EeYBop kIHhQCPyQii74tiX9RsHe1rsPx04RjIa9+hSs84LBJfevquQW7GaRIowTFGJXoywCQ5L tSYVvO1OD2OlXnkPc21lzNQKH2eSORUubIB65wtjHTlQ2D23drZ/mWrnZF2eZZO1Y2QT YYAbtoEE+//UUoOveVne5L3dS8c3ivx/LxRrH9L0fMAl/GezRr6phfa5Xo57Q62fXCNh iKMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Racm8eZ+; 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-213469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cbc4f56besi156573a12.127.2024.06.13.07.51.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Racm8eZ+; 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-213469-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213469-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C99261F24D1A for ; Thu, 13 Jun 2024 14:51:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EAF51448D7; Thu, 13 Jun 2024 14:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Racm8eZ+" 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 DE541B646 for ; Thu, 13 Jun 2024 14:51:03 +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=1718290265; cv=none; b=Xjqm3oXP1saoThqeyTUoeSFBknnQbLi+c2klJduSdc/S/V6SPDk9pBQH1sntmkxTmjEXjwxkqM5O+Jxok6nIxBWw3K3GtxFOM2XZSuqfyIdJBknS16ELCo1h7ygRkFryHF0mXZSIqVlHVG1bFk/vwtC4YHzZiztghyDz5KP2Mhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718290265; c=relaxed/simple; bh=Y0WoLZ5dKwSO1CNiA0o+3a8cM1lM7Z8l0lW7Mgayr54=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mZZChuGes8OGo/4tIqa8Zty9OZN9kh+67Dsq+RSUXXrh8sjBDsJKAKvy7d3wO8b5qDZHoE+CdgnWa+DoH0WD0/j0bz/pMB3ER4KgBczhB4Zyf5CjcQGkGdtTwQdf3RQ2/lqMcPZXdW9bzuOHBUnenCGeuT+pVvAZTqUa0fEJlAg= 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=Racm8eZ+; 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=1718290262; 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=Y0WoLZ5dKwSO1CNiA0o+3a8cM1lM7Z8l0lW7Mgayr54=; b=Racm8eZ+LTuYGpK9hihgvG7enTEonFAoGw7ThPxDApJPEZxz8VKG6QRKxhQPD7JlnTYa+0 zt9CveUh9yPHmAIOoUx6vKiTAKp1YF+Q6gtsFbe3IivQEaSIUEbK3m8Dy1+6ioi5Zd2AW7 V6T6EZL49srdoJPkAd7WiP0caC1YwLQ= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-1jGJsdWNP2esv4ksrP1ypw-1; Thu, 13 Jun 2024 10:50:59 -0400 X-MC-Unique: 1jGJsdWNP2esv4ksrP1ypw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D14C19560BE; Thu, 13 Jun 2024 14:50:53 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.233]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 5DCE819560AF; Thu, 13 Jun 2024 14:50:45 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 13 Jun 2024 16:49:23 +0200 (CEST) Date: Thu, 13 Jun 2024 16:49:13 +0200 From: Oleg Nesterov To: Wei Fu Cc: ebiederm@xmission.com, Sudhanva.Huruli@microsoft.com, akpm@linux-foundation.org, apais@linux.microsoft.com, axboe@kernel.dk, boqun.feng@gmail.com, brauner@kernel.org, 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 Subject: Re: [PATCH] zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with TIF_SIGPENDING Message-ID: <20240613144913.GA18218@redhat.com> References: <87a5jpqamx.fsf@email.froward.int.ebiederm.org> <20240613140216.30327-1-fuweid89@gmail.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: <20240613140216.30327-1-fuweid89@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 On 06/13, Wei Fu wrote: > > I think there is a case that TIF_NOTIFY_SIGNAL remains set. [...snip...] Of course! but please forget about io_uring even if currently io_uring/ is the only user of TWA_SIGNAL. Just suppose that the exiting task/thread races with task_workd_add(TWA_SIGNAL), TIF_NOTIFY_SIGNAL won't be cleared. This is fine in that the exiting task T will do exit_task_work() and after that task_work_add(T) can't succeed with or without TWA_SIGNAL. So it can't miss the pending work. But I think we can forget about TIF_NOTIFY_SIGNAL. To me, the problem is that the state of signal_pending() of the exiting task was never clearly defined, and I can't even recall how many times I mentioned this in the previous discussions. TIF_NOTIFY_SIGNAL doesn't add more confusion, imo. Oleg.