Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2340534rwr; Fri, 21 Apr 2023 07:38:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Z7Udi7A/2W9gzewomvETR+lDQ3+plobadnLepc49fgEXVWhDNzs+zaZ1iE1txbrIeVbeeF X-Received: by 2002:a05:6a00:1d8f:b0:63b:4978:a50a with SMTP id z15-20020a056a001d8f00b0063b4978a50amr5860025pfw.1.1682087939167; Fri, 21 Apr 2023 07:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682087939; cv=none; d=google.com; s=arc-20160816; b=mUy0nvMRfk2cLpWfqM6qkoZDqth2b9OpqVZuljEtyElxHbEvBbRj1rehoHSplwwoPC Dvh7qc5g/HTmabajs7OkXy6zM8tZdbIX9VxTlisRLLjzPoOTbm6UzlQSWyQuUZCjFW1D H3tV9sbum1ojnG8nB0YYfP5gGq7jRwxxsJgGdOY3SdeVWYxVBdXUFfl+D381Hwq/uro2 fN1JnXvhjuthAvAesPe58OSkbqnKHYAViMFvZd2ZXgQCde1xHJ+DFQb9tmjvl6O+sDLh HtcHjg8OOz5KMU/pyiA4ewNXb3uiklNL3bA5LLnmoP2a09Zh+GUq6sCA2h3zdxVFWJ8f Zxdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/Ns7pA+U/SnBFJYRCPooMD8u6IRKFxkIbvJ/JEXEikE=; b=NE4eedQjznt35coVPNrEqAmrzKysBvDydWe4UZF/1n0bSj1Nr7OihGjv/5fN9u0jGV Ly6ib2zx01ZiDB9rVqC4je6VWht0WoubgZpvNpW6ODwLXwvXlJZ7KRLi3UXPAojgCsWU DG8Iu1NGUTTs1FTFw3fw2S0ClsS/mj+fcHiTLm4EBwMU1C7lOd5CZRqZMGVhJ4ZSsbe7 y62hwzOeraUt/x7T7AaVEH1nY/ovddhVCSGPU+lN6toJ5IaOfW/yFBLkApP9AtHoKczB 2W80TUxpJH+L/53pQzSf0ujyU6ljcLyksoMxswGaGC1vLQMl8ptLhb2IQquhf/8dz4TC JJHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h190-20020a6383c7000000b00524dc4d222esi1300898pge.371.2023.04.21.07.38.44; Fri, 21 Apr 2023 07:38:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbjDUOhL (ORCPT + 99 others); Fri, 21 Apr 2023 10:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232192AbjDUOhH (ORCPT ); Fri, 21 Apr 2023 10:37:07 -0400 Received: from outbound-smtp07.blacknight.com (outbound-smtp07.blacknight.com [46.22.139.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF5A213FA6 for ; Fri, 21 Apr 2023 07:36:57 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id 7A3DC1C3F8E 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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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