From patchwork Tue Aug 4 16:17:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11700601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 328D316B1 for ; Tue, 4 Aug 2020 16:18:12 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 263AE2177B for ; Tue, 4 Aug 2020 16:18:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OHO238re" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 263AE2177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1788E12AC295A; Tue, 4 Aug 2020 09:18:08 -0700 (PDT) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver= Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0339C12976555 for ; Tue, 4 Aug 2020 09:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=+aj+hTcmyQ/ZxfRwwyhlTJL7pLaB+BkTSJfzBBgI/q8=; b=OHO238reNTCqUaIKEk+I2PVyf/ 8z9DmI82B4usqHm6Sy3qgsL1BcZnsELUqPX5VD6f8Alk7w07CcozvEfAWNalxZZ8CkY4NKVZVQ/Da CiufiKZyhaI2viUdnj08hu6WNWDmGz04xOh/lwGsbtGzT14Lc2QOud0vXTnJIw0Uy2PPFvPioXetF cEjX7iwUpdLCMPo/+2OHAZj7arwcfR/aQ2g7wkq7Xn5k6q2u4uj/2ucVzje1a7CqrEd1OnZIVLel/ iWl9UMS/c71q2TlQnHwx/i8VjO9FoRh+ZBaHyZecTNSe/qMYq6nCUQ5XGe5+DGRGhGqRtm5BW/D+C pE9HMj8Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zdV-0002e1-IW; Tue, 04 Aug 2020 16:17:57 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/4] mm: Introduce and use page_cache_empty Date: Tue, 4 Aug 2020 17:17:52 +0100 Message-Id: <20200804161755.10100-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200804161755.10100-1-willy@infradead.org> References: <20200804161755.10100-1-willy@infradead.org> MIME-Version: 1.0 Message-ID-Hash: 3KTPDGLQVQ5V6SXZINFISJ7YBPDEDAKS X-Message-ID-Hash: 3KTPDGLQVQ5V6SXZINFISJ7YBPDEDAKS X-MailFrom: willy@infradead.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Matthew Wilcox (Oracle)" , linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Instead of checking the two counters (nrpages and nrexceptional), we can just check whether i_pages is empty. Signed-off-by: Matthew Wilcox (Oracle) --- fs/block_dev.c | 2 +- fs/dax.c | 2 +- include/linux/pagemap.h | 5 +++++ mm/truncate.c | 18 +++--------------- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 0ae656e022fd..2a77bd2c6144 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -79,7 +79,7 @@ static void kill_bdev(struct block_device *bdev) { struct address_space *mapping = bdev->bd_inode->i_mapping; - if (mapping->nrpages == 0 && mapping->nrexceptional == 0) + if (page_cache_empty(mapping)) return; invalidate_bh_lrus(); diff --git a/fs/dax.c b/fs/dax.c index 11b16729b86f..2f75ee2cd41f 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -949,7 +949,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, if (WARN_ON_ONCE(inode->i_blkbits != PAGE_SHIFT)) return -EIO; - if (!mapping->nrexceptional || wbc->sync_mode != WB_SYNC_ALL) + if (page_cache_empty(mapping) || wbc->sync_mode != WB_SYNC_ALL) return 0; trace_dax_writeback_range(inode, xas.xa_index, end_index); diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 484a36185bb5..a474a92a2a72 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -18,6 +18,11 @@ struct pagevec; +static inline bool page_cache_empty(struct address_space *mapping) +{ + return xa_empty(&mapping->i_pages); +} + /* * Bits in mapping->flags. */ diff --git a/mm/truncate.c b/mm/truncate.c index dd9ebc1da356..7c4c8ac140be 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -300,7 +300,7 @@ void truncate_inode_pages_range(struct address_space *mapping, pgoff_t index; int i; - if (mapping->nrpages == 0 && mapping->nrexceptional == 0) + if (page_cache_empty(mapping)) goto out; /* Offsets within partial pages */ @@ -488,9 +488,6 @@ EXPORT_SYMBOL(truncate_inode_pages); */ void truncate_inode_pages_final(struct address_space *mapping) { - unsigned long nrexceptional; - unsigned long nrpages; - /* * Page reclaim can not participate in regular inode lifetime * management (can't call iput()) and thus can race with the @@ -500,16 +497,7 @@ void truncate_inode_pages_final(struct address_space *mapping) */ mapping_set_exiting(mapping); - /* - * When reclaim installs eviction entries, it increases - * nrexceptional first, then decreases nrpages. Make sure we see - * this in the right order or we might miss an entry. - */ - nrpages = mapping->nrpages; - smp_rmb(); - nrexceptional = mapping->nrexceptional; - - if (nrpages || nrexceptional) { + if (!page_cache_empty(mapping)) { /* * As truncation uses a lockless tree lookup, cycle * the tree lock to make sure any ongoing tree @@ -692,7 +680,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, int ret2 = 0; int did_range_unmap = 0; - if (mapping->nrpages == 0 && mapping->nrexceptional == 0) + if (page_cache_empty(mapping)) goto out; pagevec_init(&pvec); From patchwork Tue Aug 4 16:17:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11700587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D91CB6C1 for ; Tue, 4 Aug 2020 16:18:06 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C07802086A for ; Tue, 4 Aug 2020 16:18:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HfmGtJIL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C07802086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7C20C12976557; Tue, 4 Aug 2020 09:18:06 -0700 (PDT) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver= Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F3D1211B718F0 for ; Tue, 4 Aug 2020 09:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=SGwNWjKjTMY0/QHlMsmsqDcOZ0fi2PHNBBwqVmM+U3g=; b=HfmGtJIL/+sXrLAdLC03ufZh/t gnYsPCGK2KObaKom8GqzlgjYkN7u0H8cWx3RNh1g7P0e+9VZxkOAJYbT2/B3iYWUZAcV2ng2r1Pqw eiHoKAHTOIZ5D9UFNEnQdTmg9Jlk3a4dRfEyTnAY3zCdiIjASO0USay5VwMsmXWSaQrFzWBI/YKdt kpyrUqRPckp5H9zERxzuTu6QOrBGw1eWXFeQzHXH4GV01SYVz+M9q7z55DNUoKIua4OPR8malpyLP nGFBhVtvnLqdu5dpnDyg4sUCN6uyFmDdN6BI6s/eQhnv7CcaM4dlo53j5rzmpeGqu7LufLw7khNfj GVkYV4qw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zdV-0002e6-Pd; Tue, 04 Aug 2020 16:17:57 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/4] mm: Stop accounting shadow entries Date: Tue, 4 Aug 2020 17:17:53 +0100 Message-Id: <20200804161755.10100-3-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200804161755.10100-1-willy@infradead.org> References: <20200804161755.10100-1-willy@infradead.org> MIME-Version: 1.0 Message-ID-Hash: 6JF7UV333LBIGXH6GF44XMSLWJZA43LF X-Message-ID-Hash: 6JF7UV333LBIGXH6GF44XMSLWJZA43LF X-MailFrom: willy@infradead.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Matthew Wilcox (Oracle)" , linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: We no longer need to keep track of how many shadow entries are present in a mapping. This saves a few writes to the inode and memory barriers. Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 12 ------------ mm/truncate.c | 1 - mm/workingset.c | 1 - 3 files changed, 14 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 76383d558b7c..7c3f97bd6dcd 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -139,17 +139,6 @@ static void page_cache_delete(struct address_space *mapping, page->mapping = NULL; /* Leave page->index set: truncation lookup relies upon it */ - - if (shadow) { - mapping->nrexceptional += nr; - /* - * Make sure the nrexceptional update is committed before - * the nrpages update so that final truncate racing - * with reclaim does not see both counters 0 at the - * same time and miss a shadow entry. - */ - smp_wmb(); - } mapping->nrpages -= nr; } @@ -860,7 +849,6 @@ static int __add_to_page_cache_locked(struct page *page, goto unlock; if (xa_is_value(old)) { - mapping->nrexceptional--; if (shadowp) *shadowp = old; } diff --git a/mm/truncate.c b/mm/truncate.c index 7c4c8ac140be..a59184793607 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -40,7 +40,6 @@ static inline void __clear_shadow_entry(struct address_space *mapping, if (xas_load(&xas) != entry) return; xas_store(&xas, NULL); - mapping->nrexceptional--; } static void clear_shadow_entry(struct address_space *mapping, pgoff_t index, diff --git a/mm/workingset.c b/mm/workingset.c index fdeabea54e77..0649bfb1ca33 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -547,7 +547,6 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, goto out_invalid; if (WARN_ON_ONCE(node->count != node->nr_values)) goto out_invalid; - mapping->nrexceptional -= node->nr_values; xas.xa_node = xa_parent_locked(&mapping->i_pages, node); xas.xa_offset = node->offset; xas.xa_shift = node->shift + XA_CHUNK_SHIFT; From patchwork Tue Aug 4 16:17:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11700589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4535B16B1 for ; Tue, 4 Aug 2020 16:18:07 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3852B2086A for ; Tue, 4 Aug 2020 16:18:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rFRGehJj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3852B2086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A50AB1297655B; Tue, 4 Aug 2020 09:18:06 -0700 (PDT) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver= Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 009C0126DED9E for ; Tue, 4 Aug 2020 09:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=FP1uJLv/iUGGxCHzPq47tYJZ9XtyvZoBsMXwg0wUi4E=; b=rFRGehJj3pybPeMWt2c7DpXfhS 2c5gWioEVFC4vbqL+nHIjlXm++/jLTEwG+QaU+LZkEFGYZQqtEYIJsj5heg36HAHMrz3cj9ptK4hg Sw23NSOAx/KZVZ00WlLnHIcmNjQrMO3I8v5UjCfjR3F5Vh7Q2gQlyymA7oEOKP9xfUExqHKx/zoMJ KEZYcyqjrz6e7WZ/VQahcr89YjCpeQNriZr79zFrnF5WkhtaR77Hag4XO7OgL+rJjhZn6LB2/qK/C VCWjJGFrZP1dvR46ID4ngyx8Za1CcPmIt4PBJJJXUny2/41rSeAC2/gIGbVNUuncI7oPWE5gk7kRT /LAAOQOA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zdW-0002eF-3b; Tue, 04 Aug 2020 16:17:58 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/4] dax: Account DAX entries as nrpages Date: Tue, 4 Aug 2020 17:17:54 +0100 Message-Id: <20200804161755.10100-4-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200804161755.10100-1-willy@infradead.org> References: <20200804161755.10100-1-willy@infradead.org> MIME-Version: 1.0 Message-ID-Hash: JO7FBSCW52YX635TUAWCJ35SHL24Q4O6 X-Message-ID-Hash: JO7FBSCW52YX635TUAWCJ35SHL24Q4O6 X-MailFrom: willy@infradead.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Matthew Wilcox (Oracle)" , linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Simplify mapping_needs_writeback() by accounting DAX entries as pages instead of exceptional entries. Signed-off-by: Matthew Wilcox (Oracle) --- fs/dax.c | 6 +++--- mm/filemap.c | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 2f75ee2cd41f..71ddab04d91d 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -525,7 +525,7 @@ static void *grab_mapping_entry(struct xa_state *xas, dax_disassociate_entry(entry, mapping, false); xas_store(xas, NULL); /* undo the PMD join */ dax_wake_entry(xas, entry, true); - mapping->nrexceptional--; + mapping->nrpages -= PG_PMD_NR; entry = NULL; xas_set(xas, index); } @@ -541,7 +541,7 @@ static void *grab_mapping_entry(struct xa_state *xas, dax_lock_entry(xas, entry); if (xas_error(xas)) goto out_unlock; - mapping->nrexceptional++; + mapping->nrpages += 1UL << order; } out_unlock: @@ -644,7 +644,7 @@ static int __dax_invalidate_entry(struct address_space *mapping, goto out; dax_disassociate_entry(entry, mapping, trunc); xas_store(&xas, NULL); - mapping->nrexceptional--; + mapping->nrpages -= dax_entry_order(entry); ret = 1; out: put_unlocked_entry(&xas, entry); diff --git a/mm/filemap.c b/mm/filemap.c index 7c3f97bd6dcd..ef8ecfba7f9b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -615,9 +615,6 @@ EXPORT_SYMBOL(filemap_fdatawait_keep_errors); /* Returns true if writeback might be needed or already in progress. */ static bool mapping_needs_writeback(struct address_space *mapping) { - if (dax_mapping(mapping)) - return mapping->nrexceptional; - return mapping->nrpages; } From patchwork Tue Aug 4 16:17:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11700591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2A84138C for ; Tue, 4 Aug 2020 16:18:08 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E45812086A for ; Tue, 4 Aug 2020 16:18:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="i6NSMYfR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E45812086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CF7021297655E; Tue, 4 Aug 2020 09:18:06 -0700 (PDT) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver= Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0185012976553 for ; Tue, 4 Aug 2020 09:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=fw3P6kp9M4/LmEF88EWSj+1JuY5UZSo/KVP/TRf78l8=; b=i6NSMYfRnEAOcV0wowy8TXs3Lh RArlH0wUi1U4zuG2ICK2Ip9PCaDlBfRVCt6yTebj71YdXn2ht243CqIbJqrqyc4JEwbau7gkkh680 AKybdh0bWgb/mYQ/GoTwsmUy2ewOsU7r2ONx29i7nnmYpYuCV/hz5Cz840Un1+gItCQpOUYA7YyCY yABsHxrNBv/tgP50buLIa1eBMsvbpwf8vPREWVMAt9VjxxbZ/xEMxXm/ClMX3dX6eudtNy239CHs1 6EWWokN+LR3WbdTqtUDuIvIcj5J3Tvu9uiPAyJ/Lxpi5lD39jhhhDR4/SLTzYvrwq9FGL6RANwWHw 0hT86cDw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2zdW-0002eM-Ec; Tue, 04 Aug 2020 16:17:58 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 4/4] mm: Remove nrexceptional from inode Date: Tue, 4 Aug 2020 17:17:55 +0100 Message-Id: <20200804161755.10100-5-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200804161755.10100-1-willy@infradead.org> References: <20200804161755.10100-1-willy@infradead.org> MIME-Version: 1.0 Message-ID-Hash: J752WMNTBWO2KPGCZMNZ7I4IISBIGNCU X-Message-ID-Hash: J752WMNTBWO2KPGCZMNZ7I4IISBIGNCU X-MailFrom: willy@infradead.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Matthew Wilcox (Oracle)" , linux-nvdimm@lists.01.org X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: We no longer track anything in nrexceptional, so remove it, saving 8 bytes per inode. Signed-off-by: Matthew Wilcox (Oracle) --- fs/inode.c | 2 +- include/linux/fs.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 72c4c347afb7..b5c4aff077b7 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -528,7 +528,7 @@ void clear_inode(struct inode *inode) */ xa_lock_irq(&inode->i_data.i_pages); BUG_ON(inode->i_data.nrpages); - BUG_ON(inode->i_data.nrexceptional); + BUG_ON(!page_cache_empty(&inode->i_data)); xa_unlock_irq(&inode->i_data.i_pages); BUG_ON(!list_empty(&inode->i_data.private_list)); BUG_ON(!(inode->i_state & I_FREEING)); diff --git a/include/linux/fs.h b/include/linux/fs.h index f5abba86107d..4fd8923cba43 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -436,7 +436,6 @@ int pagecache_write_end(struct file *, struct address_space *mapping, * @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_*). @@ -457,7 +456,6 @@ struct address_space { struct rb_root_cached i_mmap; struct rw_semaphore i_mmap_rwsem; unsigned long nrpages; - unsigned long nrexceptional; pgoff_t writeback_index; const struct address_space_operations *a_ops; unsigned long flags;