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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D5D6C4338F for ; Thu, 12 Aug 2021 12:21:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F37926104F for ; Thu, 12 Aug 2021 12:21:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F37926104F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 81E4F8D0007; Thu, 12 Aug 2021 08:21:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F4BF8D0002; Thu, 12 Aug 2021 08:21:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BD948D0007; Thu, 12 Aug 2021 08:21:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 4839A8D0002 for ; Thu, 12 Aug 2021 08:21:09 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E50D08249980 for ; Thu, 12 Aug 2021 12:21:08 +0000 (UTC) X-FDA: 78466338216.28.C805679 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf07.hostedemail.com (Postfix) with ESMTP id 8FB7A1005BEF for ; Thu, 12 Aug 2021 12:21:08 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id D840468AFE; Thu, 12 Aug 2021 14:21:04 +0200 (CEST) Date: Thu, 12 Aug 2021 14:21:04 +0200 From: Christoph Hellwig To: David Howells Cc: willy@infradead.org, trond.myklebust@primarydata.com, darrick.wong@oracle.com, hch@lst.de, jlayton@kernel.org, sfrench@samba.org, torvalds@linux-foundation.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm: Make swap_readpage() for SWP_FS_OPS use ->direct_IO() not ->readpage() Message-ID: <20210812122104.GB18532@lst.de> References: <162876946134.3068428.15475611190876694695.stgit@warthog.procyon.org.uk> <162876947840.3068428.12591293664586646085.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162876947840.3068428.12591293664586646085.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8FB7A1005BEF X-Stat-Signature: mcno31yghhbmuhb1uis7jprzhrucixt8 Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=none; spf=none (imf07.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-HE-Tag: 1628770868-523644 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 Thu, Aug 12, 2021 at 12:57:58PM +0100, David Howells wrote: > Make swap_readpage(), when accessing a swap file (SWP_FS_OPS) use > the ->direct_IO() method on the filesystem rather then ->readpage(). ->direct_IO is just a helper for ->read_iter and ->write_iter, so please don't call it directly. It actually is slowly on its way out, with at at least all of the iomap implementations not using it, as well as various other file systems. > + ki = kzalloc(sizeof(*ki), GFP_KERNEL); > + if (!ki) > + return -ENOMEM; for the synchronous case we could avoid this allocation and just use arguments on stack.