Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6382773rwr; Mon, 24 Apr 2023 19:38:26 -0700 (PDT) X-Google-Smtp-Source: AKy350abD/azxrIJds6TLbr5DfnoBQ/aHNFZ0UA4FEN0HQc2GmEKCWLPivFdKLklFUbNKO6F5Yzz X-Received: by 2002:a05:6a21:6d98:b0:ec:60b9:c724 with SMTP id wl24-20020a056a216d9800b000ec60b9c724mr20625646pzb.33.1682390305910; Mon, 24 Apr 2023 19:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682390305; cv=none; d=google.com; s=arc-20160816; b=JLqezvbv4z9JEQRvPzUZ/T7wyGd4PKsGc4ajmuCkjK7Ue9cBqaROgLmGqc+hIgLQmP 9AT2JUMIYSq3p4qRI2QK90sTLfd/6DMXqp/gDZeogNcFSE0c0JNX9jCxzy9qEHlchKFc tZn0JVcvYqCLUV8USTicyNSPOpcyYXrDd5RXULNpjHdeOhBqUoU8oyi0nGki59bNPG9Q h5W9qfKkdjrBNUjAzZokCItXRIe1niZi7Fv7jRRm0U43/eSei/jK2rZ+adgU60CdgxAN OEQ1uPwMdUQ0sQTT353ck6hKzvio5z4DaP2QQ0LM88esq7xTCpCH61GzjudQ+5M+uA4e z0Xw== 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:dkim-signature; bh=3CUi8Pu2aq3PZJRR6Wmf7E6lNE8E6L2aFBDpceT4KFs=; b=p3Gn02jXUJSftJsoAMsSvINlpWussnZMDVjeDVAJGjXkYpNH7HXdAfFbS85E84LLW+ An/cFYitKAiEF0dBdMYW1zcI1J34oEI3NlxYbQM9jAKbPv3jIen5SQnnqlipGzQ2pVmU rQ7nEZPtGdEeT3Hv117ZeKtEUX+9YI/JTQ5LZbqtrycoZzlFnHitnFW8Kq2SXusLvfow wMQMDvkvkMW8UdaK7iAEU04Rrzm5oAWRKCHEKt4v9Mgmnoi4CM7/Jd7sjGvVxTwysotL gecnvm1DEGxymmapmqnL2+uVvjHd09yTUExC28mIo3b66wz+CZUb7EMj0y8b2QGjirtF JR5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=m2OuU8z6; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a6566da000000b005186bbfb286si12486489pgw.308.2023.04.24.19.38.12; Mon, 24 Apr 2023 19:38:25 -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; dkim=pass header.i=@cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=m2OuU8z6; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbjDYCQD (ORCPT + 99 others); Mon, 24 Apr 2023 22:16:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbjDYCQB (ORCPT ); Mon, 24 Apr 2023 22:16:01 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69121A249 for ; Mon, 24 Apr 2023 19:16:00 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-3ef3887e3c0so22273751cf.0 for ; Mon, 24 Apr 2023 19:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20221208.gappssmtp.com; s=20221208; t=1682388959; x=1684980959; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3CUi8Pu2aq3PZJRR6Wmf7E6lNE8E6L2aFBDpceT4KFs=; b=m2OuU8z6lXuImyl6itdLMAK9t4leD5YS4aq2+/YRI09MklwI98oBG9WDJoN/meMbNB eXdMPeb70Hyf0Kus4sor21h3pwJdOI4uU/xQbuydlx4t4C9pCoOidXyfSrODYtWhSz4x I3ZyMIZQezTs4wqX8+fHlJKKAMmciZ4FOW7A3GCT5e+N7pML/L56xxy/Qc6oM76Wh7zQ POYWwVViWSYTJig7BlcY8Gtji4T3hG3BeIPajyITtxA2ZKt0Neg+3cGXqlXGHnleM7gG USp3aD4UYLhUYIXvCX/cD+ys/zRWcsqM+r0HzK1Gkgb65TOzlcgKqSjWLoe/Lk5Gm8kM 27og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682388959; x=1684980959; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3CUi8Pu2aq3PZJRR6Wmf7E6lNE8E6L2aFBDpceT4KFs=; b=FDF0jddRVrzuws4/xUsEQQw5QNWzoAG0u94Aakz+JdUgI5DBI55XJ/5IcZhE81JByG vqA+rqZl8ji08xGJ1xYST1vPZ5Pep8fKxjkm3fXkxdQEjaILmKKv5ofeeox4wQqKwlNH 6P2fjakHPK9SGgifGBWceZDaA1gz27h+SHSHri2Kz3yImFBgq7TX37A9cigd6Z4tF/Pa /V63R1pV5kOpVzoM+KtBsf6eZkSp5HZr2Nf/4fau09XXqTxOdyhDHvZX/9mMBAi8pviY 7XeEvL7RpDZQniJS1eVNvsykpyuU2Zs0OL9/6K4ac2TCsglsQPOLMdEzhs6JztANxM+1 /XQA== X-Gm-Message-State: AAQBX9dbAvVhGM3HCnagrBB4mpUZjQ/bmp/+M8L/+w+XiHLHw2WZ2evx BY9VlMGqA22/U4q7mNlqUH7RdQ== X-Received: by 2002:ac8:5c46:0:b0:3ef:58f5:9ff7 with SMTP id j6-20020ac85c46000000b003ef58f59ff7mr25700800qtj.53.1682388959560; Mon, 24 Apr 2023 19:15:59 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:9fc5]) by smtp.gmail.com with ESMTPSA id v17-20020a05620a091100b0074e003c55f0sm3993712qkv.102.2023.04.24.19.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 19:15:59 -0700 (PDT) Date: Mon, 24 Apr 2023 22:15:58 -0400 From: Johannes Weiner To: Mel Gorman 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: <20230425021558.GB5666@cmpxchg.org> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-15-hannes@cmpxchg.org> <20230421143654.g6ta3kd6ea7fsmp6@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421143654.g6ta3kd6ea7fsmp6@techsingularity.net> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Fri, Apr 21, 2023 at 03:36:54PM +0100, Mel Gorman wrote: > 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. Right you are. Will fix. Thanks!