Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp649601pxb; Wed, 18 Nov 2020 13:30:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxepNeFQRj9Hm4q58AJ/dhld0hGQeIQzFlueApHCXyUHU6vORGRFTgTMPn1GQgY7+4U8bYC X-Received: by 2002:a50:9e05:: with SMTP id z5mr26644688ede.231.1605735016389; Wed, 18 Nov 2020 13:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605735016; cv=none; d=google.com; s=arc-20160816; b=BMpqO/sYCBAo2htbtkynD94SH7fi5leHiGLGOvSMgsCozOABgSoD1zp4XH9KqyWGTj 3ilPdj5onpnCxmVs4zOBi9MwcOpUgi8FzzEPPql9M07sKkiJySiqySaXdXHvL1sOFAG2 hpTG7Bu8gY/sceIU21zkgPBONF6pkSBnlLZbnqT4EqH6hJm7mRvMTqqFGCYvdUHmAR6R tIu1a77BVivwsx6RjxUqcCaGqna++VtjOJ64xjzL344iNYJWITj9jRTBjCc9HGDGWzx+ 506FoKRdVooT3i73xWwARMmG1Gp4iKRswox+KNoxzpotktjkY+Ayxn01K2aT0uUW9Xqp 84eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=eeM7fvU8Uo79E6Y3uNDD9FvmacgHALhMrr4AV1XqxP0=; b=Y69Yq2Z/1+H4vI75mYfPi9pJAN7JLScmNOcnas3b7YGzEN8j08SjWzsuQTu6C4dMkZ BhpStlu0L1uZkHXBC+Eotc1Z3PCoiQsZ2jBl16vaKxMlpUn32ydT90EdaXzXQk2bTZ+h i5kCC2QqUKv0VzvIHzOlJc9/hYqjCudnyR+QR5tkeFU7IaNbE4LVuTvpNXIX81QBEf6R X4iNxe75vgnQcaq6UVjDAzuFiEyO3zqm/zRBAyBL8Z7kSLWEypfZim6EWDRBjEG9pSFh JT2sd5Yxwpz/aTAlW8WnmthIZyxmogdjpsE3LHrFhUeorZdLQchJCZzCcGDSox5l4Yq5 KA7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=PunnfcYp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si17406887edd.464.2020.11.18.13.29.52; Wed, 18 Nov 2020 13:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=PunnfcYp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgKRV1O (ORCPT + 99 others); Wed, 18 Nov 2020 16:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgKRV1M (ORCPT ); Wed, 18 Nov 2020 16:27:12 -0500 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F69CC0613D6 for ; Wed, 18 Nov 2020 13:27:11 -0800 (PST) Received: by mail-io1-xd42.google.com with SMTP id m13so3639890ioq.9 for ; Wed, 18 Nov 2020 13:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eeM7fvU8Uo79E6Y3uNDD9FvmacgHALhMrr4AV1XqxP0=; b=PunnfcYpbpMRJUZjucBpq/I4yqUTk9Ywtf0HDRuOgldBli9h0gqL6uycoXQpPVYNd3 SIKHm5l9sv8NrWaLKJr/ob4gAHdc5pz6T9/qGf5WYu6pfsHy3RBmNl6yb0HIUqRYWvTj 92/UikKStZsnh8ARCVAdN6yjtmhNOIFSF4zNyRdkhMI+GaHZhnYohD5SQDm/Mnpf/i4R qgugEv3iRAF1lqUfyxkEdkGoBZt4ybue+bAyKy7hZbFdXMRL5YZPnoqOrp8JVfUMxa78 vDa/IA1W99U7UNacYiouKBxgusHbBjMDmVC7m004xjMusLeen0pLclJaq9IsKhEdrZpy QyYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eeM7fvU8Uo79E6Y3uNDD9FvmacgHALhMrr4AV1XqxP0=; b=V9Q+m1Ythpp6y/s31Z5M3Nv0tNmcb/sBture1XgRlxpWjOJbVgDMDlQDNStYub7GDJ eBKob7uwBGGesDerqOgH2Gu/b6FBKYOk7avKDensAb8Pg7sooxGe3u6tVM8O9vOM84bx +hshrBDnxpSoQgzcuhOG3zzZVTMPVf7j6DNzpFvjyAohIJafS1A7O48LSNeMgIAVJk67 rBwHiwrQ88CkZHEMla+lMUY/CHS3PuEwRZQipf2e1tSVC+HZi4hYbSi9a9marWsug+pU qsgpCa8rE5fpBRuGaEjYDLIBq8KYN8x6cqf2P5Wazwe3tP7kNDNMPPthQwR3zU50H8xX byJA== X-Gm-Message-State: AOAM531JxESzTcRmBHA7DAuNcxpA5vzm4bSUB95EWBwK7heGLe7RWyHV Df9Q84iDKQ5L765YxES16BryKWx5h6FeQA== X-Received: by 2002:a05:6638:124d:: with SMTP id o13mr10383581jas.98.1605734830152; Wed, 18 Nov 2020 13:27:10 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id z6sm16264337ilm.69.2020.11.18.13.27.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Nov 2020 13:27:09 -0800 (PST) Subject: Re: [PATCH] eventfd: convert to ->write_iter() To: Michal Kubecek , Christoph Hellwig Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <8a4f07e6ec47b681a32c6df5d463857e67bfc965.1605690824.git.mkubecek@suse.cz> <20201118151806.GA25804@infradead.org> <20201118195936.p33qlcjc7gp2zezz@lion.mk-sys.cz> From: Jens Axboe Message-ID: <4e4d222c-ed8b-a40d-0cdc-cf152573645c@kernel.dk> Date: Wed, 18 Nov 2020 14:27:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201118195936.p33qlcjc7gp2zezz@lion.mk-sys.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/18/20 12:59 PM, Michal Kubecek wrote: > On Wed, Nov 18, 2020 at 03:18:06PM +0000, Christoph Hellwig wrote: >> On Wed, Nov 18, 2020 at 10:19:17AM +0100, Michal Kubecek wrote: >>> While eventfd ->read() callback was replaced by ->read_iter() recently, >>> it still provides ->write() for writes. Since commit 4d03e3cc5982 ("fs: >>> don't allow kernel reads and writes without iter ops"), this prevents >>> kernel_write() to be used for eventfd and with set_fs() removal, >>> ->write() cannot be easily called directly with a kernel buffer. >>> >>> According to eventfd(2), eventfd descriptors are supposed to be (also) >>> used by kernel to notify userspace applications of events which now >>> requires ->write_iter() op to be available (and ->write() not to be). >>> Therefore convert eventfd_write() to ->write_iter() semantics. This >>> patch also cleans up the code in a similar way as commit 12aceb89b0bc >>> ("eventfd: convert to f_op->read_iter()") did in read_iter(). >> >> A far as I can tell we don't have an in-tree user that writes to an >> eventfd. We can merge something like this once there is a user. > > As far as I can say, we don't have an in-tree user that reads from > sysctl. But you not only did not object to commit 4bd6a7353ee1 ("sysctl: > Convert to iter interfaces") which adds ->read_iter() for sysctl, that > commit even bears your Signed-off-by. There may be other examples like > that. A better justification for this patch is that users like io_uring can potentially write non-blocking to the file if ->write_iter() is supported. -- Jens Axboe