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 B1523C77B71 for ; Fri, 21 Apr 2023 14:37:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 431C26B0074; Fri, 21 Apr 2023 10:37:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E1686B0075; Fri, 21 Apr 2023 10:37:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A9986B0078; Fri, 21 Apr 2023 10:37:01 -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 17AE76B0074 for ; Fri, 21 Apr 2023 10:37:01 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D7DF3C0723 for ; Fri, 21 Apr 2023 14:37:00 +0000 (UTC) X-FDA: 80705650200.27.AF75F00 Received: from outbound-smtp43.blacknight.com (outbound-smtp43.blacknight.com [46.22.139.229]) by imf22.hostedemail.com (Postfix) with ESMTP id 008E6C001F for ; Fri, 21 Apr 2023 14:36:57 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.229 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682087818; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Ns7pA+U/SnBFJYRCPooMD8u6IRKFxkIbvJ/JEXEikE=; b=iHxNOcukORr9cqQtoA1s303r6af9/MeT+28gGSrCNvTvCOqEn5HMc6n7xeNkfo7YyoFB0N vtqcbNhY9i+UlO285EZtp7iClN5/k4gLYUEFlRAQb/Kjgj+609487AgHYAhJ1BWtBmmEZ/ oynZhLO2pfbR7+eO+YPXjzAZQQ91Uug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682087818; a=rsa-sha256; cv=none; b=NHHhioWM/5EJQ+qXsp/l1UAXhGp+l4Entv2WRjD/US+2zpSlbjbNk+w1WggBh+OzlVHBqG CfwX+YoJNLpIQCqQ1SVktIocEm+bKYmF1Cvy5QlClM7AnZ9gEONViJZqAbIH9PZ4dv4fI5 gjXwV4prTNZpsCa3EOiDacbZ7bTj2QY= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.229 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp43.blacknight.com (Postfix) with ESMTPS id 7BDF91FEF for ; Fri, 21 Apr 2023 15:36:56 +0100 (IST) Received: (qmail 15405 invoked from network); 21 Apr 2023 14:36:56 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.21.103]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Apr 2023 14:36:56 -0000 Date: Fri, 21 Apr 2023 15:36:54 +0100 From: Mel Gorman To: Johannes Weiner Cc: linux-mm@kvack.org, Kaiyang Zhao , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 14/26] mm: compaction: simplify should_compact_retry() Message-ID: <20230421143654.g6ta3kd6ea7fsmp6@techsingularity.net> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-15-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230418191313.268131-15-hannes@cmpxchg.org> X-Rspam-User: X-Rspamd-Queue-Id: 008E6C001F X-Rspamd-Server: rspam09 X-Stat-Signature: urbw7tg5g4i3xgpxz1tde7o6usw7aa31 X-HE-Tag: 1682087817-242473 X-HE-Meta: U2FsdGVkX1/rUGz5GcopGFfXSa/j58U5TLOk+ojwRh9ScAvYQQL19yNGJ2IS0LQk5hxpgybAIQoyf69FgTpzi71zx/5qVBExr8kz50aTdM+MwjnFylBP/nG/uxuIkh30BB6JpLkIWYtPWbgH8sz4JB3/qvj5VGybbXPKD270DfbBRTz3oGH1DtouzO8riD451LdUAyo97Wg4txnOqylbhn6AF8qNZzVS2o5L5D0NPbKOx7Vmrsd5cmD/Ns6olDvmDVwC6iebCkyre9yKrKaLdFnpB8DI5PjNav6gZvRlI2/bSt8uIfUvZY9OG/9Fw5CLj16c11uCUoDTOM1l0l5W0GLo4ulL44VPwQ/k1Qn1uhVjY3plfi/Q/DjyvPYSAEXYgDcd46b/dQcbetHBjdPi0xr7MtP5ijxSiDXoiuwaViyCzMp6ZNGdChoJTnT/l8/Hv6vKIyemeS4R9srHlNycMfR7JkJP/67SK320N6xvM3+Fo0okTnR+V+v1qZ6TVRjSFbm/eGnO1r7yQzKN7nSlhdeX9YXbLNPUKFb6Q7a8Ut+SwLr+ILGjRqrScc7Q3Oy3srzH0dR4mRhTwqs9qvKDVMnOenMuYxsakINcrNFl7+AeXjN9Uadj2OHMpH42ivw4YPvVFSFcIWjMwLnZDVVUw7npacGi7DtGVVM/b2lgoIO7HLU/2XorVwFzxyjf/wJSuZ6xNPO0iHRljOWK7hZ69ZJ8EwPhJNQwoRsIgGDjS5kS0QiR8A224eLA2cvthQqSFMuPK0/lmmmYMDrrzYqmQaLAQR9kBoc27cMazjBffuD8LTPE8zpCAOw9vm9R0ZZ6VyUPQF9vTdyt5uEHpbMzk82gGUr1JvlSKkJ56kRMfEcc/zV2PE8M13A6sGLB0ZNAQOhbAmWcEMNGMmLMSgOOe845f7rld13+8gs4a3AkeXxvEXbPzvKJDPRR/flBNj9c+pf5fLUHbYrlxB6w2Ad fBH+vCJz iYrJBwLphKUEIZBhmr9CYu1PVkdW+zCmr588m7oAu1md7gDUl5Qle6Pmnx84TKcgbCR12Dvs14/fhIut7ZJ6OO/vGlkkd1wBhxYPt1QI4AHyIQaRFJKSz+0Cy8/JerdkMMKx3gsT8uGIts60kKLxjoJDO2zTd+C5d3LHRZ5dwVhkFmVDSkk8Ml2jXGzEdOLKEYm7PkZaQOyBSm5Sh1ik6HVkbsxcGuulTBoqhDti8J17KEyJ4qRrbqP2XUFKQ54kah2HYBfhl+WKRUmCkLLbmWbCqfg== 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: On Tue, Apr 18, 2023 at 03:13:01PM -0400, Johannes Weiner wrote: > The different branches for retry are unnecessarily complicated. There > is really only three outcomes: progress, skipped, failed. Also, the > retry counter only applies to loops that made progress, move it there. > > Signed-off-by: Johannes Weiner > --- > mm/page_alloc.c | 60 +++++++++++++++++-------------------------------- > 1 file changed, 20 insertions(+), 40 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index c3b7dc479936..18fa2bbba44b 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4608,7 +4608,6 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags, > enum compact_priority *compact_priority, > int *compaction_retries) > { > - int max_retries = MAX_COMPACT_RETRIES; > int min_priority; > bool ret = false; > int retries = *compaction_retries; Think this breaks build because of trace_compact_retry and max_retries is declared in a different scope on the next hunk. Again, move this to a preparation series. I didn't actually think about this patch at all because I'm trying to reach the main purpose of the series and it's now late on a Friday so I'll probably fail or forget by Monday. -- Mel Gorman SUSE Labs