From patchwork Tue Nov 24 04:15:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11927027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF966C63798 for ; Tue, 24 Nov 2020 04:15:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C3E82085B for ; Tue, 24 Nov 2020 04:15:13 +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="ML/7j5/z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C3E82085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 499BB6B006E; Mon, 23 Nov 2020 23:15:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D7EC6B0070; Mon, 23 Nov 2020 23:15:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24EFA6B0071; Mon, 23 Nov 2020 23:15:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id DFAC06B006E for ; Mon, 23 Nov 2020 23:15:12 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8087E1EE6 for ; Tue, 24 Nov 2020 04:15:12 +0000 (UTC) X-FDA: 77517996864.19.month42_560e15f2736b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 5CB811ACEA4 for ; Tue, 24 Nov 2020 04:15:12 +0000 (UTC) X-HE-Tag: month42_560e15f2736b X-Filterd-Recvd-Size: 5083 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 04:15:11 +0000 (UTC) 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: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=yovAbVNekdUqnaLLLsFGB6pe3G97F8Xlt5MNxptk1kI=; b=ML/7j5/zMDPYuELKihEQtbVrM0 ormvOmT3gTMGsfhRdSFz2WV3Ce8eqJYrCPJlepf41poFtsjt8B6iQKV8DaCdb3MeRFRP4XV6mMMEM /2L3coQxbbOBzQj8AMG2c1LVvT4waGhn4UL+c+c0cUjhM9wnfa6mXqiC4gDGzN6qfJ5Bm+RRgiJRS VW6j41rSG+6vFbsBD6sKvPXQ2iuOTGcdWdKx4W27Zba7my5HKux3V0ffa5U873DVcKlh75NSq4yiB gqsI1/KkxwNEYulrVFfKIx0+Z3WJTsheF1HH9faAK9y1QiZc9QqS/PwapCr31p0EOqxpfhd6gAXAx uSTw423w==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1khPjR-0007d3-RY; Tue, 24 Nov 2020 04:15:09 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 1/4] mm: Support THPs in zero_user_segments Date: Tue, 24 Nov 2020 04:15:04 +0000 Message-Id: <20201124041507.28996-1-willy@infradead.org> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 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: We can only kmap() one subpage of a THP at a time, so loop over all relevant subpages, skipping ones which don't need to be zeroed. This is too large to inline when THPs are enabled and we actually need highmem, so put it in highmem.c. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/highmem.h | 19 ++++++++++--- mm/highmem.c | 59 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 7d098bd621f6..f20916707ff9 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -193,13 +193,22 @@ static inline void clear_highpage(struct page *page) kunmap_atomic(kaddr); } +/* + * If we pass in a base or tail page, we can zero up to PAGE_SIZE. + * If we pass in a head page, we can zero up to the size of the compound page. + */ +#if defined(CONFIG_HIGHMEM) && defined(CONFIG_TRANSPARENT_HUGEPAGE) +void zero_user_segments(struct page *page, unsigned start1, unsigned end1, + unsigned start2, unsigned end2); +#else /* !HIGHMEM || !TRANSPARENT_HUGEPAGE */ static inline void zero_user_segments(struct page *page, - unsigned start1, unsigned end1, - unsigned start2, unsigned end2) + unsigned start1, unsigned end1, + unsigned start2, unsigned end2) { void *kaddr = kmap_atomic(page); + unsigned int i; - BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE); + BUG_ON(end1 > page_size(page) || end2 > page_size(page)); if (end1 > start1) memset(kaddr + start1, 0, end1 - start1); @@ -208,8 +217,10 @@ static inline void zero_user_segments(struct page *page, memset(kaddr + start2, 0, end2 - start2); kunmap_atomic(kaddr); - flush_dcache_page(page); + for (i = 0; i < compound_nr(page); i++) + flush_dcache_page(page + i); } +#endif /* !HIGHMEM || !TRANSPARENT_HUGEPAGE */ static inline void zero_user_segment(struct page *page, unsigned start, unsigned end) diff --git a/mm/highmem.c b/mm/highmem.c index 54bd233846c9..3e1087f2b735 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -359,6 +359,65 @@ void kunmap_high(struct page *page) wake_up(pkmap_map_wait); } EXPORT_SYMBOL(kunmap_high); + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +void zero_user_segments(struct page *page, unsigned start1, unsigned end1, + unsigned start2, unsigned end2) +{ + unsigned int i; + + BUG_ON(end1 > page_size(page) || end2 > page_size(page)); + + for (i = 0; i < compound_nr(page); i++) { + void *kaddr; + unsigned this_end; + + if (end1 == 0 && start2 >= PAGE_SIZE) { + start2 -= PAGE_SIZE; + end2 -= PAGE_SIZE; + continue; + } + + if (start1 >= PAGE_SIZE) { + start1 -= PAGE_SIZE; + end1 -= PAGE_SIZE; + if (start2) { + start2 -= PAGE_SIZE; + end2 -= PAGE_SIZE; + } + continue; + } + + kaddr = kmap_atomic(page + i); + + this_end = min_t(unsigned, end1, PAGE_SIZE); + if (end1 > start1) + memset(kaddr + start1, 0, this_end - start1); + end1 -= this_end; + start1 = 0; + + if (start2 >= PAGE_SIZE) { + start2 -= PAGE_SIZE; + end2 -= PAGE_SIZE; + } else { + this_end = min_t(unsigned, end2, PAGE_SIZE); + if (end2 > start2) + memset(kaddr + start2, 0, this_end - start2); + end2 -= this_end; + start2 = 0; + } + + kunmap_atomic(kaddr); + flush_dcache_page(page + i); + + if (!end1 && !end2) + break; + } + + BUG_ON((start1 | start2 | end1 | end2) != 0); +} +EXPORT_SYMBOL(zero_user_segments); +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif /* CONFIG_HIGHMEM */ #ifdef CONFIG_KMAP_LOCAL From patchwork Tue Nov 24 04:15:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11927029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B665BC64E75 for ; Tue, 24 Nov 2020 04:15:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D09420857 for ; Tue, 24 Nov 2020 04:15:15 +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="a6LVv1rh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D09420857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A6F886B0073; Mon, 23 Nov 2020 23:15:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 92C486B0071; Mon, 23 Nov 2020 23:15:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BE296B0073; Mon, 23 Nov 2020 23:15:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 3F3CC6B0070 for ; Mon, 23 Nov 2020 23:15:14 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E4AA41EE6 for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) X-FDA: 77517996906.18.pain69_5316f0f2736b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id C4BB9100ED0DE for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) X-HE-Tag: pain69_5316f0f2736b X-Filterd-Recvd-Size: 1980 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) 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=o/EIXsm92EOGC4c9TKEog7qFg43164111Apvg3R18zw=; b=a6LVv1rhDeZEsgTB360TOKmELT RRDD6XNROQBKcg+MMu7mWMtWEOvvipH8cb4jMgU9WNlQSSQFYXzQlYTfK6lP1b0ccxsPToCDaPOWx n33HJOMIx3SSDfoMciOOBKU5kHhbjQpgBnZXk0Uk02ZWNuvf0PwuIDmHn6fg5LsptKAHKAWbl7txf SxbFIju+UYDKRN4VhqLkkixML+hGxRGXjzmK4n2jrB6wS2Z34tHfJ+w3+IkYYix5hvAOUN+JkN672 H+qlrkCHTS6FZQa1IIj6IOAfH/tJ2do3XoQ6X7dkJjFWYmakrv6L1EiH9vcZiXhCFCehxpREfPgDc ulngFxoA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1khPjS-0007d6-2l; Tue, 24 Nov 2020 04:15:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 2/4] fix mm-filemap-add-helper-for-finding-pages.patch Date: Tue, 24 Nov 2020 04:15:05 +0000 Message-Id: <20201124041507.28996-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201124041507.28996-1-willy@infradead.org> References: <20201124041507.28996-1-willy@infradead.org> MIME-Version: 1.0 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: --- mm/filemap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 7c83ee17f756..f3b448431bd4 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1858,7 +1858,6 @@ static inline struct page *find_get_entry(struct xa_state *xas, pgoff_t max, put_page(page); goto reset; } - VM_BUG_ON_PAGE(!thp_contains(page, xas->xa_index), page); return page; reset: From patchwork Tue Nov 24 04:15:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11927031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E6DAC64E69 for ; Tue, 24 Nov 2020 04:15:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C3A342085B for ; Tue, 24 Nov 2020 04:15:16 +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="CyGAmAuQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3A342085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CF9E16B0071; Mon, 23 Nov 2020 23:15:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A6DE76B0070; Mon, 23 Nov 2020 23:15:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B75A6B0074; Mon, 23 Nov 2020 23:15:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id 4FFAB6B0071 for ; Mon, 23 Nov 2020 23:15:14 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E63E9181AEF1E for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) X-FDA: 77517996906.17.cub39_550c51f2736b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id CA290180D0181 for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) X-HE-Tag: cub39_550c51f2736b X-Filterd-Recvd-Size: 2082 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) 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=cOk4KIrOY87QhCqcR9w9RyYMLg3R6mkmgaTv03dWKPI=; b=CyGAmAuQ1QZxL/Zc/2hNl+lni7 MChC3LtFdpQZY+VFCqFeHxcis+yhrs0GwNbaO50lr2te1YCmxJwd1b7Er0uk7hq7Y9eN2ZFwr/vFd gHs/F1X6IihX+hEiSm6vCzfKEMQfFoqQv7rWusDXfQVGUO1M4FBmo2vBnLc3FYKdSw0t4QwckI+SY vjc4nr+yT1cqXYbgIdM915cXd1z9TxsOClPg+s6ODqwePDzRdFHt4lGNfVu9Myn0AG45M29oJ4YpM LYR/nWESKXG0uFzgdYP/dA20gIcR9CwXZrrPvOTOOJLkR8aeOAyEEOBlfyHuERjmbYrb//a98sTug 4bUcnK7Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1khPjS-0007dB-AU; Tue, 24 Nov 2020 04:15:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 3/4] fix mm-add-and-use-find_lock_entries.patch Date: Tue, 24 Nov 2020 04:15:06 +0000 Message-Id: <20201124041507.28996-3-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201124041507.28996-1-willy@infradead.org> References: <20201124041507.28996-1-willy@infradead.org> MIME-Version: 1.0 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: --- mm/filemap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index f3b448431bd4..7dfd7024d361 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1941,6 +1941,8 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t start, goto put; if (page->mapping != mapping || PageWriteback(page)) goto unlock; + VM_BUG_ON_PAGE(!thp_contains(page, xas.xa_index), + page); } indices[pvec->nr] = xas.xa_index; if (!pagevec_add(pvec, page)) From patchwork Tue Nov 24 04:15:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11927033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61B9FC64E7B for ; Tue, 24 Nov 2020 04:15:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D10B82085B for ; Tue, 24 Nov 2020 04:15:18 +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="MHKss//i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D10B82085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4EA556B0070; Mon, 23 Nov 2020 23:15:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 452046B0072; Mon, 23 Nov 2020 23:15:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16A7A6B0074; Mon, 23 Nov 2020 23:15:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id BD5E16B0072 for ; Mon, 23 Nov 2020 23:15:14 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6CF548249980 for ; Tue, 24 Nov 2020 04:15:14 +0000 (UTC) X-FDA: 77517996948.01.unit83_3b182cf2736b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 4BF1D10047E12 for ; Tue, 24 Nov 2020 04:15:14 +0000 (UTC) X-HE-Tag: unit83_3b182cf2736b X-Filterd-Recvd-Size: 2021 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 04:15:13 +0000 (UTC) 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=MlDzVXp67hzhR9WQ8vd0SvU+X2KXl2zCY0VAy+Iexyg=; b=MHKss//ik26TXbUvjYYRWl3tRl 37nc9taWc2Gwbk4M5/1yvqKqTAtc45WNUEyS3f7hq1ZKehCNcZeEGvOryl8N22t1FlKFmFOBt5FFy m4Zh9gUYfifcObBRieUCoMwo2B/X9EgqxoREs1HuF7VSms1v+Cj2YpyS+HuvwpM3CdDmM5w17dpT9 gEzyFwSGnXJOZVtym8g+ehcHbbIsmM1yEWltvrzQS64vOssbiEENB4omMM9ygVvDLrmSpsGV332Io 2XtKeo9sgcIkj+AdIF40PEdi470IAajnHV07CXUQ73Mfe8zRcI+y8VUKZeYeYolhP1q3SqbFgdvNf FbMQYZiw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1khPjS-0007dK-Ip; Tue, 24 Nov 2020 04:15:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 4/4] fix mm-filemap-add-mapping_seek_hole_data.patch Date: Tue, 24 Nov 2020 04:15:07 +0000 Message-Id: <20201124041507.28996-4-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201124041507.28996-1-willy@infradead.org> References: <20201124041507.28996-1-willy@infradead.org> MIME-Version: 1.0 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: --- mm/filemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 7dfd7024d361..a2150a6c15e4 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2706,7 +2706,8 @@ loff_t mapping_seek_hole_data(struct address_space *mapping, loff_t start, seek_data); if (start < pos) goto unlock; - put_page(page); + if (!xa_is_value(page)) + put_page(page); } rcu_read_unlock();