From patchwork Mon Jun 11 14:05:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10457843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D07DE60467 for ; Mon, 11 Jun 2018 14:06:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEE9128451 for ; Mon, 11 Jun 2018 14:06:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B39912846F; Mon, 11 Jun 2018 14:06:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F8AB28451 for ; Mon, 11 Jun 2018 14:06:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36A5B6B0008; Mon, 11 Jun 2018 10:06:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 28B206B0010; Mon, 11 Jun 2018 10:06:46 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1597C6B000D; Mon, 11 Jun 2018 10:06:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id BA89C6B0005 for ; Mon, 11 Jun 2018 10:06:45 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id a12-v6so10267349pfn.12 for ; Mon, 11 Jun 2018 07:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=zowXtexFJYg/ibOfn7aWp3ZjHxVfIK1o3juT8iBdx8U=; b=lKL57myxjIt80hswfFuOGE1VS42z6J/K0fThQYX8LAvOkV4qusxh1lhbj8FH0dZJyT VLvqDAnfTE9OgsZ88QT/vfUpHqlLvcZQ1OtCRIpECxIs7ajaCxGgdodTnc1QqEMlj8bb NkYAmQfqMhp9UhOa4o3pk1gD/yF92f0QidpSGGdIRAPpibp20Edpr7Sq/3h3ObJV2LF4 iMeYRfKuyngJOWIDLUMD+DNVIXphEqNHX4GkSv66u8zfN8NsVSkR6oRHOmf1qnO1e9If D8RWCKt3D9PbYeCkqDsW8nkPXjDKpm9+2+nOh+wttyPjv8okvONYlcbI1vSDfXyc3B1p SxrA== X-Gm-Message-State: APt69E2V65kX0QdHQhEMugHFVC17/f2E9A0JEyG7sgXKQhScyVQCkAVV mfySse3drelX7FydcUadtH7uB00lpgZfiZpClJJCJC33pf4RM3vO9w+fVSVXaT4ku8kDeiOYPfs a42sVUgVpPUqASR1kxF7iO5Kzs2vQDS+ZEe9yCpDPEkAjHdpIcoZkQ09UsILxHGDN8w== X-Received: by 2002:a63:7f4e:: with SMTP id p14-v6mr14784158pgn.27.1528726005429; Mon, 11 Jun 2018 07:06:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLfYvxFai5qxRRyRWUeyR9m8LGzLXpFHazqKjKtn2jpxRhv2peEqFNCqCxdcb+RQtw+6Dan X-Received: by 2002:a63:7f4e:: with SMTP id p14-v6mr14784091pgn.27.1528726003975; Mon, 11 Jun 2018 07:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528726003; cv=none; d=google.com; s=arc-20160816; b=Ath4y78LM/mF2rtMwYPInjceJxf9tdUih/4AufJzEw/rOyOeR6D2ta8BAkgwMdrGFz wuC9UyjlcNGfoEbDv5T9QYbTBPUyg56bD7bzDdbzRoJc78xWc27jKayigHdzB7G5q6zj z4ERcE/DyWF9ILns48ausYEbmjnRh9W5YxUqSdDbzTIze/F+xjluvoEN++89ErE2xvGh eCkZdDfigReqaaznCqWG7ILhOcnIks8gam3Ktic9s/QrAK1uJDLePLoz5eW/OwTKtQK/ 7LYDuHo6nb0lVFgDC4lKpupUZe7l5y4/35PHoq6WslFDA+mcjI94anblrw6Qx9RE7koQ +E6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=zowXtexFJYg/ibOfn7aWp3ZjHxVfIK1o3juT8iBdx8U=; b=uNXZS8kOMfWSRVzUgT/00c5G3X581X5YKGHmzZ5mYNklxOBjm9HAO2kEaYbmNqJ1tD AQ9AdLPVEug0c9CKj4m6KcU7p7VyrwTqVqa2p37OYFN8fmBL66RWFrEKDEoLwRo9cy/Z gvxlISsjQQBKB4xt5l/mjye5fdcM3lXPprgkFm6EcT/MP3shQcXj0YnuXjXHeqRAXT3u aEFQXyZ9VzV6mpTOTcnZS9IJJkp0ZRvWMcF66uKI8Bp8A1ZM2f4NOa2NB6cJtZrIX9aD eLCm6Ca5hHtyf5YsqYybQpTF0RkxtSu9vZTPdFpxeZnjSf1w7wVmNBkJqwVkBdJ3SPga Jd4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=o60f3YJP; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id az9-v6si21299727plb.454.2018.06.11.07.06.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 07:06:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=o60f3YJP; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zowXtexFJYg/ibOfn7aWp3ZjHxVfIK1o3juT8iBdx8U=; b=o60f3YJPM3L7yOUO6/Ib1B3db iANa5JGRqWuecuZlBRToIJqZQsHf58sm7j4OurE8YChRJMFXP5yXaUNo4kFXYz0m3pFvbJ6fq6jKK A/Hooqdo2Xjm20b0rjp5xm8KMsgXNRMTTjaqAqBdL7+9DdSemyOPYu1fD6pMGeZDxAD5jhtpGAUOa MTohMpOxRCxnYLe9+EcYRCyg453q/K+iBny8yV0WGc5EG6/giF1KmmtZf1kCy8ATB6c4+22rwppNo tGXQL8VaWaLHXKxhZpHByLqRQJZ8f1zCnRi79QsbEBgz6q0d/S7CtzAdZkyFuuj7hG7f/Gq8XdyQQ my0pkMikQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSNSz-0004Xj-61; Mon, 11 Jun 2018 14:06:41 +0000 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Jan Kara , Jeff Layton , Lukas Czerner , Ross Zwisler , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v13 02/72] dax: Fix use of zero page Date: Mon, 11 Jun 2018 07:05:29 -0700 Message-Id: <20180611140639.17215-3-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180611140639.17215-1-willy@infradead.org> References: <20180611140639.17215-1-willy@infradead.org> 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it works on MIPS and s390. Signed-off-by: Matthew Wilcox Reviewed-by: Ross Zwisler --- fs/dax.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 4de11ed463ce..5e7b010738be 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1017,21 +1017,12 @@ static vm_fault_t dax_load_hole(struct address_space *mapping, void *entry, { struct inode *inode = mapping->host; unsigned long vaddr = vmf->address; - vm_fault_t ret = VM_FAULT_NOPAGE; - struct page *zero_page; - pfn_t pfn; - - zero_page = ZERO_PAGE(0); - if (unlikely(!zero_page)) { - ret = VM_FAULT_OOM; - goto out; - } + pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr)); + vm_fault_t ret; - pfn = page_to_pfn_t(zero_page); dax_insert_mapping_entry(mapping, vmf, entry, pfn, RADIX_DAX_ZERO_PAGE, false); ret = vmf_insert_mixed(vmf->vma, vaddr, pfn); -out: trace_dax_load_hole(inode, vmf, ret); return ret; }