From patchwork Mon Jan 13 21:01:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Hahn X-Patchwork-Id: 13938051 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 6D059C02180 for ; Mon, 13 Jan 2025 21:02:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEF5C6B0095; Mon, 13 Jan 2025 16:02:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E9FBD6B0098; Mon, 13 Jan 2025 16:02:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D676D6B0099; Mon, 13 Jan 2025 16:02:05 -0500 (EST) 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 B27B96B0095 for ; Mon, 13 Jan 2025 16:02:05 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4751FAE9E6 for ; Mon, 13 Jan 2025 21:02:05 +0000 (UTC) X-FDA: 83003651010.21.A2D28C1 Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by imf25.hostedemail.com (Postfix) with ESMTP id 8258CA0009 for ; Mon, 13 Jan 2025 21:02:03 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=medjebdp; spf=pass (imf25.hostedemail.com: domain of joshua.hahnjy@gmail.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=joshua.hahnjy@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736802123; 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:references:dkim-signature; bh=CsPltl3rf+aszSkn/zoUX72WoPGcRbYKILIx7PZGqT0=; b=QW6smJoHnRQxvMgVCDdTaZ51r+Ax97saOvkDzgSFGYtgmv/v675lyfI6uyuPd0HnpopSIb +o6+X6FsTPsfznbi+tjIsniiVwObyk1F8S8c3w+tOdIph1Nn3z/m+aRre49QeUaDxlQ+Er 0emVHu++ANdvZDp7I0HLTfxrvN6mOr0= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=medjebdp; spf=pass (imf25.hostedemail.com: domain of joshua.hahnjy@gmail.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=joshua.hahnjy@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736802123; a=rsa-sha256; cv=none; b=YNb2PM2qdbQiOaEnkyYIA4AGRp4PGOI5d5PiHubajrv0qFi1NqXMHhYfe1iAJhx8mTmzKg UdZuR+i9tMCoWfgznDO6mi2/n3Q7PD/fantmMsSKy3jf2TVPVfX9gWyL4qnxs5HWoVpt4s Dsa/4FrAIHbFcNORBpnhb0WfiuM7Kzw= Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-e479e529ebcso7020620276.3 for ; Mon, 13 Jan 2025 13:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736802122; x=1737406922; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CsPltl3rf+aszSkn/zoUX72WoPGcRbYKILIx7PZGqT0=; b=medjebdplvhBRzVIR5gGj81G5C1xZDoVmnQL0ZtRll/aowTzdXk88ztqtcCr8oEqv9 LWbKyltGxn7IR10T1MxqJXFZGTcLFQI/B9XiLky02Rl9u3HXVcuHjx5wi6Sjlq2j6F8M 4TzzEvGyAqsEvuxfavaY+NPRstpt9UTfKUEBlxpK9I2QiSEgsHHJ2/4psIvtmv1++6vF EOwd9iCbPl6Zs4PSQbr9P+gSu/IJisrCEkzO4ZPrsDbKGVZa1N22jfOta0dJz7/9GBdg 0vUHbQiwpq3lzhIT6c6SEJDu4lwjxE9Ju4/NQTvA4KOB6DEPIJNz7HjQx+KoN7QNz1GU LR4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736802122; x=1737406922; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CsPltl3rf+aszSkn/zoUX72WoPGcRbYKILIx7PZGqT0=; b=SVrq0L+oZtKOc3jQWkGMOed6+OGgaGYa7ZaQSNZCF9382zBmLit+/LQHV699E6lv6n pae7vxTJ0uOzHRNnChQJ5p1yxJsQUj3j8tCtDzjeH9NJr+QSPiZEULQNEZEcMnj/gEWN A9FNkRMDERyJ6hg2Z2RjpUbmbX4oCKNb4qTVoROnvkhOPal2kh6IDG36FnUKSp2xyDHS CWacosxN/w0BDREQYTJr05apwi0JntLpdE2ikVYZZ5lDfg+/6byF6KSRUU4UzY8fscBG BZr3VMrVDG49Ii+FewjCZf8VdHZ4rDasrQlF1kV0/DIUEpSYxL+8XqK86kA7H0fe3HAI nWWA== X-Forwarded-Encrypted: i=1; AJvYcCWJnWVwtx8FAY8OS2U05piJ1vzh0LJT+12cZ4ao3Jn8nA1R+UiDTZ1qMnj9qi24nRbrU5xViUdqWQ==@kvack.org X-Gm-Message-State: AOJu0YxuaVG1Ca5VCDoOQ903k0yxmTT+c6kuavpLJFc85LCvfiCS00d/ d/0cR8a0jr/PCCKmaVngSO0vclQB4SLk/rTQ37hHxg7fQfF8SbmL X-Gm-Gg: ASbGncuXylciUQJMF5yS1U7ogWe+vwq8pkd3j0ACGQHpNFaurBIV8H8kJjiSBPUpBmT zB4kk5txYEv41AXUcr5FVxDfQnaU3jOpBnDmc4l2avFpDsMFQr/DIIeTm0+/j6sppTcC7TlXOFx 6OlGXrzw1LXYJwXCNAcF1mTD9evA0OH64wbnqu60QQhqn2VThG6ZZt2VnooOLDCKnLClB3O8FC6 GGLJ7v/2o9puCxw+HdJa/b4ppnODCYyxqttt/AMWIEhFKZ7YXvr9DY= X-Google-Smtp-Source: AGHT+IHOKnrP82pMHAmLLLzeNGP7pn9YOeeAXy8YQYQKgmKSgDo3F2kKkmQdnSrnETBO2gkxIwwfJQ== X-Received: by 2002:a05:690c:680d:b0:6ef:61b9:dfca with SMTP id 00721157ae682-6f53125c889mr189473677b3.20.1736802122470; Mon, 13 Jan 2025 13:02:02 -0800 (PST) Received: from localhost ([2a03:2880:25ff:9::]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f67c99c9d7sm10281607b3.47.2025.01.13.13.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 13:02:02 -0800 (PST) From: Joshua Hahn To: SeongJae Park Cc: Andrew Morton , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com Subject: [PATCH] mm/damon/paddr: Improve readability of damon_pa_stat Date: Mon, 13 Jan 2025 13:01:56 -0800 Message-ID: <20250113210201.446051-1-joshua.hahnjy@gmail.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 X-Rspamd-Queue-Id: 8258CA0009 X-Stat-Signature: ywg799y85a5477o5ziaufb9tqtdyytsz X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736802123-756010 X-HE-Meta: U2FsdGVkX1/GMBlmsfQepa+1RvFoQTjz1hAj67ifRZyObmeZP2skmXH7sHXWFgmKI3LmdKcyC6x7awsSCmOUjjzm5/BBf8yLB1x1+IHORJ2T7lfwaddReWSgDQ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84W7wxoU49SYfYWIG4y4wzv+ieIofqQzB/aEbvSSEEdvWXX9w5IX6iS2ZrLCc0u+cDrY1TMmO/CkNvJ7IoacMprZ7IvtUiSWqOCZWVyne+vnUewa+r01R/GPNKwZp5wQtqDb39sz1FOXKcCr69T1NXsH+DtSrBYynqfi9D/x2kreo40hkl1pDGeR9SyjP826iq3E4seWwIfzZx5dzmvaY17wGTtNsjJA4TzI/3XulHAjva X-Bogosity: Ham, tests=bogofilter, spamicity=0.009312, 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_pa_stat contains an unnecessary goto statement, and the if/else can be re-written to be more readable. This patch is written on top of SJ's patch series [1], which in turn is written on top of another one of his series [2]. Signed-off-by: Joshua Hahn [1] https://lore.kernel.org/all/20241219040327.61902-1-sj@kernel.org/ [2] https://lore.kernel.org/all/20241213215306.54778-1-sj@kernel.org/ Reviewed-by: SeongJae Park --- mm/damon/paddr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) base-commit: 2c0573ae5b4c9c0f9d81fa0138ed0014e1baf41b diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index b0c283808ba6..8cdf8320f9a5 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -509,11 +509,8 @@ static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s, if (!folio) continue; - if (damos_pa_filter_out(s, folio)) - goto put_folio; - else + if (!damos_pa_filter_out(s, folio)) *sz_filter_passed += folio_size(folio); -put_folio: folio_put(folio); } return 0;