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]) by passt.top (Postfix) with ESMTP id 085615A026D for ; Fri, 3 Nov 2023 17:21:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699028464; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zJLSSKa9n1DLDrH4427jXjgxfZzENksSTDU+l20iXtQ=; b=h/8jkPAbpOoTptqfQV0RFFqCmfBwGBvMX4z1g8Xh5SzSThG29HGxLDYFgomJuCTJjVOHUq 2hw7pBLz0+Mga6h2QpY6FKgB++OAZRZDl1FZ4B+eKjPyWLk2oXT0ejIyv2G7sP9PD2FPpV tcCBR3fuQZgrk6ca3LxzBdD81lgVwzc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-I2iusDTdOBmIkbaBixLEEg-1; Fri, 03 Nov 2023 12:21:03 -0400 X-MC-Unique: I2iusDTdOBmIkbaBixLEEg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 D645B381AE4B; Fri, 3 Nov 2023 16:21:02 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2353E492BFA; Fri, 3 Nov 2023 16:21:01 +0000 (UTC) Date: Fri, 3 Nov 2023 17:20:53 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 03/11] tcp_splice: Don't handle EPOLL_CTL_DEL as part of tcp_splice_epoll_ctl() Message-ID: <20231103172053.22f07d27@elisabeth> In-Reply-To: <20231012015114.2612066-4-david@gibson.dropbear.id.au> References: <20231012015114.2612066-1-david@gibson.dropbear.id.au> <20231012015114.2612066-4-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: ZSYBXVQIWPXY2ONPCSN7BZOXFRKIRRQE X-Message-ID-Hash: ZSYBXVQIWPXY2ONPCSN7BZOXFRKIRRQE X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 12 Oct 2023 12:51:06 +1100 David Gibson wrote: > tcp_splice_epoll_ctl() removes both sockets from the epoll set if called > when conn->flags & CLOSING. This will always happen immediately after > setting that flag, since conn_flag_do() makes the call itself. That's also > the _only_ time it can happen: we perform the EPOLL_CTL_DEL without > clearing the conn->in_epoll flag, meaning that any further calls to > tcp_splice_epoll_ctl() would attempt EPOLL_CTL_MOD, which would necessarily > fail since the fds are no longer in the epoll. > > The EPOLL_CTL_DEL path in tcp_splice_epoll_ctl() has essentially zero > overlap with anything else the function does, so just move them to be > open coded in conn_flag_do(). > > Caveat: this does require kernel 2.6.9 or later, in order to pass NULL as > the event structure for epoll_ctl(). I _think_ we already require newer > kernels than that for other features. Yes, we do, we need at least 3.13 for unprivileged user namespaces. -- Stefano