From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 5BFE9387349 for ; Mon, 2 Mar 2026 08:54:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772441699; cv=none; b=CeZ1AVYXV+XLLqUnB6/C5yumf7uq7YdIbBnNuu5M5dElV/SmtKuUIhMhFTMPPqKFw+m7mXagCCVk5DhQtWGJd7nt2t+OmyTMu9ak32SYQ1SNNIGfUZDKgB0rm5Oc/hHNH+ITGe8eAvlKJsJTQb67MS3aXIAkxkZsJo9ytlRca7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772441699; c=relaxed/simple; bh=yAVNgr9MNWD3wb1JJDuoyQVT80SX0m0ChtTIobo4WTM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JR5x5iRXlROhdPvaZWuSPaoA9t3xPtaXlq9P3psdqVilTRQmEqBfQzNs9L26syrZqqJxF+LpaCrpJ34IIm6w54LX9qqrYaUGZM0YwClgvI1A6woa8XVdbcwp47Y7TtY8HgZg1MxJHYoHqOXjEPn9kjTtAgyKF5QKL5GNQE2HUeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UiXClT8S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eCD6e4gU; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UiXClT8S"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eCD6e4gU" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6227hNpZ2158194 for ; Mon, 2 Mar 2026 08:54:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= FDAsilwm29vpqMN7M32WikMZCz3A2rKxXxCHXUW3bm4=; b=UiXClT8StLpOkcSl GGZSemcy/y3pud38KNf984akTJRGXanuWkoBn4K0tBx1GU2xO1Rw76YMi+MCilXZ d7iIiFsJxK6WvdkR61nk685Mf6YvuxHIW+Xg1lHEK+7HSvJvwT25Koj0QeNEi4KN pHZkQDdU6npQtZadSHXg2Izeon+kxnPAQS6+0u4DuLd67gnMzPE59qRxBkpu+y2D 4dPyx07m12llki85ccLuuKRIvmVwbarFNUGXVmyt0CcEUNPezkVuqudZfx3+1j3G G1rO+zQEay0LFMFPXg11Nud0CFhRvzMU7089CwF4iuO5gJYP4X+2gD6UHeN+zbMY fBfEXQ== Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cksgrvvkq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 02 Mar 2026 08:54:57 +0000 (GMT) Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-463a075e0f5so60575212b6e.1 for ; Mon, 02 Mar 2026 00:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772441697; x=1773046497; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=FDAsilwm29vpqMN7M32WikMZCz3A2rKxXxCHXUW3bm4=; b=eCD6e4gUpfjq3RyyXKylETOFeTAOX0lOoG6jgRudE1FT0RJY9Q9/BJMVjEsLYp0cSB EM3A7kqh3jpYe9X4vPmQohNVeaHU95eM0uiOehz/2YVaxOj798hjTC+hZMUTxMBfpe8y iqpnavrVy3kG4iitcgXaqf7X34FD/3GQWOjtawRzT0bP68bNpXcFWTSnjUnB2s3OFwLG rr4BJm8qwjb+aTgLW42HVYjJ22ACdbKU+fCjUmvr38y/x+DOQYXB1QFByDpzF3f6VkiQ +sZ4Pe0jYXFLTZi925BeJ4gReWvowGFLnPLJ70UUmxCId66DwWK3tsKbZMN/N/0xfRK/ GAgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772441697; x=1773046497; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FDAsilwm29vpqMN7M32WikMZCz3A2rKxXxCHXUW3bm4=; b=KJXuB176LylQ0Ox7pyNi5tggv5ghbOPHodegkoE7ejSVHMIEdRKsFzLsD+kVxm4SPJ YEcO2tmYJq2YWMYXDYQl5JbVuKITwJMKAtC1Z3X1Ohvucm487NJuSWVRw/km+1pWK2Wz KSplBeqQUegsq/Mi8CAuAYbkE1+rsn9Fz6Ij037dx1Cs2w/1Y0bnqhKjSap7cLc7vxaI M8lM3NjooveLG5dRaap9oeE81FO3dEDdB4LAyW9WvpV94w3EpsDbV71Y7KZ9KxCYdDVl Xnf8/7154w9cWQE2N2VD2aGKwQbtDrLrmRx6iyQTbz67jqyMtUfnbT1kEI3gztkO81uL zvsw== X-Forwarded-Encrypted: i=1; AJvYcCVxnR3oUjYN5tFtfJJMIaMo5yV+wchbssaE66fPue6MprWCwVzfHoi8KlCVLmrJRLfmo2XOL2Ffb+68q1o=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9ZJ4HQDoZ9IquDS/pnMUdg8T/Ns9mfB1kpieuvWvpfuv4Ix3L 1l7IyzILMfG0VH6VRcQIi8CRJgIFQ+rL4d+GmorD/sY+F54aqvqlht8uAQYxRJV39UMEAjCR/r6 6U1973Gm9lh4ijTmZNVLL0G05XrcmkBYLfuS5Qjw3Z71FAVOn6cZCzRLLAiDhxDujiPM= X-Gm-Gg: ATEYQzzI83GDrgLUTjNz+C2L70W1pUK8rk6ZTpm+qlceLwvB3de7EvzVPE5xFDRWnCK Ur3dNM8CdtcXhMceuCGcbv9bg7rLo4jB7vC+ox2cTkaUpMVfHnRhKj34v772f4t0kIA8PsEJDpO 3iP8Z1vWdmFGQWC70EBLl9H31nMecqBGCqXmTBVsf4lvLXAZWG1Xlw/7pbJ0XTXeWRui03/9QZl hXwY9ESoQ4y1btaJKS6L6QYUFM9uT1dM3n+Ak3gSbdXiooxp+C1ta6Unl0WPiUFFzsAG6DWztfk l+Gqt5Qx2h4eiSceAS2F8pidz6RV1VVitu+utilJphQYS21BSO9i2B26N7LqKtR/O25yWLSpFCH 72WHvXfKAU831CQWfjzo+TaxSblmBoUqJ3aCNkQJnBuLqcZZ8sPZSMvOSMJlkETt/gYDFqeKYUc SeZ6e2 X-Received: by 2002:a05:6808:17a2:b0:43f:28bb:2f85 with SMTP id 5614622812f47-464bed089e3mr6071933b6e.8.1772441696807; Mon, 02 Mar 2026 00:54:56 -0800 (PST) X-Received: by 2002:a05:6808:17a2:b0:43f:28bb:2f85 with SMTP id 5614622812f47-464bed089e3mr6071919b6e.8.1772441696393; Mon, 02 Mar 2026 00:54:56 -0800 (PST) Received: from hu-ysakshit-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5614622812f47-464bb3ab494sm6981075b6e.8.2026.03.02.00.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 00:54:55 -0800 (PST) Date: Mon, 2 Mar 2026 00:54:53 -0800 From: Yuvraj Sakshith To: "David Hildenbrand (Arm)" , Michael Kelley Cc: Michael Kelley , "akpm@linux-foundation.org" , "mst@redhat.com" , "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "decui@microsoft.com" , "longli@microsoft.com" , "jasowang@redhat.com" , "xuanzhuo@linux.alibaba.com" , "eperezma@redhat.com" , "lorenzo.stoakes@oracle.com" , "Liam.Howlett@oracle.com" , "vbabka@suse.cz" , "rppt@kernel.org" , "surenb@google.com" , "mhocko@suse.com" , "jackmanb@google.com" , "hannes@cmpxchg.org" , "ziy@nvidia.com" , "linux-hyperv@vger.kernel.org" , "virtualization@lists.linux.dev" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1 4/4] page_reporting: change PAGE_REPORTING_DEFAULT_ORDER to -1 Message-ID: References: <20260227140655.360696-1-yuvraj.sakshith@oss.qualcomm.com> <20260227140655.360696-5-yuvraj.sakshith@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAyMDA3NyBTYWx0ZWRfXyEAotpFEf58y FK70XGDoSs99YpjSZB4ED+c9oBpFLrf3n4v/Cy9FtjTiQ3zmP53jnVu+fGUqm88uuAB9HZSwbZH 3SD9t8Ft5wep6Qgn5tE7ElC1EjDm93FOv3uI+wH5d7g8Ngy2FQXVlqOu2dl0eTSMNNL1QNubgB/ 6SJQVPLTaDECaBiNX1ItlD2PvWZYNRsO/hcOyIqkA9201TUs9AAB1TB5HiFNIU18tE0nNeR5K4Z izEZbODyFYrzNo7YmD5L4ecTV2wiX8r0RefNaMBM58q3FOeIsPJKM+dKmYwLawe/dDn9SiXnOOh 6LVW8qLA8JsNRY8oL36ZADIuqEjhpx0sCH9jaZRrpSEAMMyBHXCfGbk4HXUn4RK7no06xoyLL4x 7LvSoCa0CuC65dLWj2wXFY7Ilh4XKReFmfU5a2ZO05Wz0lPkdsmcCiBFKcBcZ4G6qBBpZIYVop9 k8vSg2RNswMXEonI5oQ== X-Proofpoint-GUID: d515mGhUGEb83Onuj4EfSZksy5Si0e41 X-Proofpoint-ORIG-GUID: d515mGhUGEb83Onuj4EfSZksy5Si0e41 X-Authority-Analysis: v=2.4 cv=Zqzg6t7G c=1 sm=1 tr=0 ts=69a55061 cx=c_pps a=4ztaESFFfuz8Af0l9swBwA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=GS-8L0ZNGZhbl8INtmIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TPnrazJqx2CeVZ-ItzZ-:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_02,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 spamscore=0 priorityscore=1501 phishscore=0 suspectscore=0 impostorscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603020077 On Mon, Mar 02, 2026 at 09:09:13AM +0100, David Hildenbrand (Arm) wrote: > On 3/2/26 09:00, Yuvraj Sakshith wrote: > > On Mon, Mar 02, 2026 at 08:42:57AM +0100, David Hildenbrand (Arm) wrote: > >> On 3/2/26 06:25, Michael Kelley wrote: > >>> From: Yuvraj Sakshith Sent: Sunday, March 1, 2026 7:33 PM > >>> > >>> I don't think what you propose is correct. The purpose of testing > >>> page_reporting_order for -1 is to see if a page reporting order has > >>> been specified on the kernel boot line. If it has been specified, then > >>> the page reporting order specified in the call to page_reporting_register() > >>> [either a specific value or the default] is ignored and the kernel boot > >>> line value prevails. But if page_reporting_order is -1 here, then > >>> no kernel boot line value was specified, and the value passed to > >>> page_reporting_register() should prevail. > >>> > >>> With this in mind, substituting PAGE_REPORTING_DEFAULT_ORDER > >>> for the -1 in the test doesn’t exactly make sense to me. The -1 in the > >>> test doesn't have quite the same meaning as the -1 for > >>> PAGE_REPORTING_DEFAULT_ORDER. You could even use -2 for > >>> the initial value of page_reporting_order, and here in the test, in > >>> order to make that distinction obvious. Or use a separate symbolic > >>> name like PAGE_REPORTING_ORDER_NOT_SET. > >> > > Option 1: > > > > if (page_reporting_order == PAGE_REPORTING_DEFAULT_ORDER) { > > if (page_reporting_order != PAGE_REPORTING_DEFAULT_ORDER > > && prdev->order <= MAX_PAGE_ORDER) { > > page_reporting_order = prdev->order; > > } else { > > page_reporting_order = pageblock_order; > > } > > } > > > > Option 2: > > > > if (page_reporting_order == PAGE_REPORTING_ORDER_NOT_SET) { > > if (page_reporting_order != PAGE_REPORTING_DEFAULT_ORDER > > && prdev->order <= MAX_PAGE_ORDER) { > > page_reporting_order = prdev->order; > > } else { > > page_reporting_order = pageblock_order; > > } > > } > > > > > >> I don't really see a difference between "PAGE_REPORTING_DEFAULT_ORDER" > >> and "PAGE_REPORTING_ORDER_NOT_SET" that would warrant a split and adding > >> confusion for the page-reporting drivers. > >> > >> In both cases, we want "no special requirement, just use the default". > >> Maybe we can use a better name to express that. > > > > Agreed. > > > > If we were to read this code without context, wouldn't it be confusing as to > > why PAGE_REPORTING_DEFAULT_ORDER is being checked in the first place? > > I proposed in one of the last mail that > "PAGE_REPORTING_USE_DEFAULT_ORDER" could be clearer, stating that it's > not really an order just yet. Maybe just using > PAGE_REPORTING_ORDER_UNSET might be clearer. > Ok > > > > Option 1 checks if page_reporting_order is equal to PAGE_REPORTING_DEFAULT_ORDER > > and then immediately checks if its not equal to it. Which is a bit confusing.. > > > Because it's wrong? :) We're not supposed to check page_reporting_order > a second time. Assume we > s/PAGE_REPORTING_ORDER/PAGE_REPORTING_ORDER_UNSET/ and actually check > prdev->order: Oops, typo :) I meant prdev->order. > > if (page_reporting_order == PAGE_REPORTING_ORDER_UNSET) { > if (prdev->order != PAGE_REPORTING_ORDER_UNSET && > prdev->order <= MAX_PAGE_ORDER) { > page_reporting_order = prdev->order; > } else { > page_reporting_order = pageblock_order; > } > } > Great. Much more clearer on page_reporting.c 's end. Don't you think on the driver's end: prdev->order = PAGE_REPORTING_USE_DEFAULT; looks clearer? As compared to: prdev->order = PAGE_REPORTING_ORDER_UNSET; ? I'm thinking, why would a driver worry about page_reporting_order being set/unset? But yes, too many flags... Thanks, Yuvraj