Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1160100rdb; Wed, 24 Jan 2024 06:42:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEefGpb3J+iKDKXUks835DSpwRNqk6f1GQTCsmgGtYkL7cT3APv0sqZtvm8Vl2yLBOkPcUf X-Received: by 2002:a92:d383:0:b0:361:9fe4:41c6 with SMTP id o3-20020a92d383000000b003619fe441c6mr2035723ilo.8.1706107349123; Wed, 24 Jan 2024 06:42:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706107349; cv=pass; d=google.com; s=arc-20160816; b=hYkrpDhmrcaksa/dzMeVnDsBzvSxVbb1Eznsk5IC6Y3IMrxdJvzCvXNbj3FInEpsY0 yO0auKKanDcIgnoO4Yix9SMa8mbBWZWqlSLVo8MssDvibJClr2d7bqFk6flvMRFvuOFj iWobAELnCHd2KERzHpRLjVmqlBtRiunE9LmWV6CheNL1ScnbHncyFVaYYCEcId08IYLX rn8Asj9Qvvagw4QZ+BR82fQCSkAncNqvKBPB/sLrtevRXjeDEiVYi9vHCudwu1O+/vI5 s2V1Yvdy/U74hH4RrKqGH2Egch6+LvSygVCo49eOu4Vkei/P775Gj5j0cQICsjR2p9JT 7JOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pOB7vCAKoihq9Mi/fz7gX6tPYUodOZN7LLoA5qHlBxE=; fh=pk7jpUncC/oYY3P8aGEIppT3L2h/vHyw5+cFKny+Skk=; b=FWHZw98CN19dGIaA7tVsknMMB+8Znx4R0NgAAedMDg8+YQ8GDLJ5Nro81NrJdlI+c3 xvxNcj2aeyrNKz2WD5bxDDF3L/rLOLfNRLuHOX6Mm044IFevYPMS2UT3jpaNjfkhxPdu dZCMUoRJV/1rk5rBnYZhOBa6/xAUjy/4/RWUqmovTsfyzucQ9N9uHpGVbKwmUpZbIvg3 NjRntU8zWdv9LwTHsMYyBmK8jpIuR9c8RuuwxsvmfbiQzWkZgA9FsWhw3gWlLZaowAyb MQa8va76NkK4bAINa9qFsBs/fzRy0odXFpWQQOaR+WaptKoz4S6KB+wki452iVxYHtQL Qnfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Sl2lHko6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-37061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37061-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u8-20020a631408000000b005ce02d98991si11579161pgl.875.2024.01.24.06.42.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 06:42:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Sl2lHko6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-37061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37061-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D3620292BF4 for ; Wed, 24 Jan 2024 13:20:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 410AA77F09; Wed, 24 Jan 2024 13:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Sl2lHko6" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEA43199D9 for ; Wed, 24 Jan 2024 13:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706102451; cv=none; b=V6ht+QZWzrnmO9ZifawO6Jsz1NlxrDRITt8N/bYXTx+lf9vH7P2hmQ5s2XqkFLMsrsgUisna0rU/p0PKnTaqgV7wzk/gNQw8k5VtT+U9yT8XoWc/J9/CTei6rmxFZdDehWXCziHDTIOx+e1E1dlAnCPVnIYVkxon4b+x+ntzmtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706102451; c=relaxed/simple; bh=JcP8nwhiTGb9FtqCA9V4zTWJWYgfq5+axcCA8e7wbAk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eCJXNtWwshXMfdFf23eq16XgsSmJRrdQL0td5Mbcli39me8SloCXpjWNFSZGoAkx3xZMh4ek8YWZs9P63qCgyiC9ZijxvvLdOHIp0G4SV0iDaeHPmadPYILyaukBOt7A5FfKH9mIvcyX0DD2U+QsZ8maEwtufSuntqCBiu7ef4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Sl2lHko6; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=pOB7vCAKoihq9Mi/fz7gX6tPYUodOZN7LLoA5qHlBxE=; b=Sl2lHko6gXK8czMgyEaf531wdJ HsCaUuf7W0LGVqJ7ZC6L9C/IS6Qhl59hAQOMC/3/3rnZ7tMwq+ieY8j9T+shopMX6WjnP/rFF6NEs +Z95aQk++UPxUdKtVAOTNvDNMTBrjp3q0Bdjx9vCrOO1LC21Wi44dOjzEkxsi2jz0HxF6Xhj4XqXw JWcTseOe+J0UljIgoM7VHxTLEQ8biAN+zzoU/GY/5/4/PiAS4c5QcpYGSSodf62DKv+I7i+Rm7NqQ PIlTBOF7zk5ZBiORmT6pD/Ldo4P1QenQ8DHqiyRU0ZBI7nA3r+Y+0eXQ4cBw1SjuEiAxVEA2ouThH POkphRMA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSdBO-00000006jJo-3LOI; Wed, 24 Jan 2024 13:20:46 +0000 Date: Wed, 24 Jan 2024 13:20:46 +0000 From: Matthew Wilcox To: Zhiguo Jiang Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com Subject: Re: [PATCH] mm:vmscan: shrink skip folios in the exiting task Message-ID: References: <20240124124308.461-1-justinjiang@vivo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240124124308.461-1-justinjiang@vivo.com> On Wed, Jan 24, 2024 at 08:43:07PM +0800, Zhiguo Jiang wrote: > If the shrinking folio is belong to the exiting task, this folio should > be freed in the task exit flow rather than being reclaimed in the shrink > flow, because the former takes less time. > > If the folio which is belong to the exiting task is reclaimed in the > shrink flow, such as the anon folio, the anon folio needs to be first > written to the swap partition by swap-in in shrink flow, and then the > corresponding swap folio needs to be released in the task exiting flow. > As is well known, releasing a swap folio will task more time than > releasing directly an anon folio. > > In the scenarios of the low memory system and mutil backed-applications, > the time-consuming problem caused by shrinking the exiting task's folios > will be more severe. What testing have you done of this patch? How often does it happen? Are there particular workloads that benefit from this? (I'm not sure what "mutil backed-applications" are?) And I do mean specifically of this patch, because to my eyes it shouldn't even compile.