From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 F085137187B for ; Mon, 21 Sep 2026 10:32:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789986769; cv=none; b=h25YoY+wLK5XpIgEK057q9Xaw4fAp2mK8cBUvzkgPasFiGYNQhnc2wOMg+2+MqEpNbPDML8dA90wpLE8AeP+1aZSCDJWkQzm6VkQb6qxZqaD6nU4+bSo77ymohaH1IFKfHqOfOxYuhyFPbvz/bopoWxEiadSGSPtEVdfwh1h9jY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789986769; c=relaxed/simple; bh=KZadSeZqephBsHbVNXtBZ0HEkwYoNYgIbKhAcKBhmFk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ueAZPwto/7aH0OOaU4+6CQd2Ppl4Yodx1S2Hy/xq5ZzrXgUSKVjOIIH2EmXXTBiN8gfhacU7bL8jYfaxhlbhOE93prqG+gB6H1g9xtREiSq0j4HNULoLBXHgMYoBdLq9ol3Z3jE8lJXKEm8cjCI0UFieqJF5oFWLBqYYeESxt68= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=ajqPxWtT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ajqPxWtT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789986766; 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=7dfX0uPkgOugVML85bBzWDMFZaOWExPaUKgWWIP1kWE=; b=ajqPxWtTSgcijkJzHk799n0MM7yK3hah4B5DQzwHdVkJyhPgIgFbIua91Ql+AsnLWPiScY cveClSM2IORw+8nAui8H+ZbCl3MN622GOEicRby5vrLqUBE8up2X1pxac6Ei22JjZRx6bw LVUAR6ya6AbBkUeKQjVmihLuL2xAIPg= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-EiUlTb4tNzuHYTvdF1LTDQ-1; Mon, 21 Sep 2026 06:32:45 -0400 X-MC-Unique: EiUlTb4tNzuHYTvdF1LTDQ-1 X-Mimecast-MFC-AGG-ID: EiUlTb4tNzuHYTvdF1LTDQ_1789986763 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 509D71801BF4; Mon, 21 Sep 2026 10:32:42 +0000 (UTC) Received: from fedora (headnet03.pony-001.prod.iad2.dc.redhat.com [10.2.32.114]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 5FBDD1956041; Mon, 21 Sep 2026 10:32:37 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 21 Sep 2026 12:32:41 +0200 (CEST) Date: Mon, 21 Sep 2026 12:32:36 +0200 From: Oleg Nesterov To: Christian Brauner Cc: Jens Axboe , linux-fsdevel@vger.kernel.org, Alexander Viro , Jan Kara , NeilBrown , Ingo Molnar , Peter Zijlstra , linux-mm@kvack.org, io-uring@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/7] fork: refuse new threads while a coredump or an exec is in progress Message-ID: References: <20260917-work-coredump-fixes-v2-0-f3787fcda051@kernel.org> <20260917-work-coredump-fixes-v2-1-f3787fcda051@kernel.org> <20260918-irrsinn-pickt-vermummen-d7167c397398@brauner> <20260918-disput-maden-parkdeck-2bc22dd90398@brauner> <20260918-elstern-potenzieren-marotten-71ebd0744753@brauner> <20260918-oliven-lebst-wohltat-c633868711f1@brauner> Precedence: bulk X-Mailing-List: io-uring@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: <20260918-oliven-lebst-wohltat-c633868711f1@brauner> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 09/18, Christian Brauner wrote: > > zap_process() skips every thread that has PF_POSTCOREDUMP set. > do_exit() sets PF_POSTCOREDUMP in synchronize_group_exit() and calls > io_uring_files_cancel() right after that. > > That runs task work, create_worker_cb() runs and creates a new io-wq > worker. If a thread started a coredump rgith before that worker gets > created from a thread with PF_POSTCOREDUMP set which zap_processes() > doesn't see. So two ways of fixing this: Christian, I got lost ;) TBH, I don't understand why the new io worker is really bad in this case. But lets forget about coredump/zap_process. With the change below the io_uring_files_cancel() paths will no longer be able to create a new worker, even if coredump is not in progress. Is it correct? Oleg. > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -2707,8 +2707,8 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node) > .user_worker = 1, > }; > > - /* A creator past its fatal signal gets no thread. */ > - if (current->flags & PF_SIGNALED) > + /* A creator past its fatal signal or its coredump point gets no thread. */ > + if (current->flags & (PF_SIGNALED | PF_POSTCOREDUMP)) > return ERR_PTR(-EINTR);