From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6732F383333 for ; Wed, 22 Jul 2026 22:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784760844; cv=none; b=tCxp8XIIA+WwEDXM4oKp1tuo+vXXrO8Ef+V62X7hviLAM/tGzpYID/hUi3kVUwAHukNKoe4FxOHDOt8eSZ2WeX+7wAUVfntcoDS7o4/qbrr7QtW/wD6FJPlXAivsrw/C6dhkX5OuVTj4W65+JqQMBBcn2KzHoZhmH/MyymTYbNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784760844; c=relaxed/simple; bh=f9Sl0yWbyagfGAjutrgr6RuQ4YPMCyTjNjJXgcracSo=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=rchecJQUtTGljiJjqslTNOQZ1RaXd+xJZQRJTfrrZuY8NTXqvCb6ljd77PknDBM5TtzPxWuL+x/1CLJlQavj6VbgUdkzqosKs8w/vvDxOCaxNwoa4SfB2NDUJlEzdoLbyVxiBbaxritKJKELZrzixf9SU7mB/FA0z5ZEx9q6QFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=0+cFNP5V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="0+cFNP5V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E42431F000E9; Wed, 22 Jul 2026 22:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1784760843; bh=ZZH0UCJW2OUCFvq2mZvsq/vH6LEHSHRw0NfCnh2a/1c=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=0+cFNP5VCjlcHpDbvEpfxcNnlP3pj6eAQgM+HLiNXa+SMAGtEo5bRYzNZS+dsUwUy 1hTF41aqNo2etfxJz3CBoyRGO1uyg8rQ5p3k9ozOGm/t2ct6lEVcxf3InCdxoT1kvR vZsrxWbd+qHtRph7/Wt70Lxwo7znJ/n89iyKB1+U= Date: Wed, 22 Jul 2026 15:54:02 -0700 From: Andrew Morton To: pratmal@google.com Cc: Anshuman Khandual , David Hildenbrand , Vlastimil Babka , Greg Thelen , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/page_reporting: Add page_reporting_delay_ms sysctl Message-Id: <20260722155402.f313e8a98615bd3b513221eb@linux-foundation.org> In-Reply-To: <20260722211517.1898228-1-pratmal@google.com> References: <20260722211517.1898228-1-pratmal@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 22 Jul 2026 21:15:17 +0000 pratmal@google.com wrote: > From: Pratyush Mallick > > Currently, the free page reporting daemon uses a hardcoded delay of > (2 HZ) between reporting intervals. While this is a reasonable > default, it lacks the flexibility to adapt to varying guest workloads. > > A low delay allows aggressive memory reclamation, returning unused > pages to the host as quickly as possible. However, during spiky > allocation/free churn, this immediate reporting can lead to a severe > performance penalty (nested page faults) as the guest re-allocates memory > that the host has just unmapped. In these scenarios, there is benefit > from increasing the delay to batch free pages over a longer window, > absorbing the churn without hypercall and re-fault overhead. > > This patch refactors the delay into a dynamically tunable sysctl, > /proc/sys/vm/page_reporting_delay_ms, measured in milliseconds. The value > defaults to 2000ms to precisely match the original (2 HZ) behavior. > Seems reasonable. > +The default value is 2000 (2 seconds). The minimum allowed value is > +0 (immediate reporting) and the maximum allowed value is 10000 (10 seconds). Why implement a max? If setting it to something enormous causes bad behavior then Don't Do That?