From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 794F8C282DC for ; Sun, 2 Jun 2019 21:48:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55ECA279E7 for ; Sun, 2 Jun 2019 21:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfFBVs3 convert rfc822-to-8bit (ORCPT ); Sun, 2 Jun 2019 17:48:29 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:60968 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726715AbfFBVs3 (ORCPT ); Sun, 2 Jun 2019 17:48:29 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 16768558-1500050 for multiple; Sun, 02 Jun 2019 22:47:39 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Andrew Morton , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Chris Wilson In-Reply-To: <20190307153051.18815-1-willy@infradead.org> Cc: Matthew Wilcox , "Kirill A. Shutemov" , Hugh Dickins , Jan Kara , Song Liu References: <20190307153051.18815-1-willy@infradead.org> Message-ID: <155951205528.18214.706102020945306720@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH v4] page cache: Store only head pages in i_pages Date: Sun, 02 Jun 2019 22:47:35 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Quoting Matthew Wilcox (2019-03-07 15:30:51) > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 404acdcd0455..aaf88f85d492 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -2456,6 +2456,9 @@ static void __split_huge_page(struct page *page, struct list_head *list, > if (IS_ENABLED(CONFIG_SHMEM) && PageSwapBacked(head)) > shmem_uncharge(head->mapping->host, 1); > put_page(head + i); > + } else if (!PageAnon(page)) { > + __xa_store(&head->mapping->i_pages, head[i].index, > + head + i, 0); Forgiving the ignorant copy'n'paste, this is required: + } else if (PageSwapCache(page)) { + swp_entry_t entry = { .val = page_private(head + i) }; + __xa_store(&swap_address_space(entry)->i_pages, + swp_offset(entry), + head + i, 0); } } The locking is definitely wrong. -Chris