Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5393699ybi; Wed, 12 Jun 2019 01:37:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjgw5ikA8ZLS89uL774JC1tUEKjckMVosJH6p7H6zAzkAnzZ5HgsMwtaBsSMhuuMdfgSRm X-Received: by 2002:a17:902:1566:: with SMTP id b35mr82473334plh.147.1560328641891; Wed, 12 Jun 2019 01:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560328641; cv=none; d=google.com; s=arc-20160816; b=pKw0VEcDrmmL0RmoiAY2RyM9xgRmKYlq41cl8KYLSgax0GK8E3SvgW4UWOOIAtMKSl 3n18SdDD8BumxpLTa6LHyTm5nIbZuZp9XtN7C4k58PidoqVocl2ZhwZtupjUEtLzEjjb 4DDYBf/d5VUK+Tef09H/acUibLHCMvFEMCtLAYcYlyHMVp0Wlm06Hn94AaMmNUh107eB 1SI76R1qX/CQdrYUitWjSEMSkLtL5nL1QH2lSINtJXyPzMWIvYzqEnxIrY4foeLk6d1Q UeTS6FcGXdJpTBEkztsRmkwFCY8SGkLb/liQ1ZZCULC1ZRdb3SHEDots4FexWu+sIaxm e8lQ== 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=p3vzboK2fiO+xF+oqczjw6ix36X9gM9qubtDWexzOew=; b=ydU27n3wK0MegXaqZVfGG+k9rKV6VtQ1zzxlWU+468hbQ4MSsRNDsMppb+omk9iMAN tXEzWaFE6tyr7wbXCiJXh5gOca0ySxG/Lt6L2VJSZ13/ZOkLI7qr2ntJQzKNPSaBDiN2 KZq1WT6LUP49UZLMx+65WPz4OeToONoH9IQ+0/4GFdb4RMqpdpvj6fbVjmK/76FS1qHW wlLYEUuoKxxNYbS6ANivai5xVItRepEOUClq0HBVvAMiHp/OIx2mDxSF4M4AXslWm9Y6 UNMT4RO18lgrOfByAwZgB4vDwnJhU9NPUnz9SoFX38h1rJ36ovKayZmJiT04Bw1JgFq9 bTQg== 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 be11si1069910plb.218.2019.06.12.01.37.06; Wed, 12 Jun 2019 01:37:21 -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 S2407194AbfFLHmW convert rfc822-to-8bit (ORCPT + 99 others); Wed, 12 Jun 2019 03:42:22 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:58805 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2406781AbfFLHmW (ORCPT ); Wed, 12 Jun 2019 03:42:22 -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 16872251-1500050 for multiple; Wed, 12 Jun 2019 08:42:06 +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: <20190612014634.f23fjumw666jj52s@box> 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> Message-ID: <156032532526.2193.13029744217391066047@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [PATCH v4] page cache: Store only head pages in i_pages Date: Wed, 12 Jun 2019 08:42:05 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :) -Chris