From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (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 E594A18CBE1 for ; Sat, 7 Mar 2026 02:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772850226; cv=none; b=JnEOrdZvtU7F45pMMEaY51t75QuHGG8hA/Gzj4cvxDJRWcRJkfIRlc5n0oc0C+i9JXvAOlEfUmtuyEVNP1jcmFvQrLGeIlQaTP71Uh04PJIX2o3pSRHyiuOEAj6psjSLq3CBcE2fK1RRH5oaQJWJal/bU/2D13+JFCh4e47khhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772850226; c=relaxed/simple; bh=ZIPCFS2pByaXrj2N4SXZreg4gfzWLCfGQR3JUNI4Cg4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ohU0jdphqs3GH1wo3fi5ekWRWqGLe37gxQOKR0a9DiA3H7e3qOnH48yG1BbOCtMqfV6r3hLB/bwdT8N9w9iIFeJt9szji5aHYZNV3sfgTksqi6Kuu9fAi2vk5jrZ6FxQX7hA6O7UoUU+S+9cnEBU0zVGrDO7AAWY3dEnjm2yHlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=IEp20MNj; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="IEp20MNj" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1772850222; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=Lw0B4A0Tge8dNKKTRFvubRt7KamBtESq34Gr8317Kv4=; b=IEp20MNjypr9UrNpfYdGqCFflyXv8jZW3RERgPYEWsvZOxjASq3VH1+ZRRM2lCkivyBKjeyuUMUx1U4vRwmGjGY+np9xeGLlPrHQP4TfzWYzQ/uaY2wCDBw9DlKMEbijB+Ly5mdSiwKk/npejzamPvw+kgqhzlaEYNjwmRcelOo= Received: from 30.42.98.36(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X-Ob681_1772850220 cluster:ay36) by smtp.aliyun-inc.com; Sat, 07 Mar 2026 10:23:41 +0800 Message-ID: <41a26cd4-f11e-472c-89a4-3418f338f97e@linux.alibaba.com> Date: Sat, 7 Mar 2026 10:23:40 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] mm: huge_memory: refactor anon_enabled_store() with change_anon_orders() To: "Lorenzo Stoakes (Oracle)" , Breno Leitao Cc: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, usamaarif642@gmail.com, kas@kernel.org, kernel-team@meta.com References: <20260305-thp_logs-v2-0-96b3ad795894@debian.org> <20260305-thp_logs-v2-2-96b3ad795894@debian.org> <8b238664-4375-413c-a8cc-105d98430362@linux.alibaba.com> <789df8d5-7d03-4e3d-90b6-08f27af330b2@lucifer.local> From: Baolin Wang In-Reply-To: <789df8d5-7d03-4e3d-90b6-08f27af330b2@lucifer.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/6/26 7:22 PM, Lorenzo Stoakes (Oracle) wrote: > On Fri, Mar 06, 2026 at 02:30:22AM -0800, Breno Leitao wrote: >> On Fri, Mar 06, 2026 at 02:07:50PM +0800, Baolin Wang wrote: >>>> + mode = sysfs_match_string(enabled_mode_strings, buf); >>>> + if (mode < 0) >>>> + return -EINVAL; >>>> - if (ret > 0) { >>>> - int err; >>>> + if (change_anon_orders(order, mode)) { >>>> + int err = start_stop_khugepaged(); >>> >>> Thanks for the cleanup, and the code looks better. >>> >>>> - err = start_stop_khugepaged(); >>>> if (err) >>>> - ret = err; >>>> + return err; >>>> + } else { >>>> + /* >>>> + * Recalculate watermarks even when the mode didn't >>>> + * change, as the previous code always called >>>> + * start_stop_khugepaged() which does this internally. >>>> + */ >>>> + set_recommended_min_free_kbytes(); >>> >>> However, this won't fix your issue. You will still get lots of warning >>> messages even if no hugepage options are changed. >> >> Correct — this was part of the earlier discussion, where the suggestion >> was to retain the set_recommended_min_free_kbytes() call even when it >> is a no-op. >> >> As for the warnings, I see a few possible approaches: >> >> * Remove them entirely — are they providing any real value? >> * Apply rate limiting to reduce the noise > > I think rate limiting is the sensible approach. +1. Make sense to me.