From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 087CBC25B75 for ; Fri, 31 May 2024 19:33:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8204C6B0085; Fri, 31 May 2024 15:33:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A9306B008A; Fri, 31 May 2024 15:33:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64AAE6B00BB; Fri, 31 May 2024 15:33:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3BAC86B008A for ; Fri, 31 May 2024 15:33:15 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D0EAFA326A for ; Fri, 31 May 2024 19:33:14 +0000 (UTC) X-FDA: 82179689508.16.A7904DA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 27F07180006 for ; Fri, 31 May 2024 19:33:12 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tQA+EhYP; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717183993; 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=FaiEHOImf343NUNZNcNgf67s9OGHIk+37/5zMQaB4C0=; b=LQ52xTQ267PpU4AqCQAzDxb21gQ1hOhmaD63kmTbldELCt2tWaEoD3DF75Dq1OMN8Fws1F BTJdM8767En4l1Q2m2D85v+M7G1L1fC3jbjd1RnGiAepMzvA57LrQBdzJ9XPwNml4/kJbt Nt9A573DlwvQuNgELoxo+YfPhP866JI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717183993; a=rsa-sha256; cv=none; b=zdmoO2729D4ULB2ikkJKKhejrUgD6Ph/kFFr1NeIRAFgSl/FjI07jP54mFKBQND9FaHhKZ k1j3ItcIcoAOJEjQvTUajjD3oYCm7PbOu9H43Sy5iHzSkHYmuWFoWwbl9nG/T5wK2uE8Nj BelFhezdnZt9SYC2vSAyB7ggAkfYFYY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=tQA+EhYP; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 425A562A0F; Fri, 31 May 2024 19:33:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AE11C116B1; Fri, 31 May 2024 19:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717183992; bh=UCC6c01j73UTS8arQTdjtkYbzlZYjs10+rymqoQJDvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tQA+EhYPDH5Zls+cQIBWkuHQa4L4H+Q1cu6aGNmZZ7sgEgVCjyQB5xhZM/Nprhs/9 iRiOwPA9/m/xc/DwcAo355//hvQSIg395EqBU9J9QFFt3+/BwH/LZ0arKF9XyP5bAF Z86qgFh2P05+2OVddu4Vl3Ii17QbybqAmf7fOThAayULn2yG6w8eP2JGT2sZN/nKXa 0GmBgFRXesMTkPhLXbLpNnlleK2DyuhdqvGRNxROcCTEuApL81R+krWJQFTm+JHiXc EnOxGiEOn8zx46jMJpcjtPmA1J7lGsvUrtrYtt/0f7uGhtzBFlRVFgCB8M0jBl8LNW CCY72pHKf00IQ== From: SeongJae Park To: Alex Rusuf Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/2] DAMON multiple contexts support Date: Fri, 31 May 2024 12:33:07 -0700 Message-Id: <20240531193307.71424-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531122320.909060-1-yorha.op@gmail.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: gs7mrencuuo4h3tfhduw1swytqc31w55 X-Rspamd-Queue-Id: 27F07180006 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717183992-120925 X-HE-Meta: U2FsdGVkX1/qTT1uD0Xq5TSC7/BR3UGesEV3r9PBijRLb4aIXIzbgWYOaHOXDleYs7YFxCavhi43nT0LcAhq0vZPfy9ktv86sOcrSkjACIRd8PzIuKXanapajMEZf922CWExnFuv4qZGxZa2UWbZsJVqg1AuW49iquDhkNbIkTxySBukZjo14j/UGVcC+0JL+wvVU8RqZl5ubeH50qgFlTjOCU9AtJbr0xrDavH6Y/YJW5mumeDoE8nNkQw6MT/2wRcDdBQePfm5b+gxTGpP1ui0Hc2QX6LUblERnXiAsQIcHvgK+yQNQfAaQzYFfnaIbo7vOKAKaaMEgcOWEKTTiu6oAhwuBAJ4QDbfQGr9mAehHlx/5kjK84quvjL4GFDvkBEqWgSP5m4UMHlgG7Ig7Hra+d7pD74EJEb7NEzYMGR8svqIeSOJUIXcfwzLQ35Cg1n81zitjZRULuVMszUlifPQZb0TjyeA8ErvfnABuljcxO065gvK6Axo2ScoP+5r0GKEUyiZBaSfbBU/HDJf25vP1qZCt4hN3bZETJTB/ZDYfOv2Pw1c1YJ/J044nP2jNdcyshXJMBXeoSWvMeGFFfoB3/MAz3aGZq4yhrIjzycLULLmTvgX9sL+LMOQ6pSuD9D0So6v6KociJbdm/mU4V/9swwNfLqqtAkdDIAuBYDS2gqtksyicqIfI5hUbtuE+9sEA23v5mfceG6chcKeYby2dU9+c+SqaK/OWBMRK0L22eRoTwDFghiytNJ0Lhtsc/LXuWRRHSRp6JOFNC1uZbtPeSmm8VNSTWElnwUpNXCESokl7sZIq9YhGV97EMPJ91KOmkVwpyQoAe/JSZsDI++VfejUordkzfa23tBBE3AHt3dS6oA8EkXbylVSTlbIfwlFgvH9EaibxdVHv7hpGGncU1f8vwDWcQAGCgZ++H1wmVhx4EmiKfeGHUKTZ/fK37yOVSa2g/XukdHbFU1 taAp3vCJ uuWW9V4ctuYmjjoyjWNly/KpvTqyjooDuY2viMSUacxHAFbuq4FOXG81QejDYWOarRT7b9/JkzUo33CHNmnqAbDbqxeJmvOlcfR6jFryxU2ChLdQWxUMHt8FbyGAFYtuLhuXAMypGFcIEoW1CpW5fYvS6VnSU8AuNyzcQVVD0tskZ0H/95cYffpopCzabyAreH1FXoL6CScWbxxgYo73XntZkE5xWsOknwR5UrHd9GEaGam6zGD0UjappXmp6tRUy5r9T62N7VO+0hmKuV9992N7HxkGbDLODPpILVNOtyR7NVwssdrxT1KIVmWqlOUbyLCKBp7e9rRsGXgo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hello Alex, On Fri, 31 May 2024 15:23:18 +0300 Alex Rusuf wrote: > Currently kdamond uses only one context per kthread > and most of its time it sleeps, so utilizing several > contexts can scale kdamond and allow it to use > another set of operations. > > This patch-set implements support for multiple contexts > per kdamond. > [...] > > --- > Changes from v1 (https://lore.kernel.org/damon/20240515152457.603724-1-yorha.op@gmail.com/) > - Compatibility for DebugFS interface is kept > - Kunit tests build/execution issues are fixed > - Patches from v1 are sqaushed, so that consistency between patches is > kept My request was to avoid unnecessary temporal changes that will be removed in next patches. Some of those are well removed in this version, but I still show some. E.g., nr_contexts field. Also, this resulted in two big patches. I'd also appreciate if you can separate changes into smaller ones of logical single change. For example, changes for lru_sort.c, reclaim.c, and sysfs.c on first patch could be much smaller in my opinion. Traceevent change can also be separated from patch 2. Some of multi-context support seems mixed in patch 1. I'd suggest below patches flow. Patch 1: Introduce new struct and control functions for the struct. Don't really use the struct and the functions. Patch 2: Modify core.c to use the struct and implement multiple contexts support. Minimize changes to core.c users. Just keep those work as before. Don't implement multi contexts support on sysfs.c or trace events at this point. Patch 3: Update sysfs.c to support the multiple contexts. Patch 4: Update trace events to better support it. > - Added/Fixed comments about data structures/functions Also, you don't need to put version history under '---' marker if it is a cover letter. You can put it on the body. > > Alex Rusuf (2): > mm/damon/core: add 'struct kdamond' abstraction layer > mm/damon/core: implement multi-context support I will try to put more detailed comments on each patch. > > include/linux/damon.h | 80 ++++-- > include/trace/events/damon.h | 14 +- > mm/damon/core-test.h | 2 +- > mm/damon/core.c | 509 ++++++++++++++++++++++------------- > mm/damon/dbgfs-test.h | 4 +- > mm/damon/dbgfs.c | 342 ++++++++++++++--------- > mm/damon/lru_sort.c | 31 ++- > mm/damon/modules-common.c | 35 ++- > mm/damon/modules-common.h | 3 +- > mm/damon/reclaim.c | 30 ++- > mm/damon/sysfs.c | 303 +++++++++++++-------- > 11 files changed, 872 insertions(+), 481 deletions(-) > > -- > 2.42.0 Thanks, SJ