Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp668417lqh; Fri, 31 May 2024 12:33:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmfuBQBTIvqNPwH28fvW2wBx1aDQW+dCqvrzaI9YPr58laAL1/42DGCHdh7NhCl9fKiDw4eg4ng9Ue7ADMJYAjtBfzckMgyS5z6lK4kw== X-Google-Smtp-Source: AGHT+IF3+XPFEkEnW+FvNAE5fJul+WXlzkgxDNlOaV+knvcjZhz7KYxlUK7xa1w4sLuZQpdYHixv X-Received: by 2002:a05:6a00:997:b0:6ed:60a4:6d9c with SMTP id d2e1a72fcca58-702477b6b70mr3323332b3a.4.1717184010718; Fri, 31 May 2024 12:33:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717184010; cv=pass; d=google.com; s=arc-20160816; b=r/XoT0bH7BrMLeU4KYDZPg/ic6Zq1O8a0WvW6cQhDhMqMy/7Fw+ufiwWuN1dCYz2oi e9RBdW0MlsMJyEk3bHDsDBJhslwIhEBVon/O+P9k0zZVlFCUQXDD4sMZ0AU09pIRqEE+ //TJ8qBxUzuTB8yQQt4WKjHvdMoOsTkUMDxeyo/Iqd+83jo8fWHlvTFNtd2Dnb0lZohH yl4Vkd8+I/sGMnGcU8QbnFBFi/0Hg70sbfHyDiLBTsPKIR+o8Vq9+TxABt0VdhOfTUTg 7or3Z6UH505e49zpoWUaVD2kZ8Axe/Boitd49SJaJeIcZsDOUy1ZIYBvDDYAXJaIHe+h +Mzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FaiEHOImf343NUNZNcNgf67s9OGHIk+37/5zMQaB4C0=; fh=Ue2Q7th838/FwAx2uw84260FqeNpzjUwabhm1Amh2/4=; b=f82HX1569PuY5ftbwSYHwoN/JVu7ursafN1+nu9lIRAYmKlb0etkt15MFsYYzc7OrH 82i/2g0E20BfyrIkGSjj1oGLF9FUkr4cLQPjs+utcOppZUqcb+MRTmmEHqpvS2tZISkA Py+muoy7B0gJmdOt2W47r1NJ1AIEgIQQYOwWx4feoNw7st0E0gCfVa4lND40RlSh5x76 cLNL9/udbReS5toeSLDfklWA0/GZgUxKhuH7pGHgQ7X0ThGiTaFKB28nOtka0PNZ9O8K 60GeDbQwcreVeEmzz6Fd906uW41qQ+hx/cjxLrXVF3vdXahoHtO9RN7YuZouwcVXBzHF CcKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tQA+EhYP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35515738asi2031768a12.232.2024.05.31.12.33.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:33:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tQA+EhYP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DDF1928A1CA for ; Fri, 31 May 2024 19:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E96817C223; Fri, 31 May 2024 19:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tQA+EhYP" 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 5780512E68; Fri, 31 May 2024 19:33:12 +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=1717183992; cv=none; b=d9eOJRYOCUTUmlSoPsfbMcMDFKbtzaasGzScJN09NxJNPqFRTmew2qGYnLLItgVNdAUbO97YjWn92g/b56snZe3/4vQvuCxyXLoGuXXrndy5WWfbGxPy3EZE5AsccpzVwzWbVYYa0JxNS9TI0qA3B1OhVxVTOPJL4/we9ImxH3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717183992; c=relaxed/simple; bh=UCC6c01j73UTS8arQTdjtkYbzlZYjs10+rymqoQJDvU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c+Pd97qG2rS4LYbQ8gpxecd44E3f80zEid5PU20+srzWbJRaSa09KOXljzzyaWybeOLvEQkFPla2bzumgoYbAzDvdxzsdx3erUr8KIjF2dHbvxSCpZ5wq0e1cxZ69yTxBmhOOVrbRdpnQ2vsvV0pymzKkh7ASmcrZERJ+say/tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tQA+EhYP; arc=none smtp.client-ip=10.30.226.201 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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