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 D4FB71DA0E1 for ; Sat, 1 Aug 2026 18:44:35 +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=1785609876; cv=none; b=EMyFrFoCIRDDQzWZCHqtRBs3oO9Ogj9CMXRnuU/5T0GMXkAP2X4rDd7I2wr/brbJTelL6Uy0rkCXbwA1fGMkDiYbgMVnHyhW7mGS8uz7RRT84tXg0PwddvRTblciXX0Um1ySEYS0mn9sIVsG/AJQqrc6LX4yTDsZREvL6hu8uzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785609876; c=relaxed/simple; bh=TdeBoFePyTNuB0rkmpLuayMzay8t3XQlnmvLHKy6jD4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=mmYdS+A6p+XhWIGnnQt0pEtt8lICfrcaY9nhys4GjM/aqkoY1LHIRYtDPPeNPWWAKKt/ykxikF8m/ryHTGObHyjO5TdLQ9oD9t92DhtUHoXbHmsl5ciJrloZvtaFX0nuCIqbNIVfbltg3uChyfY+0d/WQbUdFO13t78DDAbekk8= 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=tRA+f+uN; 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="tRA+f+uN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 263DD1F00AC4; Sat, 1 Aug 2026 18:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1785609875; bh=y8y+bsb9FXo0waSAZ+oBgSFJCMPWDwmDTPmWChj/3nQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=tRA+f+uNHWzcq2230xYRE39U26tquDrankE5GTg/qaKx5Mgp0L6CGhZYJW6/csM4x M7VhxWrJ8PFR/7i1J6YayPOiu5px7VzaDNWkn/ssSlnpSmtM/EnAlPQdqnaVHnZNKZ OE+CMyxgu63tZrADobo/7n4/QTvN3QdVwGS95jkc= Date: Sat, 1 Aug 2026 11:44:34 -0700 From: Andrew Morton To: Jianlin Shi Cc: linux-mm@kvack.org, vbabka@kernel.org, hannes@cmpxchg.org, surenb@google.com, mhocko@suse.com, jackmanb@google.com, ziy@nvidia.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/page_alloc: only update lowmem_reserve_ratio on sysctl write Message-Id: <20260801114434.232c97a74d9616c43aac2456@linux-foundation.org> In-Reply-To: References: 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 Sat, 1 Aug 2026 23:11:25 +0800 Jianlin Shi wrote: > lowmem_reserve_ratio_sysctl_handler() ignores the return value of > proc_dointvec_minmax() and always calls setup_per_zone_lowmem_reserve(), > even for read operations. > > Fix two issues: > > 1. Propagate errors from proc_dointvec_minmax() instead of always > returning success. For example, writing non-integer garbage to the > sysctl now returns an error instead of silently succeeding with > unchanged values. AI review suggest that this caused a new problem: https://sashiko.dev/#/patchset/tencent_1BB7A5C4D5EEA67346634417753190E92A09@qq.com Not sure what to do here. Perhaps pass proc_dointvec_minmax() a temporary then copy that into sysctl_lowmem_reserve_ratio if all proc_dointvec_minmax() returns "OK". But really this is a flaw in proc_dointvec_minmax() isn't it? It shouldn't update the table data until all the data has been validated.