Received: by 10.213.65.68 with SMTP id h4csp357399imn; Tue, 13 Mar 2018 06:40:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELs5LKdpUh86JJf+pqH2efsVYZuzNZ77mLIEnCa9D8B2IQQUm3sIc9WPi5L1zLsiz4nweCiV X-Received: by 10.99.42.83 with SMTP id q80mr539559pgq.115.1520948433250; Tue, 13 Mar 2018 06:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520948433; cv=none; d=google.com; s=arc-20160816; b=ksbgacfL4X21NXChZVxHu7R2X8eOX5zG/wuc77oQBEgSYTrt70To9tTxDf9/npxSEy 7n0lfOVX9xUngveJfeKP3FQJhzmWNCQHURiluoZwdv0QUGF3vliV4hbXXPatMnw9wYij F8jMEit0RCZamqmqsSodc73srnvujAlRATbZd5ToweG3/FUNYCsMZpyhjl065WQbIlNJ WULsczzWOjxKbWkwPlEHHgwWzekjyuqOi5KGEMz/aEL0/i+cPYA9t0+gzgsPe+UHLRoL 5JUux56bNRMwgztAYeysJACl4WXBhhpg0m2GiZiygYWnFE1mrMk9NYVBeLwUzBe5ohVr w6NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=D4d5gtQa9o15AWcdL9cD7hH2G6PLIMjUfGfqGUcoXxw=; b=e+N3Vl2mKkAmY1YKcKvVuYrzJqLPyBnn1A8bIB90ZxNx8TceXRjXODUWfU6Bi6+tGc eVvpkgMgaUeK/vXAx13GQKoYNI2X2EYbTINKCe0nBX2t3D+idbLTuG4/ZeheVtEkyffd 7V0c79RN+whCn8TFaImqrmh5xdyLoH0eoNglepqCHBjtqk3PHTb3YNQ1hZI2wJ4Ow10p eVJ1T1JHe50qJUWvroM4Ej2dI316/kgiIh7ndjUEn9OipS5DF+pMecs7b2KZ4rZrOGvU kn0TydyPh81NQdt/7Cb+sxuev9/x1WPthl51dC9M1p/3kpT4LOzFGXGkc3sGTy5+NUl0 o62Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g0hTkOf8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x22si135257pfm.321.2018.03.13.06.40.19; Tue, 13 Mar 2018 06:40:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g0hTkOf8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932582AbeCMN1B (ORCPT + 99 others); Tue, 13 Mar 2018 09:27:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35176 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbeCMN0w (ORCPT ); Tue, 13 Mar 2018 09:26:52 -0400 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=D4d5gtQa9o15AWcdL9cD7hH2G6PLIMjUfGfqGUcoXxw=; b=g0hTkOf8qlg3iBmXq1SBlDNqm +4OhwVDCv/N0LbXs0NHtFB8WeH9zcZ83XTCpuQ8ACMTtGbEIUfoMnoTUgg5hyLVc2KLfZsQd9oWD+ kQuYdIK865u1xc1coOJyLWPSk9uvQ3rMPKnUA4pYo2313+hxakKLj5pxUBE++Iuw2kQ4pNY2+IOkr YfZGCJVql+7e6Q+TfJra93dBQ7RlS/dZEViZEVpXQlb/qPnL17TIAks/smzmXWsvo87u4JAptPsSk Dy6BsDpHhNyeC9WzcDrVVY70Mhc4/xM13CG1ZOJlvVkjnjsOYxxiGfmihZ+zq13KQxdeCmlSu5mSN gTx6b7vTg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evjx4-0004dN-Pv; Tue, 13 Mar 2018 13:26:50 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH v9 24/61] page cache: Rearrange address_space Date: Tue, 13 Mar 2018 06:26:02 -0700 Message-Id: <20180313132639.17387-25-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313132639.17387-1-willy@infradead.org> References: <20180313132639.17387-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox Change i_pages from a radix_tree_root to an xarray, convert the documentation into kernel-doc format and change the order of the elements to pack them better on 64-bit systems. Signed-off-by: Matthew Wilcox --- include/linux/fs.h | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index c75902f30bfb..bb0731c05246 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -389,24 +389,40 @@ int pagecache_write_end(struct file *, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata); +/** + * struct address_space - Contents of a cacheable, mappable object. + * @host: Owner, either the inode or the block_device. + * @i_pages: Cached pages. + * @gfp_mask: Memory allocation flags to use for allocating pages. + * @i_mmap_writable: Number of VM_SHARED mappings. + * @i_mmap: Tree of private and shared mappings. + * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable. + * @nrpages: Number of page entries, protected by the i_pages lock. + * @nrexceptional: Shadow or DAX entries, protected by the i_pages lock. + * @writeback_index: Writeback starts here. + * @a_ops: Methods. + * @flags: Error bits and flags (AS_*). + * @wb_err: The most recent error which has occurred. + * @private_lock: For use by the owner of the address_space. + * @private_list: For use by the owner of the address_space. + * @private_data: For use by the owner of the address_space. + */ struct address_space { - struct inode *host; /* owner: inode, block_device */ - struct radix_tree_root i_pages; /* cached pages */ - atomic_t i_mmap_writable;/* count VM_SHARED mappings */ - struct rb_root_cached i_mmap; /* tree of private and shared mappings */ - struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ - /* Protected by the i_pages lock */ - unsigned long nrpages; /* number of total pages */ - /* number of shadow or DAX exceptional entries */ + struct inode *host; + struct xarray i_pages; + gfp_t gfp_mask; + atomic_t i_mmap_writable; + struct rb_root_cached i_mmap; + struct rw_semaphore i_mmap_rwsem; + unsigned long nrpages; unsigned long nrexceptional; - pgoff_t writeback_index;/* writeback starts here */ - const struct address_space_operations *a_ops; /* methods */ - unsigned long flags; /* error bits */ - spinlock_t private_lock; /* for use by the address_space */ - gfp_t gfp_mask; /* implicit gfp mask for allocations */ - struct list_head private_list; /* for use by the address_space */ - void *private_data; /* ditto */ + pgoff_t writeback_index; + const struct address_space_operations *a_ops; + unsigned long flags; errseq_t wb_err; + spinlock_t private_lock; + struct list_head private_list; + void *private_data; } __attribute__((aligned(sizeof(long)))) __randomize_layout; /* * On most architectures that alignment is already the case; but -- 2.16.1