From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796054034; b=lfk3lRbeL5lzWiSxWp1oy3CRA9jd4K0a87LjIpcLGa/y9KYI1yeio0Lp0CRsHIWv3r9l rvOBOMBGhb9fWAFnmJabPhpncYuKAXUTOh7voliTonyDbTzFbW6IOVN+NKOM0kAoyunf0 CLRGmpBEVAcvvwct3+pnKavahHU2OksSsmkr219DayMhKdxIWQGz2ily1Lr7ebX1RX0z+ 7c8jcjcx2XCjhwjq4M4wNA9AJG21+Vt1pERY/9ss8j3sjsVjQax86lh+B5ueVJWwTNUgt 0PehcYcyKKIovVTAgicTeeVFEMOSHYUX3GuBfeQNsQLbygj6qa8fXQIV4lVF0PnLqvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796054034; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=aCDAaRhghy+4OcMAg+IG3Iz/c8rbdKckfUDzOS0yxcQ=; b=Mqe7bjUS1P9RUO7qGziL1tLmbD6HJFNeEJ/8dTX/42tl4EXQufkNh7OiyAmS/n5HOha3 YBfGi5pWNmbfJqyHA4QT54D+SQ77PyH73ODXBB9YT55Ys6Mw6CvIb2lZjW4jVZJKphTb/ Zs2N3vq72RzLQ6YAPotGPmCly4UohD0KXsfYs8yKB+HyL2UOqcQGPx4C88JeH46IC4s2g g5A6nUfQU3dtRWiN+gtLvz00auFznzbZI2+7DRr6w0jnRxRgMwN9YjnX76aoe3Ntgs347 3H2bs5Lx58F1X5k+zwg3ExrcTqPP0OWdVIN6mR9yrfUwGkE0nGrYocvvQhl/7oXUdAw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KbpC0s5p; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0461606A33A; Mon, 30 Nov 2026 15:53:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KbpC0s5p Received: by smtp.kernel.org (Postfix) with ESMTPSA id A905F1F0092C; Mon, 30 Nov 2026 15:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796054033; bh=aCDAaRhghy+4OcMAg+IG3Iz/c8rbdKckfUDzOS0yxcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KbpC0s5pyU8q/rJSVw+Oj1dkcJhYGJmkseGzQBBTZoZcjRBVqfzZoNGVnbqHcy8/C RjfcoNdAFwR61yiEQhK6o0MCrlXBqJQQixqJeEGOjCkY4N/j6VDT2nGC3QRR/szqwl VedPIJT9NY0wqU+aXsErF2u25Z5hkQ/LPPMt2oy/YcyIWgWiEMLQ49RWWqcH127HHR JOIFlBMshKAgi55e4BLxv2VJWKN5+NxnONxJV//nUUUo1rR0K0inrkGQ72rBLRoZnF f9JtAYW/MmCnm7HZsUFU1aIsYpBoWE8lTkY1PcUYY2OhAtEDvFPNbFjaYSXjRqHkpG q3oXv9hpe95VA== From: SJ Park To: Aveline Noir Cc: SJ Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] mm/damon/core: preserve region age differences during merging Date: Mon, 30 Nov 2026 07:53:46 -0800 Message-ID: <20261130155346.90801-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130-damon-preserve-region-age-v1-1-8701093ad356@gmail.com> References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Mon, 30 Nov 2026 23:25:42 +1100 Aveline Noir wrote: > DAMOS can split a region to fit the remaining quota and reset the age of > the part it acts on. If the two parts still have similar access > frequencies, a merge can bring the size-weighted age below the scheme's > minimum age and delay work on the untouched part. But it will eventually be processed. In real time workload that runs for long time, I don't feel like this could be a real problem. > > On the first merge pass, keep adjacent regions separate if either has no > accesses and their ages differ by more than both ten aggregation > intervals and the younger region's age. To me, this feels like an arbitrary heuristic that made without clear reasoning. I'm concerned about the complexity. > Leave the retry passes free to > merge them when the region count exceeds the configured limit. > > Signed-off-by: Aveline Noir > --- > Hi all, > > I'm not sure how this change would behave in production. I ran an > eight-range SQLite workload for 900 seconds per run with PADDR, a > 120-second minimum age, and THP=never. Do you mean you ran DAMOS_PAGEOUT? > Started with the default limit of > 1000 regions. In three exploratory pairs with tracing enabled, the patch > saved 164 to 203 MiB, but SELECT throughput fell by 3.60% to 4.04%. > Including reclaim and tracing, kdamond used 32.88 to 42.54 ms more CPU > per monitoring second. Swap-ins increased by roughly 65,000 to 96,000 > pages. With only given information, I understand this patch can make DAMOS more aggressive. Correct me if I'm wrong. This result concerns me, since users might show more memory saving but also performance regression. > > So I then tried lower limits. What is the lower limits? Lower minimum age? > In this case, 300 regions looks like a > reasonable trade-off. I'm not sure from where "300" regions came out. > In six fresh pairs with tracing disabled, the > median memory saving was 84.45 MiB (76.89 to 97.12 MiB). Median SELECT > throughput loss was 0.72% (0.28% to 1.03%). The median increase in > kdamond CPU time, including reclaim, was 10.64 ms per monitoring second > (8.18 to 11.94 ms/s). Swap-ins increased by a median of about 35,800 > pages. I'm not clearly understanding what this means. I understand you are saying the impact of this patch can be tuned, though. I don't feel like it is a good justification for the complexity of this patch. > > Those measurements used the same merge rule on a v7.4-rc2-based kernel. > All 56 DAMON KUnit tests passed with this patch on damon/for-next in > x86-64 QEMU. I may also experiment with different age difference > thresholds later. > > I'd be interested to hear from you guys :) To me, unfortunately, this looks like adding too much complecity for unclear benefit. Thanks, SJ [...]