Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2937353pxy; Mon, 3 May 2021 11:15:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd4TCrPLCBd7a5uXQf5JNcvmIOE60ZdJgfEDwKwZc6rkPP50ateHUaN8op4h3+r7XdEcEz X-Received: by 2002:a17:903:208b:b029:ed:74ad:4c15 with SMTP id d11-20020a170903208bb02900ed74ad4c15mr21652556plc.6.1620065725286; Mon, 03 May 2021 11:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065725; cv=none; d=google.com; s=arc-20160816; b=OxsmxKHLyQY8+KIG4xCt3YhivA02MiK0TCtfxxn0XpDDrRW7WWiP2cW544BYP1HVoQ HPHytydTqYnQMWk7M07BTNsv1KH4wPlU0eXsilTTIvm6WWtq8aUuhhkjXFjjKbLssUd5 c1s/1Wa+xY9O8ea81EO+oc5NTzUj7iTiETjxhzIFgsObE+dVTB0NOXYxfsmnMoY/IUG9 tj002K60adBwPlVSh/SynCwbYq16c+1PHr4xdARnN875/LPdI6ip1yJKXi4E4Pi3EhLK /Hydvb3edoppK4dbvo2rc6/pjwYNBnbATxlBrZy5sAJOigAyV+QD4BSkfkzrl6jEGH+2 283A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+H0Hi3CVfZbTV4jOta7Vcr+f479yzjS5Q7k8m0i2cJI=; b=uCg5OuYjHMQnVx3L2lBJg69iPNzffuO8W5a4zxovH/6sRZxB27wUnQCVIn7XwVm0ZQ rVIWyGEw9LId+Tw8sCToSbe1dzQpO7K243cvhtCu1bjzszfIR4jiKOqmHqf48epDLhyH j8LB+rBttPooLEgjA9zO+PBmNLXGDF1IbmUE4KoxNLbJuLEX6xQ8iEOmj/6dmh3D0HTM /8b4HGIyt4NG1ozVqGiNL/4YbVESkSgrU3PyjkQPDlMjtQlD3O15ox7eqfzz9n+bhHC9 iKLl4/jeBo1pmoVhK6eAzxS0hY2wLKp4tB53OAW6nDofLTmjyilJ/aW8ujJFx7BS5z2a a2Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DlprNe8r; 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 w12si380729pgs.162.2021.05.03.11.15.12; Mon, 03 May 2021 11:15:25 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b=DlprNe8r; 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 S231435AbhECSEE (ORCPT + 99 others); Mon, 3 May 2021 14:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229594AbhECSED (ORCPT ); Mon, 3 May 2021 14:04:03 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13E33C06174A; Mon, 3 May 2021 11:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+H0Hi3CVfZbTV4jOta7Vcr+f479yzjS5Q7k8m0i2cJI=; b=DlprNe8rI/W/NJfmwROlevasK5 kH33B6c49vJh6YAiPwSBiiK7NAWG9E+KP6iMmuQREZoxZ2WDX5kL44hFwNos0l5+v9Ori23xK9DFV wnFcTUzojtoKj9wukLoGmTNCPXEJbARLXV4Yq+KcNEu2oxI+dsLR6vMtl8Vfzcz/t9dXPNbZK1f1c dYSMqbADdMEccfHvvLE++YUw99CbxwJhZOFr77LE04E7GwwNG88U6CXdK6hT0twvrhSs73mj3lcqP doPkW8NdO6HixUWEuJ+UrU5v4pzpjAjEPjhKoStfHz4GAMv5hCsEH1wTjzXkjSwU0ZXUoqtrF9rg5 4sC/g+fw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1ldctT-00FRdj-1X; Mon, 03 May 2021 18:02:18 +0000 Date: Mon, 3 May 2021 19:02:07 +0100 From: Matthew Wilcox To: Jens Axboe Cc: David Laight , "viro@zeniv.linux.org.uk" , "linux-fsdevel@vger.kernel.org" , LKML Subject: Re: [PATCH] eventfd: convert to using ->write_iter() Message-ID: <20210503180207.GD1847222@casper.infradead.org> References: <7b98e3c2-2d9f-002b-1da1-815d8522b594@kernel.dk> <7caa3703-af14-2ff6-e409-77284da11e1f@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7caa3703-af14-2ff6-e409-77284da11e1f@kernel.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 03, 2021 at 11:57:08AM -0600, Jens Axboe wrote: > On 5/3/21 10:12 AM, David Laight wrote: > > From: Jens Axboe > >> Sent: 03 May 2021 15:58 > >> > >> Had a report on writing to eventfd with io_uring is slower than it > >> should be, and it's the usual case of if a file type doesn't support > >> ->write_iter(), then io_uring cannot rely on IOCB_NOWAIT being honored > >> alongside O_NONBLOCK for whether or not this is a non-blocking write > >> attempt. That means io_uring will punt the operation to an io thread, > >> which will slow us down unnecessarily. > >> > >> Convert eventfd to using fops->write_iter() instead of fops->write(). > > > > Won't this have a measurable performance degradation on normal > > code that does write(event_fd, &one, 4); > > If ->write_iter() or ->read_iter() is much slower than the non-iov > versions, then I think we have generic issues that should be solved. We do! https://lore.kernel.org/linux-fsdevel/20210107151125.GB5270@casper.infradead.org/ is one thread on it. There have been others. > That should not be a consideration, since the non-iov ones are > legacy and should not be adopted in new code. > > -- > Jens Axboe >