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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 E88ACC433DB for ; Tue, 16 Feb 2021 18:23:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B359C64E6B for ; Tue, 16 Feb 2021 18:23:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B359C64E6B 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 3F4A86B0005; Tue, 16 Feb 2021 13:23:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 37DA06B0006; Tue, 16 Feb 2021 13:23:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 246136B006C; Tue, 16 Feb 2021 13:23:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 0ABCE6B0005 for ; Tue, 16 Feb 2021 13:23:34 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B89DE8248047 for ; Tue, 16 Feb 2021 18:23:33 +0000 (UTC) X-FDA: 77824953906.23.8662120 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 2AE41E0001AF for ; Tue, 16 Feb 2021 18:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=v7reJc7owJgByy7BxY9foagf56Geahv9BK/jtA7FcW4=; b=T1w0z1MtJ3DTQt+fih9hSXxI2q lBlwnq22TihAW9jnXLU8eVOczWZTOv9CFjZ3j7Nb2cnzHR8ULzF3+6kCMq+vMhm8hAJbl0Cuu0uiL uqzdEGhbHLMTCxuzLxWlLXTzVoRYUhIvGI1GgfFFKb4n9p3WWy9Dhk8CC7vkj+uWWzWUs2PA6YumQ o6n5h6TkbmIoni0v+S1gaSupvP23+bV2JWBTb4FPDbTLmDQfGgCc1FFs6RWIunvhp7/jxkiGTcFJ5 d+oBUbDFXxLnMXGHa3UH/LLIGUTpmaEWLN4U1q+NdbIToJ9MQim3zz4UdA9cMhAUsCbsIRsppuflf WUwgHZ+w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lC4zi-00H9aV-GT; Tue, 16 Feb 2021 18:22:49 +0000 Date: Tue, 16 Feb 2021 18:22:42 +0000 From: Matthew Wilcox To: Minchan Kim Cc: Andrew Morton , linux-mm , LKML , cgoldswo@codeaurora.org, linux-fsdevel@vger.kernel.org, mhocko@suse.com, david@redhat.com, vbabka@suse.cz, viro@zeniv.linux.org.uk, joaodias@google.com Subject: Re: [RFC 1/2] mm: disable LRU pagevec during the migration temporarily Message-ID: <20210216182242.GJ2858050@casper.infradead.org> References: <20210216170348.1513483-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210216170348.1513483-1-minchan@kernel.org> X-Stat-Signature: w5dwkafafh7fyex5iujnbokrgk6ymn7d X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2AE41E0001AF Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613499807-161391 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: On Tue, Feb 16, 2021 at 09:03:47AM -0800, Minchan Kim wrote: > LRU pagevec holds refcount of pages until the pagevec are drained. > It could prevent migration since the refcount of the page is greater > than the expection in migration logic. To mitigate the issue, > callers of migrate_pages drains LRU pagevec via migrate_prep or > lru_add_drain_all before migrate_pages call. > > However, it's not enough because pages coming into pagevec after the > draining call still could stay at the pagevec so it could keep > preventing page migration. Since some callers of migrate_pages have > retrial logic with LRU draining, the page would migrate at next trail > but it is still fragile in that it doesn't close the fundamental race > between upcoming LRU pages into pagvec and migration so the migration > failure could cause contiguous memory allocation failure in the end. Have you been able to gather any numbers on this? eg does migration now succeed 5% more often?