From patchwork Thu Oct 31 18:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13859449 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 F24F6E6B27C for ; Fri, 1 Nov 2024 13:55:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8DE656B00B7; Fri, 1 Nov 2024 09:55:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 867BD6B00B8; Fri, 1 Nov 2024 09:55:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 708466B00B9; Fri, 1 Nov 2024 09:55:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4DC176B00B7 for ; Fri, 1 Nov 2024 09:55:00 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id F2C46C05BD for ; Fri, 1 Nov 2024 13:54:59 +0000 (UTC) X-FDA: 82737671478.26.8DB0249 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id DE1241C0024 for ; Fri, 1 Nov 2024 13:54:45 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uaImNOts; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730469242; a=rsa-sha256; cv=none; b=McgwvVPQBmUu8sq56RflDW6/touPKojGX9jzVK8vKIwanJOR2QFxfeSOZ1eA4Sr6ebNir7 IG1v7i4qh9uYCjNS63fI6sLrt6xdKFK+OcFozlIIO5A0bt7xHwq3Hx31RBICLbl2LCogBA YXuKPbCOg5JB5AFmEck9gqPnO5Dsiog= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uaImNOts; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf18.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=1730469242; 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=Fi9d4ruGifNl0ftlrKj4Ja6WIKMklLlH5g4b5RPLc2M=; b=HKPVNoZkDTPxCLKahXB91KcxB5q+PNPnaBOZUqPY3BHhEXJDg0OMm+4UJ2R8340fjGZK9y 6Mefy68Rs+pefZeFH8UfoHIBKuaUsq7dJf/J9G9YZ0gkkh0s5qV312jielVkZcQkvNhKnX 1nISEePhz1YTJaPYjz59fcI5kc+1G+o= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CC8655C6A5B; Thu, 31 Oct 2024 18:37:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3709EC4CEC3; Thu, 31 Oct 2024 18:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730399882; bh=hzCrs3U1wpfuL1mByOLcpS5v+HB/qTe71dwMaFfYxG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uaImNOtsGoHYSbe1m2EJckQzyLxi20TlzKdFyg4I1+pz0azw903+1CWJfhtelXv0u rcmY6Tr9ux9gPygaxzdwk1bV7udBlBRiDKlIsfhKDBZhcfcA6I/SdSdIoICNuN8TX+ pzRDVujFnJgRi0HCN+TetdtHbetKZXEinbaPYwbUPVW/zNsnnQL0SdYaHn9RpShJZJ 5T/3UjPh+y4Kb/cah3MjgKf2HLyf/Sy44sv6B8pcM+LNa2ddsCwKskJmsLNAFEpz3l i5KU3LKJzrL+Ix/EfuTA3m7z819N72lK00vZ9X/hxI8SQSf+WtpLumzPg0HE+BkcFJ fcH+N5mWhcE5Q== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, stable@vger.kernel.org Subject: [PATCH 1/2] mm/damon/core: handle zero {aggregation,ops_update} intervals Date: Thu, 31 Oct 2024 11:37:56 -0700 Message-Id: <20241031183757.49610-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031183757.49610-1-sj@kernel.org> References: <20241031183757.49610-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: DE1241C0024 X-Rspamd-Server: rspam11 X-Stat-Signature: 4dsugjhad54w73ptoztx9sb7cishf1gn X-HE-Tag: 1730469285-468368 X-HE-Meta: U2FsdGVkX1/gCJup/atL5KOU5FNS/SwWo5nA/JTnOrFrbaqXFd5qsHh1KCdRKIBeuWoRbmXX5wxfqtJY6OfgziqwNu44gRw1RMWN8yX6LtIDCLKFtVGRbLj9dNFBqRBUud4yuCtXFduwpji7Ue9wjE6vKZ0tLi1Y8XqC5o7hTqrQx6X9gc8gndOoyhOy83fHFBk21SVxT/yHKQoPe2gYKRO+47SsncLPd7onrcDptptZl+G8lHXHRaeVrtSc9ZkrasfCDCMyRURrFPQ3wAJn+9mUxgtDNOhEChnXVfANNRHljbA2M72BvLiu2SZukNNdR/cjcFN+7FjguWB5OOu8kFeS45sNWb0SgEKXRULC7OQjsnb5WIC0owfpGOhNfz+W5gIKQthzaPNk2dWOQ8yeGJR8ZhXj+TJMPGe6NJodsgpmHMU8Qu1EQAb8Ehm4Fif8K4M5zWzybZSxEPuUB7+AEc6GYdgdYeIfyVUv+DwwZrAp2FH4QYkKTl+nR2IORBpjnQEmECQmiwNhQRlwrzXCVdJe4HwJmHxwmUk3PvJ5DZBIWai1sHFfG8rnwIoMHAWqKtrv/fBt1JTvYVkdoIism62AgjBUjjB6ENZHrN9DKIU7Dd6xDWTJjMjWmQWusfQ+8lBfgINtBOGgP9NThJ9RmMr4XQ+CzzbgaWS5jKtPKgpv0GFVjYkzmKGFpLKd+U0+cVfUYBzSo09Gk7y8xs+bYVCA2evfPuBAnLWAQ122EujggOaMf3wrxDkycu4sw8nTAJU+nTa+2h6wlyIbS2e1Q5WKlyS6p+tISRywspbauWfBgJyvoQgaRyDvfv9fkvRiT5R0MAJ3hyElrTy1ovLpDtx/3MjBBD3Z2n9Dq9L1pT7SDqtqVJ0WuAcswxQ7tbuTLq23A1PngacZAfV6QpbdIvfvVo7VrF6//2ziM8rrZWI+dMPlR3vIBasJNGxXVGa93OkfZto1n/nXLd4qTJ2 gP/nFvAz RQJlWhqjL0Ir+uHMTioUTUAmMQDi2qhtParN4PpzEERIiCXU/i4Rw6WoFhB4yg4s93lmza2+ayEAB2RhhKlRcr9HoMF0gHqo1DDgJt627LWN/VBsHqwIMGnkZC141uH0U7Yubvi8E1fXixjJDFXpRR/AAS8mMXa4Pib1PNtf9ZaMeLirSfetpbvapmNeJLcGnB8vyyyg/vzsA6vonhF+foQj1x7MW78GenqyaEAWobXelPIgvxPoqn2T/hJ4vWgdkvylts1cuyKFzq3Tn+480HGyUuA== 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: DAMON's logics to determine if this is the time to do aggregation and ops update assumes next_{aggregation,ops_update}_sis are always set larger than current passed_sample_intervals. And therefore it further assumes continuously incrementing passed_sample_intervals every sampling interval will make it reaches to the next_{aggregation,ops_update}_sis in future. The logic therefore make the action and update next_{aggregation,ops_updaste}_sis only if passed_sample_intervals is same to the counts, respectively. If Aggregation interval or Ops update interval are zero, however, next_aggregation_sis or next_ops_update_sis are set same to current passed_sample_intervals, respectively. And passed_sample_intervals is incremented before doing the next_{aggregation,ops_update}_sis check. Hence, passed_sample_intervals becomes larger than next_{aggregation,ops_update}_sis, and the logic says it is not the time to do the action and update next_{aggregation,ops_update}_sis forever, until an overflow happens. In other words, DAMON stops doing aggregations or ops updates effectively forever, and users cannot get monitoring results. Based on the documents and the common sense, a reasonable behavior for such inputs is doing an aggregation and an ops update for every sampling interval. Handle the case by removing the assumption. Note that this could incur particular real issue for DAMON sysfs interface users, in case of zero Aggregation interval. When user starts DAMON with zero Aggregation interval and asks online DAMON parameter tuning via DAMON sysfs interface, the request is handled by the aggregation callback. Until the callback finishes the work, the user who requested the online tuning just waits. Hence, the user will be stuck until the passed_sample_intervals overflows. Fixes: 4472edf63d66 ("mm/damon/core: use number of passed access sampling as a timer") Cc: # 6.7.x Signed-off-by: SeongJae Park --- mm/damon/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 27745dcf855f..931526fb2d2e 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2014,7 +2014,7 @@ static int kdamond_fn(void *data) if (ctx->ops.check_accesses) max_nr_accesses = ctx->ops.check_accesses(ctx); - if (ctx->passed_sample_intervals == next_aggregation_sis) { + if (ctx->passed_sample_intervals >= next_aggregation_sis) { kdamond_merge_regions(ctx, max_nr_accesses / 10, sz_limit); @@ -2032,7 +2032,7 @@ static int kdamond_fn(void *data) sample_interval = ctx->attrs.sample_interval ? ctx->attrs.sample_interval : 1; - if (ctx->passed_sample_intervals == next_aggregation_sis) { + if (ctx->passed_sample_intervals >= next_aggregation_sis) { ctx->next_aggregation_sis = next_aggregation_sis + ctx->attrs.aggr_interval / sample_interval; @@ -2042,7 +2042,7 @@ static int kdamond_fn(void *data) ctx->ops.reset_aggregated(ctx); } - if (ctx->passed_sample_intervals == next_ops_update_sis) { + if (ctx->passed_sample_intervals >= next_ops_update_sis) { ctx->next_ops_update_sis = next_ops_update_sis + ctx->attrs.ops_update_interval / sample_interval; From patchwork Thu Oct 31 18:37:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13858301 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 8CD68D767F8 for ; Thu, 31 Oct 2024 18:38:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A84E6B0085; Thu, 31 Oct 2024 14:38:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0597C6B0089; Thu, 31 Oct 2024 14:38:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E14A66B0088; Thu, 31 Oct 2024 14:38:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C65FB6B0083 for ; Thu, 31 Oct 2024 14:38:06 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6A938AD792 for ; Thu, 31 Oct 2024 18:38:06 +0000 (UTC) X-FDA: 82734756300.15.3E4B498 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf21.hostedemail.com (Postfix) with ESMTP id 7D6F91C0033 for ; Thu, 31 Oct 2024 18:37:12 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=g0P16FYT; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730399722; a=rsa-sha256; cv=none; b=iDcZwLaU2JCMsNZv9t7uvt6RjNuqFmSu40BhatBm1uakWbKA0lSLhoShvgdiDNWbb79uP5 ZKKCnwjCMe8clh3JNyWjrZerTRpthvBHZppTpDpmeKjzoJZyTC8VcCGP8UQNhBBoF+TwcP tiEHg/4WUlnn97Ji3G0YW0YgpLDJ+Ss= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=g0P16FYT; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 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=1730399722; 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=o1Dpn/mvPRVjv4UGkY6kVRG64Vt/aO8yDcimPkt8AXw=; b=jMz1q9EQD1PuxK6/2mq+pj5fAAxQePBCFu4Xztn13LZNmjZDnCGNbObR6TQl4UK5QRcCO+ 9y4teiVEjWQwZImIWh5URVfjCr2lJh79X+RkCimCk/AjFsldHlIGB1FfdPfyqUedH8o1tu fzKWfQomagkxhnYSoLNPl+70emlnINo= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 34C0CA442FA; Thu, 31 Oct 2024 18:36:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F704C4CED1; Thu, 31 Oct 2024 18:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730399883; bh=L0OOFAcas3acRh+BRifsG3N6Sbsa4Qrr4fl+oy8M5uA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0P16FYTS9DnqQ14GhTEt6IbNDNM+8nRMCJYKMr4VnOSTv+27cQyXSIbjCefOL9KZ mDyvoyTBeBxmslifg0hATNkapdR1tV6Z+zWEvC75ed4xObZEwlahgRv4dadBxmuclo z1oj7KAkBMuqJplhnZ9rvzT22HwZyV9LxGiF4nUT6DGZwq8qNQYjXVLj9HNH7u76iL 92Go4qFwtmoG9dJV02X4z8D6l0lMzPzjO5C8ptBvgUK0t60WBe85iP3UPEBImoHUuX PNwI1+0H2G3T6weBaN3q4A+1Ue7MsGmNTLSm5tKvoPkEDOV2nJFchrQkWsb5J3Ry17 +BLbh7BR8+bCA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, stable@vger.kernel.org Subject: [PATCH 2/2] mm/damon/core: handle zero schemes apply interval Date: Thu, 31 Oct 2024 11:37:57 -0700 Message-Id: <20241031183757.49610-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031183757.49610-1-sj@kernel.org> References: <20241031183757.49610-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: r4gt6gd1jehdnwrmggp41g4dp88zprig X-Rspamd-Queue-Id: 7D6F91C0033 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1730399832-696380 X-HE-Meta: U2FsdGVkX18sxgGquhTNOKKM/sO8UgKxyXJ6p8uUB/9gwL48rlWwV1lL897Ex1XgcqK7Y5gkpBFYqQQBPoOdWsRNeQ9tXvsdQ5KFPAoMuRNkUQwZA85umDIFfA24P59XFvMP3eOKvBgKjXc2PYAkB8XdAmruZmUHKOkw/TMmyac75oVOTBPamtkxNVg/t13YplAgLRtRVR8FfENe0EYUlKDJ7254Tfory5npF8jj88cVrnB9xUucJE2W3vjdHa7h3shGbWvep65DQglx58zTkApjG3DS/2/9xnIQPQou5NgfNe+UAzOZYarLQdPADymH2rJNCIbTJc0QgYI+GsTfMTHBsu3orGeyTzGV3E2/YL6rrOgVCGJDI0Sw6tZkCr1SYLiwOFd+DajzqEg/p22FL+Q1HrlYklEoZUQpeildsuy5Bk+vYxFLLHjCAhREJwZUn352aPZA6VeiBJfcS9LeZ7RVC8fHal+siXVdScSAg4dAo5VtbrCUXkTioYZFpNIkCRelkX84DI1PGZX8sLhTV5PoYtdVDKbTcWiKYjUpT2VqNkYJKunY62YapUFc8/4bixifTVCukHrm24si89+lM42C9ZHGGE+FSkh1RIrPWnKDUuVPzlKa3Qfvqqw6vwJykDpXDZUcntfNMqfUqFgiqWPPEFNaC8oTToBtGljjbNZ3gEQPnWz32V3nBjPtwbi11m5VUq1YE3ZCakKJOdpq9Deim+reY8G7w4ZO5WfLsQPJ8ZoAIO3j4Y9Kj4jw/jO4tSFBLa2tM6V6RQLVSAvBctb/qgPV+h4/1H3lKVSSmn9GNaL3K3tUNY/EsYMsaFbfUTfWNxXtSb24HLWs5zmoZZ5uCqme8nZ12I6/zMNPd9RCzN3HpVJnme6wL16+wlchLz1XfDC4xoBtLzkxwxL1RajE/gtdSnGbW9aJOObRNYfK7K6dtRhjgNoGeCGpF2+Dba2fBT2vTliDm8LigGx ho6DgMbl ORf0ZwR9XZHEcEUeWjeNIWgjT6/0iMUxOXruOj5ULefRHnfO/4ZTTAh2qnaGSMKATlqK5RmBFI3hDylzi/BPRTM4pU1bOQKAWJiZ5aFzrtGeQZEqlfxd3Ulih1LXgfR2ubvTAsnjO+YmymybxzfzJ7Kb4CO3U52loXeMoxOPTneOMuPsbpIUQ3164a495XYnd67CrwQctnvODdJaQLsCOWbC1vhSNexI4rLS5SA43sboOgEI= 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: DAMON's logics to determine if this is the time to apply damos schemes assumes next_apply_sis is always set larger than current passed_sample_intervals. And therefore assume continuously incrementing passed_sample_intervals will make it reaches to the next_apply_sis in future. The logic hence does apply the scheme and update next_apply_sis only if passed_sample_intervals is same to next_apply_sis. If Schemes apply interval is set as zero, however, next_apply_sis is set same to current passed_sample_intervals, respectively. And passed_sample_intervals is incremented before doing the next_apply_sis check. Hence, next_apply_sis becomes larger than next_apply_sis, and the logic says it is not the time to apply schemes and update next_apply_sis. In other words, DAMON stops applying schemes until passed_sample_intervals overflows. Based on the documents and the common sense, a reasonable behavior for such inputs would be applying the schemes for every sampling interval. Handle the case by removing the assumption. Fixes: 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") Cc: # 6.7.x Signed-off-by: SeongJae Park --- mm/damon/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 931526fb2d2e..511c3f61ab44 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1412,7 +1412,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c, damon_for_each_scheme(s, c) { struct damos_quota *quota = &s->quota; - if (c->passed_sample_intervals != s->next_apply_sis) + if (c->passed_sample_intervals < s->next_apply_sis) continue; if (!s->wmarks.activated) @@ -1636,7 +1636,7 @@ static void kdamond_apply_schemes(struct damon_ctx *c) bool has_schemes_to_apply = false; damon_for_each_scheme(s, c) { - if (c->passed_sample_intervals != s->next_apply_sis) + if (c->passed_sample_intervals < s->next_apply_sis) continue; if (!s->wmarks.activated) @@ -1656,9 +1656,9 @@ static void kdamond_apply_schemes(struct damon_ctx *c) } damon_for_each_scheme(s, c) { - if (c->passed_sample_intervals != s->next_apply_sis) + if (c->passed_sample_intervals < s->next_apply_sis) continue; - s->next_apply_sis += + s->next_apply_sis = c->passed_sample_intervals + (s->apply_interval_us ? s->apply_interval_us : c->attrs.aggr_interval) / sample_interval; }