From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1974D606A320 for ; Mon, 30 Nov 2026 15:53:59 +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 kanga.kvack.org (Postfix) id 102DE6B05B0; Mon, 30 Nov 2026 10:53:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B61F6B05B1; Mon, 30 Nov 2026 10:53:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0BA76B05B3; Mon, 30 Nov 2026 10:53:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B98D06B05B0 for ; Mon, 30 Nov 2026 10:53:57 -0500 (EST) Received: from smtpin01.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 064231A0A1F for ; Mon, 30 Nov 2026 15:53:57 +0000 (UTC) X-FDA: 85492231314.01.E8E087F Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf01.hostedemail.com (Postfix) with ESMTP id 2D0C540018 for ; Mon, 30 Nov 2026 15:53:55 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=KbpC0s5p; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796054035; b=p8JIJuCzjsZaQhyrSicjig5eMQq3vFEZJ2LZhLhghHt/OraQ700+GrLI9OLeEsbMaNGe9z TEwAXorUhZ00/lZDjeJWw/69HkxCyBooQF+fMBCD2v0zw7twM1et2zwfebh3RRKwmel2me 72cRx27cmNKsgwu8Vtz4NX2qflj9WPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796054035; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aCDAaRhghy+4OcMAg+IG3Iz/c8rbdKckfUDzOS0yxcQ=; b=hZdxf6dYdwK4fL2xIcWFuUtapPq+4NnZt3CzsDF9pmEpdu8mp097EAoCx4vxK++pGMfgKV Nj84tMCd50UAGB2RvV/dLn1fMRSj/TotUMA/zv/MxZpu5ES4zf0loxN1r3HeYnuP7wXRAB YEbbISpwS8eMhmkfp+F1fD0d/0g9Y+o= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=KbpC0s5p; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of sj@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sj@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 670C444856; Mon, 30 Nov 2026 15:53:54 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: zicn3chhaa55amxsgogziaedc5hb9ds4 X-Rspamd-Queue-Id: 2D0C540018 X-Rspam-User: X-Rspamd-Server: rspam03 X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796054035-604155 X-HE-Meta: U2FsdGVkX1+alYa3hhxZbe1Vn9Otj2pZw+r/6PxwVGi2FOzY+FTFcvniZ4ApoD30/N80t/J2e/QmSV7iDbc1hHSUcRNXP2+KKVrUxM566zv9dXw4/gAYqN6QMC2iytR/OkC4+LwV78ExsobYaUoStv8uiEVOkY2w8lS7S02Xhqcms3ZVvNTN2AfaKO4qH5aWpAGI3XBZoRWLQL+gbMDIEnvieCe1rXRt2odfK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IR52pi6pM2yKpNkL3w5WwqOx1TP7FcBBg9wu7S1Ziqwf4TEyiDER6I+XtKUBD8utLNwLAKi9xWGA0A1R8P7Lnusy5nud7SUpt03e1oGip1MZ8uzx/n2oU9vprw5TXCC2WKYAsuLc= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 [...]