From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2ADF213632B for ; Tue, 28 Jan 2025 01:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738027046; cv=none; b=Ib5qoEWemfFDF8h5gOe/6ad4u1RHPa8YrJXgvGOZt44H3jBAellzxwjA0o6Px87b+kwACygaFpQFk2Nk/rGjrindOX5P165Ok1e7EOr7+GBtJK2ybkjHPA7GPyvHDc2HShK3EByl6WUjkc5bQ4SefOwJbFljkezMSbvA7djc/jI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738027046; c=relaxed/simple; bh=VrOEZ7nDywAf0BBXcJB0NmdyB+cU76ssKHQIORK3FVI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=B94DF6CKdeJ/EXODA1lGZ/+6kSr98d5cQ7zIuH+exRhCk9buhzNmUROJwN0SgHvuPGYoCIFiz70N7RCCPjt/yEgk4lMgckeeJU3Zkb1b/6ma0G3VpN2bmegnx58SH0Ez7+009Ezh2agDFfHE3zEpwghWPRZWCX3mLerA8UdaDm4= 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=SBugd/VL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SBugd/VL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F64C4CED2; Tue, 28 Jan 2025 01:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1738027045; bh=VrOEZ7nDywAf0BBXcJB0NmdyB+cU76ssKHQIORK3FVI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SBugd/VLkdqL3ixp9Cl3D0FNZOer2Fj4IWwOS3wfQjpGgSYmCbdxCr80UtMwau8ea AVpWtoeXYxx+hKCy3WNOeCcvAp7l81JSnXVsm91/LKS9Eee7cmhea6QvJKk9bJ41bo uhZHyYtVuVumYXNn3ZjbG7Utisr83NxhIvd8WLzQ= Date: Mon, 27 Jan 2025 17:17:24 -0800 From: Andrew Morton To: Michal Clapinski Cc: Vlastimil Babka , Pasha Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] mm/compaction: remove low watermark cap for proactive compaction Message-Id: <20250127171724.b9b3dafec55d3101f0ac02bf@linux-foundation.org> In-Reply-To: <20250127215020.4023545-2-mclapinski@google.com> References: <20250127215020.4023545-1-mclapinski@google.com> <20250127215020.4023545-2-mclapinski@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 Mon, 27 Jan 2025 22:50:19 +0100 Michal Clapinski wrote: > Previously a min cap of 5 has been set in the commit introducing > proactive compaction. This was to make sure users don't hurt themselves > by setting the proactiveness to 100 and making their system > unresponsive. But the compaction mechanism has a backoff mechanism that > will sleep for 30s if no progress is made, so I don't see a significant > risk here. My system (20GB of memory) has been perfectly fine with > proactiveness set to 100 and leeway set to 0. Sure. And if setting a particular value makes your system blow up then Don't Do That - the kernel needn't care too much about protecting the sysadmin from misguided configurations. As long as we've actually documented what the thing does, which appears to be the case this time. Please do review Documentation/admin-guide/sysctl/vm.rst:compaction_proactiveness for accuracy and completeness? From what you've said, that final paragraph sounds too emphatic. > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -2253,7 +2253,7 @@ static unsigned int fragmentation_score_wmark(bool low) > * activity in case a user sets the proactiveness tunable > * close to 100 (maximum). > */ > - wmark_low = max(100U - sysctl_compaction_proactiveness, 5U); > + wmark_low = 100U - sysctl_compaction_proactiveness; > return low ? wmark_low : min(wmark_low + 10, 100U); > }