Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp492706ybi; Wed, 19 Jun 2019 03:05:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+466RTWNJNrqGkcA9RVZ0VyP3Rorj9RFR50CGTP5yKHwBiqUlFslRg/rBVAPR6ZJK0iGz X-Received: by 2002:aa7:9317:: with SMTP id 23mr35424006pfj.79.1560938711211; Wed, 19 Jun 2019 03:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560938711; cv=none; d=google.com; s=arc-20160816; b=AxYk6vdjJ4NN0uskSilv2AyWskFz6W2xuXI6+7lOFwW4QvYKm/oQA8Ds6Guk/B73tl 2AkF8ol6Bt52vUfcUyBrHLu2EBlmvQ8EaQhvlQ1BcoCpo2RVjSKKk2DovkDJjW1gH9/X fYiiMLQs2yAkuyEYC9EWCbKVzCvuvyEzEWkH4H41OSYYCbMB/aFiYpgcJAP8t1MTT3ID PZ3/ETLUbqhuC56pi0x7K1AHee+frD7a4pmncxOeMDvuNnS7X5xyMRGCkyDoeJGkSGow dNmM5AwP+hyjwb2mQxczoxJOgo8lTljWv3ZaDuKoK0tf7aiFbQZu6NRtG6goxLYdX4Ne LEaQ== 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=T3+q9pirA5VB4ARhJIXQby5xyr/xm4VOzF5VH3WWLb4=; b=e0N2CemoYuEg2BYqt8Y55yutE0RGA30XjR7uha7h9Dg+j3GEKK3/vQbFHJ4dQi/6eo AznpGKUPvrwtwuP+eeprlIhzDL4t5zzbvZqdPfhD8DMxKR6GLNeZnj6jzNc8Z/mJNNTm dWPOQeSFT1axvfKTevjpiESLmzovB63ZThxGxouY8XciuyVPWxdTRMR5SvK88CSmtwjk 8al046qmZS1ptwM/2+Llh0cvgflSmqISRjWVvbF/WezFkNIswnBW0uA307ifZX3qVhRd CxYVS2hE1zDQFK7eRCwPg6vZSQ/zM49tlGuEDzd5i5UQipiYJnRmgXh93iD3G/jRifpb Pt1g== 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 i18si16064351pfr.65.2019.06.19.03.04.54; Wed, 19 Jun 2019 03:05:11 -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 S1731493AbfFSKEo convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Jun 2019 06:04:44 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:62780 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726959AbfFSKEo (ORCPT ); Wed, 19 Jun 2019 06:04:44 -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 16950740-1500050 for multiple; Wed, 19 Jun 2019 11:04:28 +0100 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: "Kirill A. Shutemov" From: Chris Wilson In-Reply-To: <156032532526.2193.13029744217391066047@skylake-alporthouse-com> Cc: Andrew Morton , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hugh Dickins , Jan Kara , Song Liu References: <20190307153051.18815-1-willy@infradead.org> <155951205528.18214.706102020945306720@skylake-alporthouse-com> <20190612014634.f23fjumw666jj52s@box> <156032532526.2193.13029744217391066047@skylake-alporthouse-com> Message-ID: <156093866933.31375.12797765093948100374@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH v4] page cache: Store only head pages in i_pages Date: Wed, 19 Jun 2019 11:04:29 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Chris Wilson (2019-06-12 08:42:05) > Quoting Kirill A. Shutemov (2019-06-12 02:46:34) > > On Sun, Jun 02, 2019 at 10:47:35PM +0100, Chris Wilson wrote: > > > 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. > > > > Does it help with the problem, or it's just a possible lead? > > It definitely solves the problem we encountered of the bad VM_PAGE > leading to RCU stalls in khugepaged. The locking is definitely wrong > though :) I notice I'm not the only one to have bisected a swap related VM_PAGE_BUG to this patch. Do we have a real fix I can put through our CI to confirm the issue is resolved before 5.2? -Chris