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 7EA22C4829A for ; Wed, 14 Feb 2024 06:34:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0403E6B0087; Wed, 14 Feb 2024 01:34:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F0A296B0089; Wed, 14 Feb 2024 01:34:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D85126B008A; Wed, 14 Feb 2024 01:34:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C25126B0087 for ; Wed, 14 Feb 2024 01:34:29 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 48F82C08EB for ; Wed, 14 Feb 2024 06:34:29 +0000 (UTC) X-FDA: 81789445458.19.285DDFF Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf07.hostedemail.com (Postfix) with ESMTP id C3DFB4000D for ; Wed, 14 Feb 2024 06:34:26 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="K+ Tkm0X"; spf=pass (imf07.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707892467; 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=QXFKcU6cwm9/llQyHRKTX/LXTUeS+mwIXL79jmBiF3M=; b=qmjYW+delJNyT1+bWyPhWqUboDwlAOz23+t1L06M5AW2uCbjmBDMRpk4k4RwovqeBWpRSr LVK8SlRJXyv4SAL2HUxcvWzolSOKgxEs4HueRuX57w+bFDk8+FQPfjcE5rZjY3dxvkmMsu KdvKK+mpsDFp6XIuJEMKfpmP26E207Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707892467; a=rsa-sha256; cv=none; b=nQCSYIYnCz9184AOwyDVWdiP4N3UM2HubKqvJHsTAyAnNmUG+JRpQ6s0qMar91M6Hx0fvx s6BThuxD4rYigQllkPPUwf3UYQBl/d1gQTzXom96jPDJ6OJkEoo9rd25xtKg0UG+zXKzFW TG/7azUqyLRKft9P6Is6wIpecRGfJfw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="K+ Tkm0X"; spf=pass (imf07.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41E5lhae029536; Wed, 14 Feb 2024 06:34:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=QXFKcU6cwm9/llQyHRKTX/LXTUeS+mwIXL79jmBiF3M=; b=K+ Tkm0Xil1rPiW5YgVJzmTT3HP4m4lGZT/xbBFL9dXp2Zr/TqmtVcdrEhuy1WcMAWh 1Wbtvbs1OBJF70QXIS+3/RhDRvshQkVga2zIODyy6yQyLctFDn3dVa2ceXMOm2YV jgTssp5VUhYMT4qlqHyt21iVcCOV67/3ACbg2VaAxz41Nhlae0QgZUKfFnsxEPZ1 5lG6/K8kJC7xnLa2YgMCZBFWWWjbMGvgTJTj6tlBBiRst+9Nb5hFVfMeXsk2SmRz EISuWq3lzv6boWi7kO/AEZDph/vtq9cdk78ct/uqEykm+Wt14Hl92yGKQOBnpkCX m/Klo/TLTVWk3+jUB2fQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w8eks8yex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 06:34:17 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41E6YGAm018067 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 06:34:16 GMT Received: from [10.214.66.164] (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.40; Tue, 13 Feb 2024 22:34:13 -0800 Message-ID: Date: Wed, 14 Feb 2024 12:04:10 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] mm/huge_memory: fix swap entry values of tail pages of THP Content-Language: en-US To: David Hildenbrand , , , , , , CC: , , # see patch description References: <1707814102-22682-1-git-send-email-quic_charante@quicinc.com> <8620c1a0-e091-46e9-418a-db66e621b9c4@quicinc.com> <845ca78f-913b-4a92-8b40-ff772a7ad333@redhat.com> From: Charan Teja Kalla In-Reply-To: <845ca78f-913b-4a92-8b40-ff772a7ad333@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-ORIG-GUID: lnjyjyHGECX3FqfvHeBgIDMzSEvghKpQ X-Proofpoint-GUID: lnjyjyHGECX3FqfvHeBgIDMzSEvghKpQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_16,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=815 impostorscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402140050 X-Rspamd-Queue-Id: C3DFB4000D X-Rspam-User: X-Stat-Signature: p7moguu15jm4s7g3tuagm7zz9i4osyys X-Rspamd-Server: rspam03 X-HE-Tag: 1707892466-531054 X-HE-Meta: U2FsdGVkX1+O4AcHrjer6tMqtw/KLL2lw5lJv/wF/aM1GDpR0X6WVPRLEsFy2Zt5GxwNUokGbrMV7U0foGmD42ttDu0OHk4PPKGScbbnJKQTnbiYFHDggBKWzqGd9WORaLL5F5ggsk/vYmZj1xNzyVyrLgQpHei0V+05nWnBUTvWxGUT6tJ40cQ0Ory4ShWVgndtHzVj9MPVmgW0DI4ZVRo1/aeUiknyUlmxY6JanSIfkW+3GiVBPKDZSQql1Kohv1uDYGM6gTMWJRfr9RWYMTR67dqMO3Yj2cV4zEx7yE11fZNSE/y0VZ4rU9QSvT36UVT7Nj0aobGbc83fKRiT+kE/r78LGvSZ55wNnvLlg+GMddJxHbMt6sV3ejEbFqOKUqfd8yqv6d7IXhqLshFtWIbspV0ceJ2ih/mED5GaSIvv5KOCMgSObC6p4pv6hoeXWxkFYY2ZUN3JJqs7rZBnNo1GPNZ8L/P76PN9bjb8Y+9BMV9jOaajy9aPqFDJT/lEBZswULPlQkId0oYrPGMtI3b9nnrz1uEKOsE3VYDoKWhqAyPQQZwOPQKOvrxNAS8DwfEW3w2EuXKFg+pzvpr5P1yRdHCrkHHfrjK7qPylVd66iG5iZefmzYCkLJq/IrRs0nfwcPk1htvyy+lzPZM+tnuk2nmX3DZT4GGBeldYjBy6F3Xh5jk/aTUwYXJ3Rk6G9Qv6XMaaWAmM7An906mIy5l2l5TD/in3FDt/q1YI2ojYt2lshNElo+TIw0dAZCdRRWA1G8uPQgTNdDDZDmML4NRqMGZOIWLf91jFgZv4jTbjUI3FfoaKMkgFqQka3VRIgAoUEsKO300xaV3GuLD9AwX20b8gm/f2NkIEr5PZtzYKi9ez+HJF5fBPusU9QLkWGFj8ZsGbD8VktN8zFngFsMBz+FFedydJzXKdwdJduinc+kkiFLLMdQJPmRiAS02aeD1QQ6TCfuyVjMYsweO OBU7PtvN huoGXyA/89+m3rAt+JEuX5pzQRblbPam0gtkNPCd3Txu5OfhJejlZ6iSofOCsylxpDxPfwobCNpEcjfBndOSHX6QgOslsDC2pdb732vEM8znOkeLiuUIPpH5MehxDnO046vpWDy+4sAsmbXbqPjP0XSbz+pNf1mJuFDtlQiawO1OhX6x8JsLrj+jk8pd53llRyFRwShFj4Yah9qaazFvfKRZjJuW1S8LZHr219xVBJBr18Xr5CyJ4kUeIDj2J7oW0xJ51TtXMQhDHya/YFS9T2AMkwQ3ZZUN/GucsSyYQewh/I+RUip+pjE2XaKkU9foQcqwfc2oYvcrYlOi++nfKa+yv0+zfod21BCytUq1rPxD5Kz5sV+aJSto9Yw== 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: List-Subscribe: List-Unsubscribe: Thanks David. On 2/14/2024 12:06 AM, David Hildenbrand wrote: >>> >>> Isn't there a way to bite the bullet and backport that series to 6.1 >>> instead? >> >> My worry is that, because of merge conflicts, not sure If It can end up >> in inducing some other issues. > > I can have a look this/next week. I don't recall if there was any > particular dependency. > That would help me... >> >> Although we didn't test THP on older kernels, from the code walk, it >> seems issue persists to me on older to 6.1 kernel, unless I am missing >> something here. So back porting of this series to all those LTS kernels, >> may not be a straight forward? >> >> So, I am really not sure of what is the way forward here... > > Again, if we want to fix this properly, we should first identify the > commit that actually broke it. > > If it predates folios, we'd need different fixes for different stable > kernels most likely. > > The big question are: > > 1) Is it broken in 5.15? Did you actually try to reproduce or is this >    just a guess? > We didn't run the tests with THP enabled on 5.15, __so we didn't encounter this issue__ on older to 6.1 kernels. I mentioned that issue exists is based on my understanding after code walk through. To be specific, I just looked to the migrate_pages()->..->migrate_page_move_mapping() & __split_huge_page_tail() where the ->private field of thp sub-pages is not filled with swap entry. If it could have set, I think these are the only places where it would have done, per my understanding. CMIW. > 2) How did you come up with 417013e0d18 ("mm/migrate: Add >    folio_migrate_mapping()") OOPS, I mean it is Fixes: 3417013e0d18 ("mm/migrate: Add folio_migrate_mapping()"). My understanding is that it a miss in folio_migrate_mapping() where the sub-pages should've the ->private set. But this is just a reimplementation of migrate_page_move_mapping()(where also the issue exists, tmk). commit 3417013e0d183be9b42d794082eec0ec1c5b5f15 Author: Matthew Wilcox (Oracle) Date: Fri May 7 07:28:40 2021 -0400 mm/migrate: Add folio_migrate_mapping() Reimplement migrate_page_move_mapping() as a wrapper around folio_migrate_mapping(). Saves 193 bytes of kernel text. Thanks.