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 5DA503A542B; Sat, 28 Mar 2026 17:24:18 +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=1774718658; cv=none; b=tDhKxw2rpInhY3oz9c0Yb4xJzTI6LIMTrkGHFVIdGRGsx5MsUARzIhZlaWtS7+R7f4q54jp2OtqPt9RbgSZvuSsoM8knJvVMKQIwf957hXzOfYNr52DDlg4RNObkvy1M9NsCGyWyd728YY5ClKttwFCn71rA/DGUWI0qSqXe+n0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774718658; c=relaxed/simple; bh=xJrrCtoEJEbKyudyQ6eBIwNiMqyIA+gXrBCwV3hcjTk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AwqcmpBa/tuhb329Jel1jJA0CabEzdfOyFNQ1TbYyI1hprq64qRNsuNJuicP3tDoMZlISvNXUZoMmyCj/tL1nZtb49BA8T0ISlFufPuA4Mk64HsbygOCKKOzc87A/HdC7xS26rs7VjvYlNIdiT4Y0QTEvsfjSEMo+9YabiiocSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YxMa1z7J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YxMa1z7J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6980C2BCB0; Sat, 28 Mar 2026 17:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774718658; bh=xJrrCtoEJEbKyudyQ6eBIwNiMqyIA+gXrBCwV3hcjTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxMa1z7JQD1bg7ZdA5XktEe5juSvFFUGjvuOpb+1vEpUwNSe/RqC5XanXNQU4Xf61 NWhC4Y/q/Oy01fj6SE1qOjAUkjutZOUUksV5826Q6h7O5SVZaxUh0CEEmF100G+2Vr 7HjOqpmMv/2fVNVB4tKczWGugz8g3SptlGsXcyGit49UXXR9lZFN7pMZ9d4igcokx0 f4qiVub4MjZhlBAoQJ2PBiNmyZFl2lkSyE9uZIFhk8rwv9lgGmPEtcQHhrxFWI+TEg 4PyNBAYsrUbFym6Ah2qCg/xJlQoEYhoB/RSRaeguxRAfnBsxJ4et9elpNXdX3m+40A 7Qjy/lO27ZSlA== From: SeongJae Park To: Cc: SeongJae Park , "Liam R. Howlett" , "# 6 . 0 . x" , Andrew Morton , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/2] Docs/admin-guide/mm/damon/lru_sort: warn commit_inputs vs param updates race Date: Sat, 28 Mar 2026 10:24:13 -0700 Message-ID: <20260328172415.49940-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260328172415.49940-1-sj@kernel.org> References: <20260328172415.49940-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DAMON_LRU_SORT handles commit_inputs request inside kdamond thread, reading the module parameters. If the user updates the module parameters while the kdamond thread is reading those, races can happen. To avoid this, the commit_inputs parameter shows whether it is still in the progress, assuming users wouldn't update parameters in the middle of the work. Some users might ignore that. Add a warning about the behavior. The issue was discovered [1] by sashiko. [1] https://lore.kernel.org/20260319161620.189392-2-objecting@objecting.org Fixes: 6acfcd0d7524 ("Docs/admin-guide/damon: add a document for DAMON_LRU_SORT") Cc: # 6.0.x Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/lru_sort.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst index 797962a459e6..5b8e16394228 100644 --- a/Documentation/admin-guide/mm/damon/lru_sort.rst +++ b/Documentation/admin-guide/mm/damon/lru_sort.rst @@ -79,6 +79,10 @@ of parameters except ``enabled`` again. Once the re-reading is done, this parameter is set as ``N``. If invalid parameters are found while the re-reading, DAMON_LRU_SORT will be disabled. +Once ``Y`` is written to this parametr, the user must not write to any +parameters until reading ``commit_inputs`` again returns ``N``. If users +violate this rule, the kernel can do undefined behaviors. + active_mem_bp ------------- -- 2.47.3