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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 527FEC00A5A for ; Tue, 17 Jan 2023 23:53:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E48B6B0071; Tue, 17 Jan 2023 18:53:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 86D306B0072; Tue, 17 Jan 2023 18:53:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70F4E6B0073; Tue, 17 Jan 2023 18:53:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5CD896B0071 for ; Tue, 17 Jan 2023 18:53:18 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1B3221C5FDD for ; Tue, 17 Jan 2023 23:53:18 +0000 (UTC) X-FDA: 80365944876.14.C93A69A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf14.hostedemail.com (Postfix) with ESMTP id 77598100006 for ; Tue, 17 Jan 2023 23:53:16 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=dVzk+tb+; dmarc=none; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673999596; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kGAnK3zetkkUBhq0PUHrph+01O9bxZRbfbhK2CeL3xA=; b=sjrreY8+Oiwxztv8zqEYpMp0CtrBbTLjALMjoiB7P4m7ip3TCjztxNCTMSfNtIkqi6vDJo T5XDPdT/v26xlRHsl3VtsdMtmg83gd4GFPndmcUaQZ5a7If/kp9PRH6fMTLAGErsl+bbzs jS4r0RAe7lSMWYslznZSZQcrTixQp+8= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=dVzk+tb+; dmarc=none; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673999596; a=rsa-sha256; cv=none; b=cRD1j6tvU1S2nGXSdrg4uf9C5K1w4cxd/jGi1atMxFfBAZ/jb5q3HdWukHK44x6lb11m0y HXHacoIABTbb/Ah6JPlN89uicL9y1Qvz9OIIh4fUyI+fm+jKz37fmiMvZ5W3xwkT0nqG7+ JzDP1TQ2eUyPcwrghTnexxTB3jQrt9w= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 85AD6B81912; Tue, 17 Jan 2023 23:53:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F012AC433D2; Tue, 17 Jan 2023 23:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1673999593; bh=JkKYkLGT09zMGz/urEeklXEdIEzXoMEAS8SRYneI7pQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dVzk+tb+wA0d2mvDd8Qfs6s4SpJvISvjxCFtqL0V+scC2BpzoIiLzAINGsFT6VsX1 zEoca97bWMkfTWcyJw5XbuWrJ7nL9JpcuZ5X7s47UJmTIPoJoNzfHsTohUTTCsdQKX RJ5suLIZG51xNBSNkukEpcIR/Fo9kmgwCRzd/xB0= Date: Tue, 17 Jan 2023 15:53:12 -0800 From: Andrew Morton To: Minchan Kim Cc: Suren Baghdasaryan , Matthew Wilcox , linux-mm , LKML , Michal Hocko , SeongJae Park Subject: Re: [PATCH 1/3] mm: return the number of pages successfully paged out Message-Id: <20230117155312.5464d01c2d639b1ac44f9330@linux-foundation.org> In-Reply-To: <20230117231632.2734737-1-minchan@kernel.org> References: <20230117231632.2734737-1-minchan@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 77598100006 X-Stat-Signature: 6oeudh1es1xgc86maxt53o7jrrft91z4 X-HE-Tag: 1673999596-776442 X-HE-Meta: U2FsdGVkX1++5Ah/9LB0wIy+od2D+FntmgfALYviZqH/KG3ASmKB5/YjMc6EM/+BqDy66YlykYSMFcx2JaQ+lqzI/QVDmLLGgRmDOEnMEIU+NoPQLIPcOuGOoFfELzoqOzCu4BtFTj9rRsXsltiJyHXompxuU8/s6OLIQBhELTk7KJqHEIOC+Nz2t6bDZE0eTglSxWNwoTIl4t+1hQFdeVBaxrK5r8zvI1IS+fkbVZNIZ+coI+wTZctKG0pPO7Nb21jYqEizU84TShrc/ckwsuxZO0Dzgm3ddq0bsJB5s/R/1chG6OJT/GPYWgq7t0ihh5LO944zxH5VdQM9n47prIjyTYWku3G2ZQT7xa5XHwVnbngRhRtRNGush9FT9hyY/5WRID4tfBSzkm9M3NOGOHp/HWY0JhTSu9uodSUX/94S4HfH1IbyHIdCQySNAg6+megWlOhZn8ZjzYCN/wgWH81ZlNiskrSuduHp+uAA4wSaImVCpK7DsNiy81FtJwwZo6/U3FMrNHUPbz2DzcXfB+vJqYTt5WedFHx+GabN0kCKTIae454kK4CnXWBRldv96sb59FIxJVRk9KgqWs78vkqeu+TidfuZvTB554Ezt8uail3YP2lo1WhefRGeHZsmhPh9YW5kfHoAkA/hrBJdRd8lu3ABqZ1apWfzTnX+QpUGlQ1cRzOgionEppuXVXB1qKJQ/pdx4d58+16VwZ9DgjKE82kRew8G/4tON7NRHlI+hgsJSTRvLQd9ymBL+ATzyVlABF/q35z45ZKhnSec+AusJkGApFL+GNIiDCdgSKf0jKP4nWqXs3rXlOMSieR5ME6vkjeMIzHq9jAVsG+S7Bxq6lSCGiLieOKAWFUMWOfCzi5804315td9KE9PyKHyo128+qUlbLG4+SGyIKs3CAbgc/WIQPVyUdf2Qo39zH0ZULDVQ/QzIbqVzja4reaY+WH/jKDLlx1OoYawep2 ljvC02dg rqSy1MRLQTj8msBAFA+e5OPg/xBEaeWzru5x1ZjbkKUpx919ByE5SQEFqntwZvdcmxOao 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: I'm all hung up on the naming of everything. > mm: return the number of pages successfully paged out This is a vague title - MM is a big place. Perhaps "mm/vmscan: ..." On Tue, 17 Jan 2023 15:16:30 -0800 Minchan Kim wrote: > The reclaim_pages MADV_PAGEOUT uses needs to return the number of > pages paged-out successfully, not only the number of reclaimed pages > in the operation because those pages paged-out successfully will be > reclaimed easily at the memory pressure due to asynchronous writeback > rotation(i.e., PG_reclaim with folio_rotate_reclaimable). So... what does "paged out" actually mean? "writeback to backing store was initiated"? From an application's point of view it means "no longer in page tables needs a fault to get it back", no? > This patch renames the reclaim_pages with paging_out(with hope that "page_out" or "pageout" would be better than "paging_out". > it's clear from operation point of view) and then adds a additional > stat in reclaim_stat to represent the number of paged-out but kept > in the memory for rotation on writeback completion. So it's the number of pages against which we have initiated writeback. Why not call it "nr_writeback" or similar? > With that stat, madvise_pageout can know how many pages were paged-out > successfully as well as reclaimed. The return value will be used for > statistics in next patch. > > ... > > -unsigned long reclaim_pages(struct list_head *folio_list) > +/* > + * paging_out - reclaim clean pages and write dirty pages into storage > + * @folio_list: pages for paging out > + * > + * paging_out() writes dirty pages to backing storage and/or reclaim > + * clean pages from memory. Returns the number of written/reclaimed pages. s/reclaim/reclaims/ "and/or" it vague - just "or", I think. "written/reclaimed" is vague. "number of reclaimed pages plus the number of pages against which writeback was initiated" is precise.