Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4233396imm; Mon, 11 Jun 2018 09:01:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLmd97gvkZATEqNRKtnAVcsY+oSjLdDdVgePDk5Xml+jq8E/Duw+ER0FlezHpXWcu53f4oO X-Received: by 2002:a65:5c46:: with SMTP id v6-v6mr15360382pgr.127.1528732886881; Mon, 11 Jun 2018 09:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528732886; cv=none; d=google.com; s=arc-20160816; b=hIObSUk/9Vk/u/9RF2BNKqSE4cnM8VxwNYJw/oeFLxeWYx5qxo7DGJFcw49T3x7455 ike7RP86Ae8hMKvV5aX6aG+LM3ZBCSqDBVl2ppJJ5s3Dc+RMpEYpZ3A0e7mvgzL7OOXT R0lAtRenx1VEdBWqE9/w++3vIlsZmiwRTlttq8FEKSX0ZIZ2Y90SjEQNtnIrkr79IhuE R2bDmdXUR28kKgJ3g5RlQKdtOXPIMOrguENZ+olh9NRf3kAiQpvzSxPrfg2O+4pC8gWy QEGVPtSVOW7uOzseZudPxUb1N8zoQ3L/cljXr/YR30aoiJ+LTQQbPj/if7WSGucJndut YSFw== 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=G/pDhvKl+uFexWRO8XwgAOj1N5yQbaGUPsSjqf8xfZQ=; b=pFESTqHhx5jRWJj2SIq/VqtYcoKSdjnZME+jjFlo5MUTieb3ICf+VZyORDOoeMWfdI vp9YFb8BeX6XbSn6CduxAyVXvF1BFGxh2XZcLwTdWL26EFd+CK7PeJ70aGwlo2YjHPHs ojxGcXTX1CHHIGOb9k2EY69OvITwG4Dt/0Ki53SH7SacsG8jEaVEwndLvtbXjC2HyYod Bqmh5ul+Z+wIK0oR4H8WA4pOrdVshcLAyOW3C3YeSyrhwnLgCcE7uvrIgDPz50fX0zaK zj4wZLaRF404QtZnX/iBqTWKlnSZDo20+9avquLYAELckIpUztaLHHjzIUafKFijC+YF 3kHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fw8c7Nbi; 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 m1-v6si20679247pfk.56.2018.06.11.09.01.10; Mon, 11 Jun 2018 09:01:26 -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=fw8c7Nbi; 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 S933525AbeFKOG4 (ORCPT + 99 others); Mon, 11 Jun 2018 10:06:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45078 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933223AbeFKOGr (ORCPT ); Mon, 11 Jun 2018 10:06:47 -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=G/pDhvKl+uFexWRO8XwgAOj1N5yQbaGUPsSjqf8xfZQ=; b=fw8c7NbiuN9PtMIWk1uZpKx6z KBBwsD2BCmHnq3Vp9lvdMrkPfm83xJ/JHkQq8glzPc9tH1hfkdmy5ZabfMMXvfmaByiCWLNZfHB9a uHmA9RdC3tCqUQVhmhewkfptFRgB3m8n59TkGsXgBeEqYXvxAWzZZZMv28Y84xIUUDWSaOX/UeyUh 1Oeyr1sihyuLcVZSFah7El32di540yd/GjKbbQgLRb68jUv3P/tuFG6skdAt7IwjRG5Z3V9ycO/s4 mTNf1OFs1buo+oUT9LJsd6HSL9XqbbcT0PQCJoaTG1gEg1GY84tYsiKOVED+wwjoRxuTXtFxbCyTj dfxc2Dg9A==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSNT5-0004dj-8H; Mon, 11 Jun 2018 14:06:47 +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 19/72] page cache: Rearrange address_space Date: Mon, 11 Jun 2018 07:05:46 -0700 Message-Id: <20180611140639.17215-20-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> 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 e9aeed6308aa..aec2b05b056f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -397,24 +397,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.17.1