Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp509146lqj; Sun, 2 Jun 2024 08:31:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFJtt2KDBVg3e99j8Uv3NcLaoi84rxJug3MEszCQ/4GGzwDPnGQWLI9OTG3EXh2wKiW2Y1F+jgdIuyRLpeNtYSfrBVv1pUSE+w0QRToA== X-Google-Smtp-Source: AGHT+IFU3sWv0ZEBemo973lcPMNNyI187sBc6aO6OR1xQuQyiqgiXNC8gE79TOh9AAJKjC19u9qq X-Received: by 2002:a50:f695:0:b0:57a:2f7c:c779 with SMTP id 4fb4d7f45d1cf-57a3658628fmr5526222a12.37.1717342310474; Sun, 02 Jun 2024 08:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717342310; cv=pass; d=google.com; s=arc-20160816; b=LE5XM+3/Ud5Z55n43gULYtit7z2EoJMpzWSwevGtxVrv54IGmpZfqaSwVUxHPrjo7x Xa0H/3ryjEvBibIx4cTmSSy2Mxz03VwnNEttqrDcApaMK6oJg6Jeok/ai6hNu1tuXTbH 05EiDbXgl8VyFnfWIGjvLPqrgeFhMUKWdybr5RQk8V8r76fmzzkLKlEEq1iB6SxcWKSr ee6Oy7l/Vb0bVsPHPE2XUA9Xs4bMU1wh/2tVivnsSUoTnUjsVvwqoBUJlDZtlZpZ/1ND c3aZK5xbJwH+QTt4XLNO5NcuX2mcKw+8OuXCNk9oDlfzBzCbrpwp9twBw8BrgQUBCPjm a6Uw== 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=/ef+jPbCl/Q2MIEYpCmzzicRwWRwVQMPXcaN6w64uiM=; fh=AcXP2qjHtPLq+2m0Va2is2rSZKyvil7B7HaV4hV0Asc=; b=bS2vHFFXAz3XGK3TMsP+ua9/Xls3eUg1JxGBg3PAIQeeqpWsUVS3fGJNm2LOZXO/p+ 2wcvEa4iuKxO1n0tCZLDdCiyNwLKsMNc2+Qlgw5ZHXA265kuR44E/vGOHQtkX9/gjjDQ qYQ52vK7daR0MtPxi6uo6w10IB7xlDZIflm3FDFvifLpl8gSGLwPoQZ3R79SAmDIVJxf XTDcbaUwiDl9KVTa0771xgEm3X17meumyGZxjQ0OnJnBm/mAybQQWV/MTJUw2ApT8pPB D+Bh1dB7cxXd/VT+Cw8OpJdwTHHulonybaNqVa5Q5p94dRqzWgXJeTBpB9XtnwMeoZX/ /uig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mar+lBwc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31ba8971si3095353a12.182.2024.06.02.08.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 08:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mar+lBwc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0894E1F219C2 for ; Sun, 2 Jun 2024 15:31:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 053B047F6A; Sun, 2 Jun 2024 15:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mar+lBwc" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EF561EF01 for ; Sun, 2 Jun 2024 15:31:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717342305; cv=none; b=rS0oZOebAmkm5tDYAS/rgZ4HXWynH3EB0Q1yT+DQ3PzEviMdFZbQosO0dJHaA2YSQ5OAXyTrpcYpgZLf7Cn2j+Orh2uWOjwD9U/c7vD1yJNydTH7FsWXgKzKzFIYSuOLUAlgqnwrP32ZR995VojfGzjPC+Aod8vyb4CadDXTGA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717342305; c=relaxed/simple; bh=rNBnPWcv/UT24JI/E+LCM1Eixw1GOAQgxs2uWjTqgKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TRpECgdLIIVrSwd8VysyRiazJ8u8GxZornvfs7VSlxGDXKAmP4hsDntjX6s/Gs7xWGted9PV5qWl38JeR1B+wtFm1oqlNfTbO6Mx6bBwDiYKhH/H/DsFCBpMn+RoGuVbHo0yz6cnyLsjQoASetcE89tvdRohOCVL+q5ntxuwZco= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mar+lBwc; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52b976b5d22so452357e87.1 for ; Sun, 02 Jun 2024 08:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717342300; x=1717947100; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ef+jPbCl/Q2MIEYpCmzzicRwWRwVQMPXcaN6w64uiM=; b=mar+lBwc7SdpL6hPM64DMSqc1Usm8AQXICBGcwGJLppiboetZQyzK2zkBs1UevDqo5 uCn/2cA43nBkf9rw2Q29lmbumVGRgk4lU0Z9btP3+2y3rHn/SWjUK9Nl/EQ5kNL5aBxI zKeCEnEp69NVSCJP5GNAvXYsm7qzY6GfW2GFo0gQ6nseMEp/WhOuqVm+hNy54NQ02ab0 fBM4Bxojtgi75x/iOOJ1JEJERnxSl2utZqMZWxrribBnQ963diQJ+tWBFnAqZvLDurjP 3V18sF+4rKeqKlJguxtxqKVpsVTMBmu9nN2gA1bDxprrP492NQjudGDqGHlf9XtA6IOj eWRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717342300; x=1717947100; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ef+jPbCl/Q2MIEYpCmzzicRwWRwVQMPXcaN6w64uiM=; b=xCWQsTYMBiS6e44EOQjxcd3LkFGgoECEz19vPs2zioBlDFfpkapbQ3DLwW2QI7e//s 50pZN5aUSliOqFOae4tHy3lwTpXuUx10At792D6wRj5masELWPFswgRFEx2D5vAToNxM FjB/MJu1dHYk1B8jP+RQ+9RL5g6pb29Uaq8lnvjMLgk1kmZRrhK7/vmZiHI+j1aNrybv X0tkEOqAg93jq6+4tO6aHbCgvFmIr2Dg+vcA7L97YeVEYLzOdu2VvgpWRzeNmM+UIOt7 O47cCc2y3qAxYJtryIjBxWq0IL6sBLv9Cl0OT/Tmt82Qtpav+9h2qoe2NDgZ3GFgLG7A ksyQ== X-Forwarded-Encrypted: i=1; AJvYcCW1NLIMXhqgJoS0ey2Fry41yKWkxmhunefBVHlkkkWsgZ6s5MAbmfInH6ktQnH3QU67RNMEOWPK9rzfQLjgKJTy/bxhxKnLJHwmAjC4 X-Gm-Message-State: AOJu0YyyZ5erGN9iTnCFksUAQpwdr155xOzBlp2YpnPjOKafpmVtN3n7 70wJyxI6nUACXh0yfgd+y77JApPHELKurw8n9F1NJ8V3syUpNtqP X-Received: by 2002:ac2:544c:0:b0:52b:82d5:b36a with SMTP id 2adb3069b0e04-52b8957fe73mr4228460e87.2.1717342300040; Sun, 02 Jun 2024 08:31:40 -0700 (PDT) Received: from localhost.localdomain ([176.59.170.248]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d894c3sm969583e87.249.2024.06.02.08.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 08:31:39 -0700 (PDT) From: Alex Rusuf To: sj@kernel.org Cc: damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, yorha.op@gmail.com Subject: Re: [PATCH v2 0/2] DAMON multiple contexts support Date: Sun, 2 Jun 2024 18:31:02 +0300 Message-ID: <20240602153102.926789-1-yorha.op@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240531193307.71424-1-sj@kernel.org> References: <20240531193307.71424-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Hi SJ, > 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. This makes sense and I actually wanted that as well, so I tried to separate them in previous version, looks like I misunderstood your request. Anyway, don't you mind if lru_sort/traceevents/etc. will not function correctly without applying the whole patch-set? I mean if we use the approach below, once core.c is modified at least lru_sort and reclaim will not work correctly, they even will not be built. > > 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 BR, Alex