From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FF81469843 for ; Wed, 29 Jul 2026 17:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785344875; cv=none; b=EvLo0sYINYMteuX8K/wsYtg5wr0tK/2vO5J9pVDt24L8aHH9E8HxeHhxgkzskBc+PRO4dtSDeuFSxPvSFDF7tAHpzMFg9gc3pe4xmucMSXgwqDD4jgo5VsdXCc7j4uG8/5YnWuPFh7umFyNmiaJ1y3o0nG2vWWzYKnmRf/u9/lc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785344875; c=relaxed/simple; bh=bb14VU+mzqH5lBzRhhTvKjHyh5XA6yPZdb7hGKFeL+c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KbstyjKuc2aCdkNHgHpMNCjVInxPL4RDXVGDvZ/UsywHzt0AakpDxRZP0xrxKxdkY6c2Vp44GotyL6TGHOKIiMuXEw6hPpHoloAhS/pC0SFBpIMvmrFPRCW+Z9c2xkZDsctOTu282YVbesXkF6Z1XFaqmjO4wBBS/is+ajpzz9I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jG5gBZCV; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jG5gBZCV" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-47f7027ca11so820896f8f.3 for ; Wed, 29 Jul 2026 10:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785344873; x=1785949673; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=G/vni40zmOCZ2HqBZcbw7mWmT4z7vqgKQwHadXTDKns=; b=jG5gBZCVg9YZMIvvBVKJAS+fsmbzR4fWs0xG/oV0Z1s3GGiXEra3QIJSEqRBBnfqWV VzlwGNlvQ3ZQL9qW0jJ4gumBXkwnnC1l+E56/dCnn+ckSSsg2uZ9GMRV+u+lypXoEGJR IUPx2pJUEM2kFE2iyTGEqn2nO44y5wMgdBnYa5gbjCvoLWPJVKDsK/CHAaD8Z4TyIuo5 +61u3hiBCBC7sCvR/m5ewZe/YNO6I8tjAheDrYMzv1izbKWv4A0UJTbCfNwXenhy3CHs hgRXz4D6KFvG+6Ap6A9ouFeSCB2ASZ4iiFq9ECMS+23VJeZf3nj7+CiPn48QVbQ+wlOj alcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785344873; x=1785949673; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=G/vni40zmOCZ2HqBZcbw7mWmT4z7vqgKQwHadXTDKns=; b=ppPXhMESL000po4b0sFR9A+44lrcvFp7HaCE+qjqkTpAooZBfNy7KJShP1KgC6uAbK N5EFtwSZq2x77oFzp4gWZ43I8f4i71QksnUICVBOzbS5afMz4IurrYEp6l8skfLZNFxh M1JhOwpwvc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= X-Received: by 2002:a05:600c:630d:b0:495:5365:c0d2 with SMTP id 5b1f17b1804b1-496c6558b53mr99358535e9.14.1785344872559; Wed, 29 Jul 2026 10:07:52 -0700 (PDT) Received: from ?IPV6:2620:10d:c096:325:77fd:1068:74c8:af87? ([2620:10d:c092:600::1:640]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4976bd6d226sm72029155e9.10.2026.07.29.10.07.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jul 2026 10:07:51 -0700 (PDT) Message-ID: Date: Wed, 29 Jul 2026 18:07:43 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 1/1] pipe: only enable the extra wake_up(rd_wait) for edge-triggered consumers To: Oleg Nesterov Cc: Breno Leitao , Christian Brauner , Mateusz Guzik , Jens Axboe , Alexander Viro , Jan Kara , Alexey Gladkov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org References: <1bd5710b-29c8-4a8c-8f26-72d9e71c2321@gmail.com> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hey Oleg, On 7/29/26 16:47, Oleg Nesterov wrote: > Pavel, thanks for taking the look! > > But let me ask a couple of questions to ensure I really understand you. > > On 07/29, Pavel Begunkov wrote: >> >> On 7/27/26 13:28, Oleg Nesterov wrote: >>> pipe_poll() unconditionally sets poll_usage on the first call, forcing >>> anon_pipe_write() to wake up readers on every write even if the pipe was >>> not empty. But this is only needed for edge-triggered consumers: epoll >>> with EPOLLET and io_uring without (unsupported) IORING_POLL_ADD_LEVEL. >>> poll() and select() users pay for it for no reason. >> >> Sounds good, especially with prep patches you mentioned. > > By prep patches you mean the > > With or without this patch we need to update the comments to document > that io_uring depends on ->pipe_usage too. And probably rename it to > (say) ->et_poll. > > note in "v2 0/1" ? Yep > If yes, I'll send this change as "v3 1/2", rediff this patch on top of it, > and make it "v3 2/2". I should've been clearer, no preference whether it's split into 2 patches or not. >> The only note your problems are caused by IORING_OP_POLL_ADD, which >> is not that important comparing to other polled io_uring requests, >> and they also set EPOLLET while should be fine with level. Not >> asking to change anything, io_uring should just stop setting EPOLLET >> for them. And IIUC poll callback implementations don't care about >> EPOLLET, at least before this patch. > > Sorry, I am a bit confused, could you add more details? TLDR, io_uring has something to improve internally after this patch lands. > In particular, I don't understand the "IUC poll callback implementations > don't care about EPOLLET, at least before this patch" part. I was saying that from a quick look I don't see any struct file_operations::poll implementation checking EPOLLET. And if so, it makes changing io_uring easier, only need to consider this patch. > Although it seems you agree that this patch should not break (change the > current behaviour of) io_uring, Yes and right now this is my only concern. > Can you ack/nack my understanding? You got it all right -- Pavel Begunkov