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=-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=unavailable 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 E9985C07E9B for ; Mon, 12 Jul 2021 08:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3884613C8 for ; Mon, 12 Jul 2021 08:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354044AbhGLID0 (ORCPT ); Mon, 12 Jul 2021 04:03:26 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:45908 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345090AbhGLHYx (ORCPT ); Mon, 12 Jul 2021 03:24:53 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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