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 D97D1C7EE2E for ; Tue, 13 Jun 2023 03:13:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69FBC8E0003; Mon, 12 Jun 2023 23:13:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64FDA6B0078; Mon, 12 Jun 2023 23:13:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53F2D8E0003; Mon, 12 Jun 2023 23:13:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 467666B0075 for ; Mon, 12 Jun 2023 23:13:22 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 171FE14038D for ; Tue, 13 Jun 2023 03:13:22 +0000 (UTC) X-FDA: 80896253844.06.4E81AD5 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf19.hostedemail.com (Postfix) with ESMTP id BFE7F1A0009 for ; Tue, 13 Jun 2023 03:13:19 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=kLBmKwzS; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf19.hostedemail.com: domain of quic_pkondeti@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_pkondeti@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686626000; 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:in-reply-to:references:references:dkim-signature; bh=C6/yV/Vq3nHnej1jBfjeowe/1deuVDw+kvoXqNqcZgs=; b=4sSE0eRjqnZdpu1CKUz5GvRHSwbjeJO9BgfOMtf+Wswi16CATPMtEzT7K2eqpIRdMv/YU+ mIWd9+3mKT6IQshX0C2QUzdEDvcq6mP5VoGAt9BSddtr465JGqYKrdsVNoIp1gsM2pWnDN qJMIuznoEpqX1IKKdfSlN57AR4lbH2E= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=kLBmKwzS; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf19.hostedemail.com: domain of quic_pkondeti@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_pkondeti@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686626000; a=rsa-sha256; cv=none; b=UYIkrDtzysFg0KtoKDgwBDgVXHHr/b/AYVF21LCAup6/6DcWXIpjujfBKqpe2+2MVsKl4P RzZcQFF5RbSGdT/QD16i5X/a/sUr7Ag31npJ9RkAfQcjml+BaZpSrnZ5vC1KAYTECYCQs5 MP5+TGM/IHVmbML3Lf0/oG2HlJTBAQg= Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35D2okBE026900; Tue, 13 Jun 2023 03:13:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=C6/yV/Vq3nHnej1jBfjeowe/1deuVDw+kvoXqNqcZgs=; b=kLBmKwzS9n7fmKVsXHH08/m1suVWw1HqWp9Ac4kQQdhCYpf8Bq0vnBiEjmTjYlkzsHHw LSpbBUm/3uZXvPtIFNFqfJqhPIL6ifftRT/lD2DXUG+hcnZXKXWYuDlulVDnVNfNHI8Z lK9M167Pvv7pTvUP6gfyFdpxS7SU/npR35n3wnVCBOVHI9qYDDWgkyqv28k7neIvglSZ LuMhGze7iIQ0jwkcSJNg+Qy5T5Q2FmNvHI6Bspu3y/j6EYkJQDl1qxSRRLerBwha3l81 PpRfyUEin9A1LDpzr/Ja0x9Cxhx/zBK5kynGApSArWGHKpG/QChwVCwDrAe9y/t0ZCw0 tA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r61q21q78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 03:13:14 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35D3DD4Y030721 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 03:13:13 GMT Received: from hu-pkondeti-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.986.42; Mon, 12 Jun 2023 20:13:10 -0700 Date: Tue, 13 Jun 2023 08:43:06 +0530 From: Pavan Kondeti To: Charan Teja Kalla CC: Suren Baghdasaryan , Johannes Weiner , , , , , Subject: Re: [PATCH] mm: madvise: fix uneven accounting of psi Message-ID: <20230613031306.GB1860372@hu-pkondeti-hyd.qualcomm.com> References: <1685531374-6091-1-git-send-email-quic_charante@quicinc.com> <20230531221955.GD102494@cmpxchg.org> <230e45e8-8cd8-3668-bbfa-a95212b4cb99@quicinc.com> <20230605180013.GD221380@cmpxchg.org> <4543c4e5-43f1-bae2-245e-951437e4bd07@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4543c4e5-43f1-bae2-245e-951437e4bd07@quicinc.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: ojl4r2Mo_Ojhmq4J9Ynkclsv9-AISmlw X-Proofpoint-ORIG-GUID: ojl4r2Mo_Ojhmq4J9Ynkclsv9-AISmlw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-12_18,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 clxscore=1011 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=956 malwarescore=0 impostorscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306130026 X-Rspamd-Queue-Id: BFE7F1A0009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ufui66sj7xynrpmoq1khjeij9j6qnuoj X-HE-Tag: 1686625999-524216 X-HE-Meta: U2FsdGVkX196zs9zGYNaBtu44E4UAeYPZKpuDiilHtcoZUnCI7eC8RgZkLw8qo/qEhvv1vxEkA41ieJ8+kJaYpAB7UfMu+orvL9WV25t10KA0F8a5LHfKGrwWFhAXTnQsox4nHUG5vt+SMOAEN4tOpI5ESRqiW7svvkzG5w3kl29MaVLRtcKut50/aajfZII8VW9ZpDTWqkKtczelZfVpWDOrwJmMEMaGQQ6/rfgwmLPA96ZkHEs9o/m5LV17zp92GD8V0yybR0fpvYsdOueXvYx6xHzxOi46Nt+uhQVoAsqsIidWT55+bDtMGta/mEvuecG2YmaHxcId9T6lYjz1WEImlGbLJDK9o+7nkEEMeaEERnjNbmSlQfPqcA0b/zygLDim/TulwqH6rKRDa3ocjgPFucFj+JjvjvSQ/+kauk2Exum09ZSmn0TdW8jrr1wGTDxFqB4n2VxvMp4VuH5RwLDy3e5u6m8/ZK/CBjqYIDx8qPhOE9h5YrqHV8S8ahAn+o+hs4l7THxb4Kr63k4AmxiHprql6oCy6WqOXhjnHtIdP/mksrbEtJgsKrAzuIgku9cp5MLjgPLVmCvYgV+LhrY4Z4bIgPUsHm/v/6j5Le0+SOFT5epuQ0Mb4YeJFhLK4ug/SwlF9Xiyjc3CZi3TtJ0L6AhIG671Js2b+GdDWLTB3ODpJCAioSCgOJ53ax/fUT8KcmpMiQ8tZnMAKAKDcyIRZya7mNZFjpjDJdiUQ3uQJ9bnZ1Z2bJzkT58mjKNrVjuYBcx/5tvApdFnDNGCtkUOiKccHfXYE9OyNcoC2vhVhBCfaJurSgQI2+svQpuru+Px3ENJ+csb95m6yFBOOZyhfoUL1iS/v005TOs2a8DtFUJTKOuUMAldbnZFBMoIR/3+WRO+TOs1tYnLcrMw3l/0IkzWIeNv7oua0x2NitzXPyFKwCK/XCc51m3IqL81ZlzWCwfYY7odINsYoJ dG+/UcLj XSvf00KJOwwb8QRFRcGAXB1vmdGLUsIDXgFvqyaHyP7yOGFXj3vH6f8nanBXyggE5sSAclHaLIzScTB3BFKAJCLIFJq9JzYvQQz3ov6nJtQKfa8dXzXTj7gCWNSXJoHMbyA1BKORoTiPMju8AbMuEG5oBpRrVyZUTrPKq 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 Fri, Jun 09, 2023 at 06:12:28PM +0530, Charan Teja Kalla wrote: > Thanks Suren & Johannes, > > On 6/7/2023 1:18 AM, Suren Baghdasaryan wrote: > > Hi Folks. Sorry for being late to the party. > > Yeah, userspace does not have a crystal ball to predict future user > > behavior, so there will always be pathological cases when usual > > assumptions and resulting madvise() would make things worse. > > > > I think this discussion can be split into several questions/issues: > > 1. Inconsistency in how madvise(MADV_PAGEOUT) would affect PSI > > calculation when the page is refaulted, based on the path it took > > before being evicted by madvise(). In your initial description case > > (a) is inconsistent with (b) and (c) and it's probably worth fixing. > > IMHO (a) should be made consistent with others, not the other way > > around. My reasoning is that page was expelled from the active list, > > so it was part of the active workingset. > > > That means we should be setting Workingset on the page while it is on > the active list and when it is being pageout through madvising. Right? I > see, this makes it consistent. > > On the same note, discussing with Suren offline, Should the refaulted > madvise pages start always at the inactive list? If they are really > active, they get promoted anyway.. > Can you elaborate on the rationale why refaulted madvise pages needs to be on inactive list? If it had not been paged out via madvise, it would have been activated no? Thanks, Pavan