From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F973C433FE for ; Wed, 26 Jan 2022 22:14:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F9016B0071; Wed, 26 Jan 2022 17:14:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A7016B0072; Wed, 26 Jan 2022 17:14:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66D756B0073; Wed, 26 Jan 2022 17:14:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 56FFE6B0071 for ; Wed, 26 Jan 2022 17:14:51 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1D69A181C77DE for ; Wed, 26 Jan 2022 22:14:51 +0000 (UTC) X-FDA: 79073843982.27.4D88E7B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf08.hostedemail.com (Postfix) with ESMTP id A6076160003 for ; Wed, 26 Jan 2022 22:14:50 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8FDB121115; Wed, 26 Jan 2022 22:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643235288; h=from:from:reply-to: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=XAxGUgZjMfRYcheCAvGcdbuwhS+6jxtGJ++NzQbXLbs=; b=mff66aUsTySR80NmIG6DFMDZ8GOSZWBzAb6QezcCyekTKeq0vaL4p57+me2lhVr9SxNgDq 5PrkZNO/w2zB5kgRuauSKoDUKN1aObBFWp1LheRHzZACgfpO+VXiiCtPEZKhuzochTgn4x dQuDMpHgMQMZt9xRtxBxbL4VkOHvKaw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643235288; h=from:from:reply-to: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=XAxGUgZjMfRYcheCAvGcdbuwhS+6jxtGJ++NzQbXLbs=; b=qZsxwnV2bCYEJrrqd0i6b3VKdv+EWpeCYEtnRvGhfI7zYjGmVoQzl23i75fR7TVdDKLmGa 4wqjwIkIgmIH2aAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7C2361330C; Wed, 26 Jan 2022 22:14:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rMG3DdXH8WH4TQAAMHmgww (envelope-from ); Wed, 26 Jan 2022 22:14:45 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Christoph Hellwig" Cc: "Trond Myklebust" , "Anna Schumaker" , "Chuck Lever" , "Andrew Morton" , "Mel Gorman" , "Christoph Hellwig" , "David Howells" , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/23] VFS: Add FMODE_CAN_ODIRECT file flag In-reply-to: References: <164299573337.26253.7538614611220034049.stgit@noble.brown>, <164299611280.26253.2845018521780218144.stgit@noble.brown>, Date: Thu, 27 Jan 2022 09:14:41 +1100 Message-id: <164323528189.5493.7196087998245554506@noble.neil.brown.name> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A6076160003 X-Stat-Signature: 4zh847r96ep6qsxcdgs6he3sc5izhbof Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=mff66aUs; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=qZsxwnV2; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf08.hostedemail.com: domain of neilb@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=neilb@suse.de X-Rspam-User: nil X-HE-Tag: 1643235290-609966 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 24 Jan 2022, Christoph Hellwig wrote: > On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote: > > Currently various places test if direct IO is possible on a file by > > checking for the existence of the direct_IO address space operation. > > This is a poor choice, as the direct_IO operation may not be used - it is > > only used if the generic_file_*_iter functions are called for direct IO > > and some filesystems - particularly NFS - don't do this. > > > > Instead, introduce a new f_mode flag: FMODE_CAN_ODIRECT and change the > > various places to check this (avoiding pointer dereferences). > > do_dentry_open() will set this flag if ->direct_IO is present, so > > filesystems do not need to be changed. > > > > NFS *is* changed, to set the flag explicitly and discard the direct_IO > > entry in the address_space_operations for files. > > Looks good: > > Reviewed-by: Christoph Hellwig > > It would be nice to throw in a cleanup to remove noop_direct_IO as well. I don't want to add this to the present series. When it lands I'll send patches to the various filesystems to switch to using FMODE_CAN_ODIRECT. Thanks, NeilBrown