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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 82898C07E99 for ; Mon, 12 Jul 2021 07:22:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0C9C46136D for ; Mon, 12 Jul 2021 07:22:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C9C46136D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2CE746B0011; Mon, 12 Jul 2021 03:22:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A5A96B0092; Mon, 12 Jul 2021 03:22:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1467A6B0095; Mon, 12 Jul 2021 03:22:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id E43886B0011 for ; Mon, 12 Jul 2021 03:22:06 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 07DCE21953 for ; Mon, 12 Jul 2021 07:22:06 +0000 (UTC) X-FDA: 78353091852.34.E13495F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf20.hostedemail.com (Postfix) with ESMTP id 90809D0000A2 for ; Mon, 12 Jul 2021 07:22:05 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8DAF722011; Mon, 12 Jul 2021 07:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1626074524; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AynFK0kDxPUobnuPzkQAZ0ex5JLPPSKeLJppRk8XAmM=; b=BHIQ5szRv4lJDuAqg5KiEDnWv1fjYq+BOSeViDx0Y+mnYNn1I6WIFevoycGzgXKO4VioAh zE94p/mf6VNnjfJCsoZPZ1lb99WfGf4S50TllgPCxofMJv8EXfIvMz9FWKyCevSYKiCbd9 4IhhunTyWPd3TlckL5iBVsgVTeyILKk= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5D06EA4235; Mon, 12 Jul 2021 07:22:04 +0000 (UTC) Date: Mon, 12 Jul 2021 09:22:03 +0200 From: Michal Hocko To: Miaohe Lin Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, vbabka@suse.cz, axboe@kernel.dk, iamjoonsoo.kim@lge.com, alexs@kernel.org, apopple@nvidia.com, willy@infradead.org, minchan@kernel.org, david@redhat.com, shli@fb.com, hillf.zj@alibaba-inc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] mm/vmscan: put the redirtied MADV_FREE pages back to anonymous LRU list Message-ID: References: <20210710100329.49174-1-linmiaohe@huawei.com> <20210710100329.49174-2-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210710100329.49174-2-linmiaohe@huawei.com> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 90809D0000A2 X-Stat-Signature: tt7imjx59s8ch4fsu9pzpa579doqbwzx Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=BHIQ5szR; spf=pass (imf20.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1626074525-902722 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 Sat 10-07-21 18:03:25, Miaohe Lin wrote: > If the MADV_FREE pages are redirtied before they could be reclaimed, put > the pages back to anonymous LRU list by setting SwapBacked flag and the > pages will be reclaimed in normal swapout way. Otherwise MADV_FREE pages > won't be reclaimed as expected. Could you describe problem which you are trying to address? What does it mean that pages won't be reclaimed as expected? Also why is SetPageSwapBacked in shrink_page_list insufficient? > Fixes: 802a3a92ad7a ("mm: reclaim MADV_FREE pages") > Signed-off-by: Miaohe Lin > --- > mm/vmscan.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index a7602f71ec04..6483fe0e2065 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1628,6 +1628,7 @@ static unsigned int shrink_page_list(struct list_head *page_list, > if (!page_ref_freeze(page, 1)) > goto keep_locked; > if (PageDirty(page)) { > + SetPageSwapBacked(page); > page_ref_unfreeze(page, 1); > goto keep_locked; > } > -- > 2.23.0 -- Michal Hocko SUSE Labs