Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2765371pxv; Mon, 12 Jul 2021 01:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIJbIwdAA3CxvVz6vynIAiWE23QsnRaQ1yniUmQUQoVKDa7bZ/rx2qbY6+6/8z/yR+jQo7 X-Received: by 2002:a05:6402:334:: with SMTP id q20mr11279398edw.384.1626077212948; Mon, 12 Jul 2021 01:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626077212; cv=none; d=google.com; s=arc-20160816; b=O9p0CtwhuNNWKZFbDqcqagjTVj5G/lSWsyeVY7/CxzzbqqV6vQscN3mnl1qWiTb5Xu V5wo3CFJ7WxIGC59J6dWvzj0m9GPb8Ox7M3OpjIdCHHtIqTD7v7FeLO5rClalbMIU5qZ Zg9IyMjqJmvsXStK4VFw83b32p9tKrmM+6Bc//kw91LQlU6uwPd7ARDPby83piiyF7rC UBz4FO9sOsDEekwrDDbpS0/1xpQVnpiiOhbVQ6VFKJpuAT5vhmvR4pjw3SzBTQjchapB s+sJbLVO9tYRyikG1Uql9so23U3dBPvDyFGjneaJEaeemJ/EIxMtxr9Jd8PLPUtubSR2 Dz6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AynFK0kDxPUobnuPzkQAZ0ex5JLPPSKeLJppRk8XAmM=; b=xkMI+ETMIn8vMtDF68yzoabCSxAXwwAjTEccT8jFnIRgnX3vRltgTuKa7p7HOfJ92p J2M8bhk793oTgFOFyl0G5+P+QYLh1FmKhxZSaaN4Ext6wdk7HHB0g5mybYCmvPTohjhQ GT3nVje9g1KDK0JjKcsu315aYlx6J+S66W+rQljzmlDGoOG3khd9whZbguH3ZVpXQswX 6naDwL+XB/Rja547XPPIR+agh9U7trvaemkz1BBWFLJ6TA//BvDabd35bfOfutlP8btO 4gwRrkXFeK1Iepafyvl9oUJChlOaHG2nVHXgM6TVoOlwJC4MliPVFKo0HANYcihADaNJ j5sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=BHIQ5szR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si7771523edc.137.2021.07.12.01.06.30; Mon, 12 Jul 2021 01:06:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=BHIQ5szR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354021AbhGLIDX (ORCPT + 99 others); Mon, 12 Jul 2021 04:03:23 -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