Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2624749rbb; Wed, 28 Feb 2024 07:37:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoS/ClsMGtzvLpxirvGzDQJz2V0V7NvhN5o1AHzB+JXe47BIX3dK159YmYHIhccsTOP7r2jLlC9FbhDpcUsaocdYeVQLjJtJB5mfnH4w== X-Google-Smtp-Source: AGHT+IEzLwPIYMSSBq3OR+/9XPus0QpoHI4s5s0Xj9anyltioUwhBS0rZPHRDkH8v6zqxAZE/9Nx X-Received: by 2002:a17:906:45a:b0:a3e:fc79:c92b with SMTP id e26-20020a170906045a00b00a3efc79c92bmr31656eja.31.1709134652177; Wed, 28 Feb 2024 07:37:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709134652; cv=pass; d=google.com; s=arc-20160816; b=B8U4Li4Mu4MaJPos8TF6UeI0kdyhpjPulWPTUr45IMtkx9MFBA7i2nuBzZITQSK9l/ ZTE1ZRX6wQdwPr67FdHy792Jzf59dhU23u+AZ6Ql25qaFBd3Fj/+tNOSW1OQU83ivVct UnaM5SMGxEQCN+2cXlhf69AZ4LF9hofrYfuy0+HRPFRUGhk4X4EEytU+Y+F7tHgvGAlw PLwuhchvSM08lUyJpbnPDwFO6Ef+efMctx4J2VZrevBfAh9gsTo1N0xtb9AHYUyjUxAe jOYcwJBiTaitTHe/VuXk3MPoL6ks/yjzPgmwTFHmvYnr+Q8Opy5nvln3+ZcSpzOtRss1 rPSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=rzh7fFKDHPXXBiFPuiszpKYf6i6kw5PNZfcDhIT104g=; fh=NSItWNY92nkI+CrC9+tY/yn5HgChaXLYmo16Bhzx/hk=; b=IiRoHTmjId1bWjZ9HMDxIAWxXrZQykFUgxZQDEnlXlQc4Egg+N5ZBG/BzMj+qWTfIj yda9g0bj7GshntCuoZs02wn/xWOus9n/drUjSjIyxecwybv7sqIgVuY/v1F6jAE+aVEe zHLjPu5oHXLK4gVAlo+67Rj3kaBlyrJ5opsjGNHaVOl/ycgMZOOgjisOGGPDbxTN2voo qkJTKWYb0EJaDoZb2UKD9YHa5pbaBl2uEc1pj1kDFJWlgkok8mvzGWWGjPpmhsa9s+Nc 622PLAYIR55vGNQalXjXdVNiPebrZ84tuTY8lW2r4DcxqvSvYwnpg9sHR7r9JVNVn9Kk R+WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SYKdGNXZ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-85269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f8-20020a17090660c800b00a3f85e6d3d4si1871119ejk.1035.2024.02.28.07.37.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 07:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SYKdGNXZ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-85269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id F18081F246DF for ; Wed, 28 Feb 2024 15:37:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B467315CD55; Wed, 28 Feb 2024 15:36:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="SYKdGNXZ" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 696CF73515; Wed, 28 Feb 2024 15:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709134615; cv=none; b=gezZtcPHObskQFCyTByU62cybkwltmFp83cNXQEHNyazQdpAw3un6Ayx+QA7X/y3VOv106qkX284KVL4BrK/qd2trjoEFkBcWIaPUmWklDJrypiAnSiCZmhvZ/wrB8f03Lw/H9WkT21PTyGepl3doYGyBc7+fAr+D+LEbjnK25Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709134615; c=relaxed/simple; bh=oppvgGkmN+5BSfIdEQzSl7am8hiJSjwTgH3zq3ioVBc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=CtyHZAmYRd9LaVYvWbFxXzlqy3sBe56AliZP1qG60LpXdcSTW2AAqjlrZ5Nt6xRxhTV+G+ds3ytqlQbJ2y41zBE0S7+Edu37oiJySQuj2RhnbMKWRZ8sO6A0IWNGZBqA7MUIERBuqj36ncNc3fvVp9mMTK1p5s1Hetpuvxp3Uac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=SYKdGNXZ; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41SDd9vi008537; Wed, 28 Feb 2024 15:36:28 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=rzh7fFKDHPXXBiFPuiszpKYf6i6kw5PNZfcDhIT104g=; b=SY KdGNXZgrPZXVr+9BRHFyUy78XbJmIkyTvZ7gXMjPeu/SFyoVJjxC1ESOY6FobeiT I4Tfkug2ynU9bUZkt07rm8K75dYfX38boPkRbHJZEj9rFsNprDSd10ngubbeKCDM jt7MShm1QfQk83GucwGKdxoJFWT1Kt6rB2KxO3OfUByaswDLgYFDxlC4ZmBadJND jkeTOc2Cub8svfkhQqIW8hgpYZD0N7FJxBgA3e3Pe/VxXUKuF9jvY/2G8oaKtDnz wccOeIdftI01zvXsImb2t/sJmJQWtR6lMnVze7g52WrWQcrwi10TpwSFTcScUX4k XqX/v42Xcw08GhQQKO0w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wj5wc8a9w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 15:36:28 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41SFaRXo005518 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 15:36:27 GMT Received: from [10.216.4.223] (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; Wed, 28 Feb 2024 07:36:23 -0800 Message-ID: Date: Wed, 28 Feb 2024 21:06:19 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: Zi Yan , David Hildenbrand CC: Matthew Wilcox , , , , , , , , # see patch description , Huang Ying , Naoya Horiguchi 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> <30ea073d-0ccf-46e1-954d-e22f5cbf69f7@redhat.com> <1ABD022A-35FC-4A6E-ADAD-36F3D745FB91@nvidia.com> <42be658c-cb13-4001-aae4-8d8275a84038@redhat.com> <07A26237-B17E-4418-9A19-E86F450B9695@nvidia.com> From: Charan Teja Kalla In-Reply-To: <07A26237-B17E-4418-9A19-E86F450B9695@nvidia.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: 3DgsQ5K6CdeE7HoNgVxwNN7q32GPa0T7 X-Proofpoint-ORIG-GUID: 3DgsQ5K6CdeE7HoNgVxwNN7q32GPa0T7 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-28_07,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1011 priorityscore=1501 mlxlogscore=999 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 impostorscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402280121 Thanks David/Zi Yan, On 2/27/2024 9:45 PM, Zi Yan wrote: > So likely we'd have to fix the stable kernels: > > 4.19 > 5.4 > 5.10 > 5.15 > 6.1 > > That's a lot of pre-folio code. A backport of my series likely won't really make any sense. So, I assume this is a consensus to have stable-only fix for this issue. > > For v6.1, the fix would like below? > > diff --git a/mm/migrate.c b/mm/migrate.c > index c93dd6a31c31..c5968021fde0 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -423,8 +423,12 @@ int folio_migrate_mapping(struct address_space *mapping, > if (folio_test_swapbacked(folio)) { > __folio_set_swapbacked(newfolio); > if (folio_test_swapcache(folio)) { > + int i; > + > folio_set_swapcache(newfolio); > - newfolio->private = folio_get_private(folio); > + for (i = 0; i < nr; i++) > + set_page_private(folio_page(newfolio, i), > + page_private(folio_page(folio, i))); > } > entries = nr; > } else { Similar to this is what we had tested[1] internally and observed no issues. Can this be taken to 6.1, please? [1]https://lore.kernel.org/linux-mm/8620c1a0-e091-46e9-418a-db66e621b9c4@quicinc.com/ Thanks, Charan