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 E100AC4332F for ; Fri, 2 Dec 2022 04:17:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E46B36B0071; Thu, 1 Dec 2022 23:17:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF6E36B0073; Thu, 1 Dec 2022 23:17:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBE796B0074; Thu, 1 Dec 2022 23:17:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B99326B0071 for ; Thu, 1 Dec 2022 23:17:17 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7E4748112E for ; Fri, 2 Dec 2022 04:17:17 +0000 (UTC) X-FDA: 80196056514.04.8C34ACD Received: from r3-22.sinamail.sina.com.cn (r3-22.sinamail.sina.com.cn [202.108.3.22]) by imf23.hostedemail.com (Postfix) with ESMTP id 7CFDE140004 for ; Fri, 2 Dec 2022 04:17:15 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.22 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669954637; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=56hZ6gPzvL14q3ezXSbawBHvp/dSBkqs0lgLcij/f5U=; b=4Mi+zSBCvUoG62enY3+c/9QvbsDnGSaFSrOeoVzFZ/ohvdreEEm5BhcJC7DY8QttJ4XUyS rD+zLnOYaDOb0fpu2qd71wnpqDGLUsv2TEhITrv9GnlaJZqPaA25DfwSerRRc2UfXfarFU xROn4w96pES+/MtNIhrPont+eSLsWiI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.22 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669954637; a=rsa-sha256; cv=none; b=AmKbgsZxsCknEZX/+LdOANvL2uwr5iaoFQb0/p+J8UE0L913+Uft9GkksX6mkAxxxfTGc9 e4Ycq36pVV+7pihNjQIqhPdzOus01nsm8vZgkUv89RrR26n/sWuEaWLb0cgVkShAeiJhMV iSapEQmVtCCrTggHdwzdb6cREG5Pmzc= Received: from unknown (HELO localhost.localdomain)([114.249.57.238]) by sina.com (172.16.97.32) with ESMTP id 63897B980000EAF2; Fri, 2 Dec 2022 12:14:18 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 802470630737 From: Hillf Danton To: Yu Zhao Cc: Andrew Morton , Johannes Weiner , Jonathan Corbet , Michael Larabel , Michal Hocko , Mike Rapoport , Roman Gushchin , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com Subject: Re: [PATCH mm-unstable v1 7/8] mm: multi-gen LRU: clarify scan_control flags Date: Fri, 2 Dec 2022 12:17:02 +0800 Message-Id: <20221202041702.6707-1-hdanton@sina.com> In-Reply-To: <20221201223923.873696-8-yuzhao@google.com> References: <20221201223923.873696-1-yuzhao@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [2.78 / 9.00]; R_MISSING_CHARSET(2.50)[]; BAYES_HAM(-1.52)[91.83%]; MID_CONTAINS_FROM(1.00)[]; SUBJECT_HAS_UNDERSCORES(1.00)[]; R_SPF_ALLOW(-0.20)[+ip4:202.108.3.0/24]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[12]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[sina.com]; ARC_NA(0.00)[] X-Stat-Signature: aetcj4oatqkhjcqygbk31htcregfhf4k X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7CFDE140004 X-Rspam-User: X-HE-Tag: 1669954635-536605 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 1 Dec 2022 15:39:23 -0700 Yu Zhao > Among the flags in scan_control: > 1. sc->may_swap, which indicates swap constraint due to memsw.max, is > supported as usual. > 2. sc->proactive, which indicates reclaim by memory.reclaim, may not > opportunistically skip the aging path, since it is considered less > latency sensitive. > 3. !(sc->gfp_mask & __GFP_IO), which indicates IO constraint, > prioritizes file LRU, since clean file folios are more likely to > exist. > 4. sc->may_writepage and sc->may_unmap, which indicates opportunistic > reclaim, are rejected, since unmapped clean folios are already > prioritized. Scanning for more of them is likely futile and can > cause high reclaim latency when there is a large number of memcgs. Nit, just because of gfp without __GFP_IO set does not mean there are likely more clean page caches, though prioritized, on the local numa node than a remote one, and vice verse. Hillf /** * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope. * * This functions marks the beginning of the GFP_NOIO allocation scope. * All further allocations will implicitly drop __GFP_IO flag and so * they are safe for the IO critical section from the allocation recursion * point of view. Use memalloc_noio_restore to end the scope with flags * returned by this function. * * This function is safe to be used from any context. */