From patchwork Sun Jun 17 01:59:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10468175 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 9C625600F4 for ; Sun, 17 Jun 2018 02:01:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C82E28BC1 for ; Sun, 17 Jun 2018 02:01:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8129D28BDB; Sun, 17 Jun 2018 02:01:08 +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 8F81F28BC1 for ; Sun, 17 Jun 2018 02:01:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 641B96B0007; Sat, 16 Jun 2018 22:01:01 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4664D6B000C; Sat, 16 Jun 2018 22:01:01 -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 E24B36B000E; Sat, 16 Jun 2018 22:01:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 891DC6B0007 for ; Sat, 16 Jun 2018 22:01:00 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id f5-v6so1118289plf.18 for ; Sat, 16 Jun 2018 19:01:00 -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=yNFVHUulQCNDiyqX2nmhpxJWZEpVPHmMj67swxyAnJQ=; b=geFNOqzL0AZHfWj/CG2btqcZiHgGe4OVtTVMOBrPDRAM4wvoysh+kYR4S6tkjwiM8y u8Iplg0DxUvyMZ2+2tjJJIcLk/Djo8SQw6W1oUuUZze2i7YbNxOaMi448iPuN0mTP18Q D4ExQzk1NPOBktpkdSsOLwvEJJjRhHsGHC9UGlfxFP9o/O+OfweQXJqmbsE6F56fBwvG 2owQyuuJracSZN9by/9Vt1GVBIfqQ7IWWiqLUXcgtmIL5ADW9bmlWSFPVivwR6uiijfz CLP5mX+ij+M3bHdeWZXyO9d1Tm600Sr4Pf36c7yItU9U48x/vUCysOs9wcVu4QfpBvob xINQ== X-Gm-Message-State: APt69E0fsXGvjCzVbkukcjpTymlj+vpV/6x1T6CRW2y8KnpD0g5UR5gm nMA9oPlRZEGUGF6mrrUEHFJcrpD4UkFprUj3h4qmFyseDN6X4kM9ZxDuoLt7Ois3d3mAtPPtvwy 1z9UtE2c8P4jMX1kyelKq9kY3yyeozClQUopQn90Dgeabu15O+YSOVGGEo1du4cXZDg== X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr7976484pfo.247.1529200860084; Sat, 16 Jun 2018 19:01:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIsR2dW67Frjev2AGbJ4V8ueu7HGjSu3s2O4Z0qUiCSQUsxBSoo4BaaP5A6eBQk0bHXgCif X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr7976420pfo.247.1529200858766; Sat, 16 Jun 2018 19:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529200858; cv=none; d=google.com; s=arc-20160816; b=wj3XtWlww07IeIVCYLsjJBxFI7x1ItfFgGCKpTGBw5qUE3EVLH2DMeJIrp7JOjqU4e 8C/3lyD0LxSWSDGzpmBVeQ1RQGsjxEhsW4WFNpK5W2lun/0yYywnw6C0xiV3y7AH0XyR 9Cp3eaUDQHbA3fXoUc5VgQAPv17Q/GwOsYSFltZsOQbZ0tPEi2gNyVmRZgM5iUUIQjK7 ZiMTWtBVZi+Fqera52sWTG50+yN0AlJRy+fJq2hFExiZsfjLR4IwJQmMiegaFZXkkVoT ADM1YEqldTnLuMCxD0fhJ2At2p8EyKdC7RXNuF8KqEMDW/3nQ9lD5kdOSfp6shsanJ6A +0tw== 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=yNFVHUulQCNDiyqX2nmhpxJWZEpVPHmMj67swxyAnJQ=; b=M2jDCL3V0wZMj9Af+7B2AI8U5uqg6jiMlFHq3Y23AJPdQIT9nQ5BkeTJYKDHhiOUO8 uEjhCkDkfvVCv1QmMu/fDrY4CUcch0grbaY2GV5l3nFKyrEcGaOTq6VneeniPe/uEkKP J0wznwIhVBou8N/bJ3Ve4zzqozZrAvqCDTpiCJbKKc1T477K+EzZB68vRBEk1xfZSUXS wfsGGKDN43IQtmeBTuHkQx9UnGxZ2O8pu/HoUhwqRV/ZdY5LgdTDfH9pqvPMV7X9Iezc LEnW3zHcR/sl2GwWbh6aysUp5w8pLYGBqkz9/1/uFyrjb8CU2EyCnQ6uMRlodgkyhOy9 1CEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=p1mzyKvw; 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 n1-v6si11339298pfd.128.2018.06.16.19.00.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Jun 2018 19:00:58 -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=p1mzyKvw; 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=yNFVHUulQCNDiyqX2nmhpxJWZEpVPHmMj67swxyAnJQ=; b=p1mzyKvwWeQapKax5CKf3LvCP 4eroi3VUBIYJzvh/2C7YcZhZS3IGQOZ535q+XmMw2paYiFmrUjrHUZ66FKXsM5V0bF2jtaaI5dTal UhAqB86xX+PMvfMkrNROSJM61+f9QkUxJih6mgEK3Du5gTU91WQI8K1/22voLwtWMrF6OlqKTsk8Q N4ClQFEKoWBR8PL4CCm+TVLzVDAoCjmwcsczHrvkdxImX+gKXYufVh3YbWplnS7Hiqolh9U1Qsq+n xaTY2LKVKQiyzm2tdfZs5z/P/epnVihk3OF9zl1x3AxD2p9TuhgKQSs12vb1/jivP8HYnIaiq/zGg 429qMsPvA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUMzu-0001Fj-UL; Sun, 17 Jun 2018 02:00:54 +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 v14 03/74] dax: Fix use of zero page Date: Sat, 16 Jun 2018 18:59:41 -0700 Message-Id: <20180617020052.4759-4-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180617020052.4759-1-willy@infradead.org> References: <20180617020052.4759-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 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 467601a134bc..c7917b46a75b 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1093,21 +1093,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; }