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.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 E615B3BD64A for ; Mon, 30 Mar 2026 23:50:23 +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=1774914625; cv=none; b=oOY1FrZCYhX7IyZapogwQ+3udgIpsYArEunPhKZIIgNY0X3Zy52hv9jAKqLyKqPv02PsSR30Yvj2jJ4QmcA7k0um5kbfYooNvGCyQW7Qt/PDAxkxAe4tELMg6JgjuL3FNqVpK7K1l0A5HN6too4pqM8mjiFTKvV/GaKMxlcosnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774914625; c=relaxed/simple; bh=IKu99eJLKxEb+cabwk6c0H/g6/VfIhKW1QY/qwKQT/o=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=J+d53h/yVn73EjbTOaeaZiXyh7YkJF1VZ0F/GDhA3Ox7r8abr5uYevIrx0mH5pDgxGiI5ajdEstEZQWxbGfAjb73OFiGPgyw2pdxRbdsQpNAvSNF+TTVPQUSgLMT9AJ3abbK/BLkuX6lj8KFJBuBwKyUzXBlqs1uffExUJY4Il8= 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=Jwld01rk; arc=none smtp.client-ip=170.10.133.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="Jwld01rk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774914623; 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=4//0gHIbpafUUo1kR2n1Am7xkOI04D7fEcFujAkL3aw=; b=Jwld01rkrqHbupodp+Fg05aCHVJ6luaux00YHFZ8tS6eyGvivceKG6pOG+QHQY/VuZxE4r iY0qyFU5eLUKVQqrGXCRRxR80dKQ1Rxba0rOfb9mKMYU1k3R+pfUgWrdUgdMOtcxx2WhqK pbY7UR9V/7Schq0RNNwELkNKVg5AUbg= Received: from mx-prod-mc-06.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-422-zqA9f9snPU-ZRNj8WWh5tg-1; Mon, 30 Mar 2026 19:50:17 -0400 X-MC-Unique: zqA9f9snPU-ZRNj8WWh5tg-1 X-Mimecast-MFC-AGG-ID: zqA9f9snPU-ZRNj8WWh5tg_1774914615 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D644180035C; Mon, 30 Mar 2026 23:50:14 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.44.35.245]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6465018002A6; Mon, 30 Mar 2026 23:50:08 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20260326131838.634095-1-dhowells@redhat.com> <20260326131838.634095-5-dhowells@redhat.com> <20260329121208.6092419d@kernel.org> <1179840.1774867765@warthog.procyon.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Jakub Kicinski , netdev@vger.kernel.org, Marc Dionne , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Mathieu Desnoyers , John Johansen , Minas Harutyunyan , Simon Horman , apparmor@lists.ubuntu.com, linux-usb@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH net v3 04/11] list: Move on_list_rcu() to list.h and add on_list() also Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1317860.1774914607.1@warthog.procyon.org.uk> Date: Tue, 31 Mar 2026 00:50:07 +0100 Message-ID: <1317861.1774914607@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Linus Torvalds wrote: > Dammit, you should *KNOW* that already from core logic. Not with a > flag, not with a function to ask, but from how things work. The whole > "am I on a list or not" should not be a list issue, it should be > obvious. The circumstance in question is this: There's a list of outstanding calls attached to the rxrpc network namespace. Calls may hang around on it beyond the life of the socket that created them for a little bit to deal with network protocol cleanup, timer cleanup, work func cleanup. Under normal operation, calls are removed as the last ref is put. However, should the namespace be deleted, rxrpc_destroy_all_calls() trawls the list to report any calls that haven't been cleaned up and the calls are deleted from the list as it reports them so that the spinlock doesn't have to be kept held. It used to do other work here too, IIRC, but that's no longer the case, so perhaps this loop is not needed now, and a warning will suffice if the list is not empty (or I could just report, say, the first 10 calls and not worry about calling cond_resched()). The wait at the bottom of the function should be sufficient to hold up namespace deallocation. If I don't delete entries in rxrpc_destroy_all_calls(), then rxrpc_put_call() only needs list_empty() to guard against the call not having being queued yet. I could have a flag for that, but it would be superfluous. Note that the reason for the RCU walking is because /proc/net/rxrpc/calls walks over the same list, so I still need the next patch which switches to list_del_rcu(). David