From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796568016; b=x8QEkFdxkAm0sNT91iQluSVLzVl2muh1L2s6TxftSX8DurFLL3FwqHtNeRebgXK4PTw0 bMwOAXeu11RFYfM1RP+UNBHv1sCSGd4vtMUH8ml5IoH9nR29xdari4A7T7YEFo5Jatx6v Z7eM5kIHScqvVz1a+pb6/03XtSAUcCucEnyknJUD9yXVCO+7nS7idf7ivvu3jgj7OT1Jb V/Df5wWUtNHp0Br2X3Nn7fDAeVEaInHSoRnw0j1snIpYsnH40D40jsVXdCnCJKyVNSGlo 05iesR135j94VRCEkAVl0R17km+/NpOzlla8PMytI1ES2LHQMJntGPl5sG9FCYmNEcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796568016; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Scanned-By; bh=7+MoBgrlmdRO2e8v4aHkGsWu67Bc0ZVybep14OcXuCY=; b=jggCchv2qnhikW+rWX2wc+HMx1yLvCxK50L/6Iq0pkLC5n+4626O5g15pQmewuz6j6Wx gKeOJJLx7vYBFDaf0uAUEhhYfBnRU28eb6knaH8QT0ebc9alT2RC096k7gTml/wA5ntw2 +TJAUmEL4ftKFOoEPJvN+G6wneL4s1PqO47+HhJqL5MqlUaCT1kME4YdX8j9MDVYYysUq D1KEYs+9qkhK9fivbzRMpzVNITpyeOTEP0SO85i7muJbojVT5Vw3CVAwk42jKfMR2r+ij Qg8qZKlLEmXg1B1s6JZx/IqzrCixDxFWST6I0HXSmHXn4ETAy6kCitjDdB7H0fITGsw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fxY1xywC; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7431E606A322 for ; Sun, 6 Dec 2026 14:40:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7431E606A322 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.a=rsa-sha256 header.s=mimecast20190719 header.b=fxY1xywC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796568014; 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=7+MoBgrlmdRO2e8v4aHkGsWu67Bc0ZVybep14OcXuCY=; b=fxY1xywCTWtzVEAneR0OLplP+XIEnCgZ7VXbltXXYJJfySG+Gdjo6o8vIFmIHk9HftD6fV pdgmhyp/nNyhNXb6L/bb80cStvANS2z4nNKvBwNc5Dw7EifLnvBbg+PQYjzrjes1vovLpl lAAESjqOOEBn3m78UxQGYS/4XErhYbY= Received: from mx-prod-mc-01.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-587-aN5oaIEmMUOkBp8csXiYtw-1; Sun, 6 Dec 2026 14:40:11 +0000 X-MC-Unique: aN5oaIEmMUOkBp8csXiYtw-1 X-Mimecast-MFC-AGG-ID: aN5oaIEmMUOkBp8csXiYtw_1796568007 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E701F1955D8C; Sun, 6 Dec 2026 14:40:05 +0000 (UTC) Received: from onestero-thinkpadp1gen7.tpbc.csb (headnet03.pony-001.prod.rdu2.dc.redhat.com [10.4.224.30]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 735E11955F1E; Sun, 6 Dec 2026 14:39:57 +0000 (UTC) Received: by onestero-thinkpadp1gen7.tpbc.csb (nbSMTP-1.00) for uid 13628 oleg@redhat.com; Sun, 6 Dec 2026 15:40:05 +0100 (CET) Date: Sun, 6 Dec 2026 15:39:56 +0100 From: Oleg Nesterov To: Chris Mason Cc: brauner@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, peterz@infradead.org, mingo@redhat.com, kees@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, bsingharora@gmail.com, eddyz87@gmail.com, memxor@gmail.com, yonghong.song@linux.dev, martin.lau@linux.dev, song@kernel.org, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, sched-ext@lists.linux.dev, cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v2 8/8] signal: move group_leader into signal_struct Message-ID: References: <20261204233428.14861-1-mason@kernel.org> <20261204233428.14861-9-mason@kernel.org> <1796557165.1.218.0@kernel.org> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1796557165.1.218.0@kernel.org> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 12/06, Chris Mason wrote: > > On Sun, Dec 6, 2026, at 6:00 AM, Oleg Nesterov wrote: > > OK, this won't work if somebody increments signal->sigcnt, but probably > > __put_task_struct() can check tsk == tsk->signal->group_leader before > > put_signal_struct(). Still not sure... > > The last put_signal_struct() frees the leader, so others can hold a sigcnt > too. The end of free_task() becomes: > > if (tsk != sig->group_leader) > free_task_struct(tsk); > put_signal_struct(sig); Not sure... > The catch is that BPF programs can still reach the leader in the meantime, so > its ->cgroups, ->exec_state and ->bpf_storage can't be left stale any more. Yes, this was my main concern... Chris, I can't work today (can't even think) but I'll try to make/send another just-for-discussion RFC. IMO, we also need to simplify the transition from task->group_leader to signal->group_leader. Oleg.