From patchwork Wed Aug 9 08:05:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charan Teja Kalla X-Patchwork-Id: 13347520 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 3F456EB64DD for ; Wed, 9 Aug 2023 08:06:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B45A6B0071; Wed, 9 Aug 2023 04:06:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 866096B0074; Wed, 9 Aug 2023 04:06:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72C478E0001; Wed, 9 Aug 2023 04:06:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6518E6B0071 for ; Wed, 9 Aug 2023 04:06:42 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2305416041F for ; Wed, 9 Aug 2023 08:06:42 +0000 (UTC) X-FDA: 81103834644.28.D5BFE57 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf02.hostedemail.com (Postfix) with ESMTP id F421280006 for ; Wed, 9 Aug 2023 08:06:39 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=AlYueKLl; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf02.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691568400; 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:in-reply-to: references:dkim-signature; bh=n6oO/Zyg5u9mi3NEeRs+7NvOb9/aJP4ApSLJNLlmAck=; b=TWCbyfY9n6Uo/UzQoiNetr3oUcB7ay0lBQhLN8hbRI5daZ8NHsdOFjIY4ujlRxOIAd42me whrJ1MDa9UsgX5tKGHA2FQ55fG4iKDxdhNHr1k8y6NUmzYDjvff/00n+gFspA+smryku/8 wCW8mpAce7THpqr+K5IlZ+2SaxZVEpQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=AlYueKLl; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf02.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691568400; a=rsa-sha256; cv=none; b=jAptUp4D4lCqGMFQaGVxh4BKZeD3O6bPAimAfiiFwApVQLQpHAi7GI36ZiRPC+uJ2XNiyz Ns2+IpfUe5o2Ptr5HYEg6ol+iqMN6U74c27WrGZzduSfHxh56jZMXxbOkE9Yb+vLzc9Coz BSosIgFV9EY8lCT3ef847uRw90iGTpc= Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3795Ol5i019476; Wed, 9 Aug 2023 08:06:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=n6oO/Zyg5u9mi3NEeRs+7NvOb9/aJP4ApSLJNLlmAck=; b=AlYueKLla5tihr7t6p7d3NlYQXOUkzYj+1hE6DfRD3LyHHG2eivtW6b+LinWtZmJzTOR bOWHdQXSxhaYTcuL+AJu6j/x9jCmTUvueIrEucfLvnKx8vZa3ednxtOm7eRa4Z8sJM6w LbZCCWuYDlXNqiq94sp7IrYbp+kgZKPVU4J3k+L3lneYWVetmMRDD6ughWw4HbS0DQEH x3wqycwkntt1rl06dZIQ4ht8OhBq7+MRt9xY2NoN98LLeM9pyaTbhB2iPt2p6ND/obHq tFKSgu2BMuPz/tVDzDtxGDHwvgftzrmOQbDPFx/TGNwty0tGsKkKtghEwwerfip+PX3K 3g== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sbcacu5bt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 08:06:30 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37986Tba019764 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 9 Aug 2023 08:06:29 GMT Received: from hu-charante-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Wed, 9 Aug 2023 01:06:26 -0700 From: Charan Teja Kalla To: , , , , , CC: , , Charan Teja Kalla Subject: [PATCH] Multi-gen LRU: skip CMA pages when they are not eligible Date: Wed, 9 Aug 2023 13:35:44 +0530 Message-ID: <1691568344-13475-1-git-send-email-quic_charante@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jDrU7E3CGU_j3ij3oL6NkCrYo3gwc6hq X-Proofpoint-ORIG-GUID: jDrU7E3CGU_j3ij3oL6NkCrYo3gwc6hq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_06,2023-08-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 mlxscore=0 adultscore=0 malwarescore=0 mlxlogscore=956 bulkscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308090070 X-Rspamd-Queue-Id: F421280006 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 33idrjyebcwxau8xi74nmxyhxth6f5af X-HE-Tag: 1691568399-641570 X-HE-Meta: U2FsdGVkX19OFa9tlUrfNXpf3sK7KMO3uHhSa7rYKlptBuCiDXc1Q6U/hGRyVF6ttrP8G1Xo3iffW20m350XIX5iKYRr6wHVULEaIdEOnhT72p2JSr8Ay7GUqW+6xv5Odf4al4Lk+CeK1tE4FZ9s36yZQzoPgT+gLBBAwQDu/dqn7etJZT4+jJDLuChiWYJsbnWopUToslZcDOumEe/lgpF+3gS8a0xGqMHcLy+B3AvAKyweY+D3tZAkOWgL/4lN1Gv6IEruN4MQyBcYOm3ecPhNXz9X3HOP7HUBohT3ZW+1gIIzXQImkE44TE2xT8hcBrufPtpWiInOumkF2OJvHuCLhBqHZ8R6/1T2QlYDvN07XM03PaFLtCQ9jAcT8D+tRw/wK4cw6UAbGs7N0AP4KeuQ0fm5Xt5BW4KPisAdlxe4KzffYKD/75AKLcbp0InF0X0hV0rTfl7r3PQ1BUv0VwPzXfh6tPQAFJykBi6ISAa8k2wJQdjDJdd3ktiHVQpg4n9Ae8borwRW1OKybWdTlHWXthWAPR1MAb+Y3w1KzqRhd3enoT5A7cdNjPLoPX5SdREYp92jSH0xo/W+pwaMQrCuk2CBOwSKMGbt5LBp0W+tC8nRgl7Z+wnvGN1FM0ekDZR1CWZIjsHkMOPmhAURJBotVQpKXmWMJiR9gfxNKlAGL24ro6m62DQDdMg19WEMu7w4+8UrRO7e5kMdf/+kfyE6iQlz1ZTxYGhihtYbE0XU98cxwVQKtGKgG05xCCUNUqqw2QMIT3547hac17YvhTc8HrrTB9d1MJD4oHIU0UwO3TSSG6BxI5H6tZ2+hNg3VyyhikfsFGJsoHh/0UD4tTsSi1XKlzQJtQS6nWHR+AfqV+OfAkNx68yk6K2W3iOGYlGGabEFFkfLggHu6n3Jb8fh18LsGHFXq/rlCu7xr3RccogUwXQVxjQEdfwclQacqmPhqGgtRj3Jhi79zXi GeafiaoR 2AY0Nb1j15sWvIygvbELIpsi3StQA4mMjeEnpV2S1y+9e1r3gjDGJmq+MGxVclz7KysiLPciRS6A1f1BUAPyhlxP95IXpRG+0UuGhDMivNET/8sm+aT8KgI1pdcL//1cZQr9yRUSRGwCrLUF57aSyJhJfj/SEXSFW063I0xdR2xuDTBR/k//pwbzjFz/cwwDG5pLbtzBaNGkvMeRshhBFQcVROw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.008289, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This patch is based on the commit 5da226dbfce3("mm: skip CMA pages when they are not available") which skips cma pages reclaim when they are not eligible for the current allocation context. In mglru, such pages are added to the tail of the immediate generation to maintain better LRU order, which is unlike the case of conventional LRU where such pages are directly added to the head of the LRU list(akin to adding to head of the youngest generation in mglru). No observable issue without this patch on MGLRU, but logically it make sense to skip the CMA page reclaim when those pages can't be satisfied for the current allocation context. Signed-off-by: Charan Teja Kalla Reviewed-by: Kalesh Singh --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index b4329f9..6cbe921 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4943,7 +4943,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c } /* ineligible */ - if (zone > sc->reclaim_idx) { + if (zone > sc->reclaim_idx || skip_cma(folio, sc)) { gen = folio_inc_gen(lruvec, folio, false); list_move_tail(&folio->lru, &lrugen->folios[gen][type][zone]); return true;