Received: by 2002:a17:90a:202a:0:0:0:0 with SMTP id n39csp3671873pjc; Sun, 2 Jun 2019 15:31:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMF9zHwHbs+s9swz0i8BEyXC3PRNFeeEoBWGgnx6ZYZZGMUoBKCtK1p3m7VjNfe8C42Yyd X-Received: by 2002:a17:90a:8e86:: with SMTP id f6mr25396306pjo.66.1559514684137; Sun, 02 Jun 2019 15:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559514684; cv=none; d=google.com; s=arc-20160816; b=O3RlI1UrXirdfVlKpQtPXG//TQ7kkqQntVit/aqUQu0NW5SjsYeDeEWJxyTuscpn12 L2IhJzUGg4p7QwLidns3uYY/IYIk3VAzp61XK4R/uy+l13YKNRIR3l7tyUiVuviUtJkv TyQH6nz2ZEskhqvvn1sBbDpWRX2E+IcA/r5qyj874aJNRwrapgPlqHVHrt2gMBWT/2iD f5OWR5fWSBcljwaS1A5/hmEQ/OmSDawd3E2QTaedzsJb9OQoEl9ely346WBTSKCj5IzF VYQ9sjosEUECV4T1ZI7Bi4DkhS8yzmTEpFm8n21VZdTULlOwZUbD8QhakCCFUOagHtgZ O6OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=AxWTvyUThEv3tTy6CR+RsJ2Lzrr6fM3ecDS56invN+k=; b=BRnrNvdFCvBAEjTiDi8NfnVKxqiF5SZ4XwJ9SG5mM1VRbm5U5dRwZ7QW4mMuTo1IRv Ic4kCmi/iq83uFQmg9dN7dN305R+uvhTX0mJO0Cz+AYvPqWu8lQNq2EEWVUSLS4wiG8E AcjNAqg1v0HSROgB/nhX2qNvGgkKbj0DYnQRPI3LXtTUo2b+B5ILxQj1vBV4BTNL1HfN K5jZRM1+ttojmTwUdr7LRLQ8zqMbLX7iu8NC23D0syV16JA0Kpg6PXcTfvkZDJEdrI66 qGmC74ypGxQn9hWfYMKjFpfvt+r9UHHU66i5iG4aeCyWKk+2L6wJvsCW3t74PZy0cP2V MbqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e18si15590745pgk.236.2019.06.02.15.27.49; Sun, 02 Jun 2019 15:31:24 -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; 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 S1727034AbfFBVs3 convert rfc822-to-8bit (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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