Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp591025pxb; Wed, 27 Jan 2021 16:04:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhP7UFoqiBG/zCV1WdwTfzU95FgBTA0hOhgxwKx+u68CPrAUOwmOX14L7O/SKm14gFxBiC X-Received: by 2002:a17:906:c453:: with SMTP id ck19mr8777600ejb.440.1611792266428; Wed, 27 Jan 2021 16:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792266; cv=none; d=google.com; s=arc-20160816; b=GiuuPeNsTd4OHLI8edKFSaScbQr/eOGQsi/f2F/0lMkB0OYN6Czbh2Fawdy8HL+dws YdTWmUEblIUuCoSDbBVIs79QAkiRT78daQUmMxtc+CCkn9cMIYREOPmUty5fZSR7/UY0 XG7pxbehKEKe/+mECiubjqi3wAYuj/OaJBayke35knSPEx3P2oDeGkQoF3UkewVHRyMn wxYFA/xTDktd0IvgT9971rKHHe1cdX3xtrSaxuGbM8ItxPIR/1c/aYyrxH3ZYSiofHOn uzS74l6FMbcH8vOUAyy0SDU7/qSnifmrqkAqq1/dnePuA8ZsT3lYL+G9mIGJYwY+bP27 OVRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=KK5LTyLrZxs4hbfirnv0cqVe1btPvHM4AcbOjvUNy6k=; b=thy+7tS9lYNw7o/4cKveHVHWny9f+u0RDAqRS8q5ob6zBztok2TR6nzzO3z5gFVwoY r9H450/HAemG0HndJs6ogesSi6Ow2ZX6a4SKUuDBHPpLzHWleCVvS0IVW+pGkilp43Pc Ztz1ABvXUmGWLtXvPiH3/FyJr0O1u+ZfTEWqAjbvjJ1uhpFrG/qNFM8+UXTjYvfuNOpO o46qtpgQqWH+rQryqN0e/Ck/3gIn+bf00PJ/IVCEA3GIM8AJuqbYcLx3e70/SZyKEnyU TUbpBGw61gNiMXZ8Ha+bDMswQDiO6Z3Z0YAxyI4rsySkwox8ErQMjq9zKAhgBENIM/lf B1Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="aOz/NoO2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si1780992eds.217.2021.01.27.16.04.02; Wed, 27 Jan 2021 16:04:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="aOz/NoO2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236322AbhA0Pww (ORCPT + 99 others); Wed, 27 Jan 2021 10:52:52 -0500 Received: from m42-8.mailgun.net ([69.72.42.8]:60810 "EHLO m42-8.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233939AbhA0PtE (ORCPT ); Wed, 27 Jan 2021 10:49:04 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611762521; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=KK5LTyLrZxs4hbfirnv0cqVe1btPvHM4AcbOjvUNy6k=; b=aOz/NoO23x11YpN9ymCo8daHZDc2Jy2vUEzSNCWULSSLriudVbfWyydj2e+C4yz6gbaa/zid b7F+Eqs5Iu5FhNSYSs3tmSbom2J50UFbjF4aUt9IFycVgnu33n6E8iXUCzlacjbKMPMj7VHl XkYqgDsggVX3RgbQbZiSeIlJqlA= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 60118b35a2f5d01cec56d505 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 27 Jan 2021 15:48:05 GMT Sender: charante=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A3048C43468; Wed, 27 Jan 2021 15:48:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.29.110] (unknown [49.37.144.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charante) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1B2F4C43462; Wed, 27 Jan 2021 15:48:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1B2F4C43462 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=charante@codeaurora.org Subject: Re: [PATCH V3] mm/compaction: correct deferral logic for proactive compaction To: David Rientjes , Vlastimil Babka Cc: akpm@linux-foundation.org, mhocko@suse.com, khalid.aziz@oracle.com, ngupta@nitingupta.dev, vinmenon@codeaurora.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1610989938-31374-1-git-send-email-charante@codeaurora.org> <80a1a433-c520-4c73-61ce-55cf33739fc5@suse.cz> <627a82ec-94ef-a233-4637-28bc82a886e9@google.com> From: Charan Teja Kalla Message-ID: <7ce8f4f1-0d83-bb85-e516-33071d85ad3a@codeaurora.org> Date: Wed, 27 Jan 2021 21:17:58 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <627a82ec-94ef-a233-4637-28bc82a886e9@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/2021 4:24 AM, David Rientjes wrote: > On Wed, 20 Jan 2021, Vlastimil Babka wrote: > >> On 1/19/21 8:26 PM, David Rientjes wrote: >>> On Mon, 18 Jan 2021, Charan Teja Reddy wrote: >>> >>>> should_proactive_compact_node() returns true when sum of the >>>> weighted fragmentation score of all the zones in the node is greater >>>> than the wmark_high of compaction, which then triggers the proactive >>>> compaction that operates on the individual zones of the node. But >>>> proactive compaction runs on the zone only when its weighted >>>> fragmentation score is greater than wmark_low(=wmark_high - 10). >>>> >>>> This means that the sum of the weighted fragmentation scores of all the >>>> zones can exceed the wmark_high but individual weighted fragmentation >>>> zone scores can still be less than wmark_low which makes the unnecessary >>>> trigger of the proactive compaction only to return doing nothing. >>>> >>>> Issue with the return of proactive compaction with out even trying is >>>> its deferral. It is simply deferred for 1 << COMPACT_MAX_DEFER_SHIFT if >>>> the scores across the proactive compaction is same, thinking that >>>> compaction didn't make any progress but in reality it didn't even try. >>> >>> Isn't this an issue in deferred compaction as well? It seems like >>> deferred compaction should check that work was actually performed before >>> deferring subsequent calls to compaction. >> >> Direct compaction does, proactive not. >> >>> In other words, I don't believe deferred compaction is intended to avoid >>> checks to determine if compaction is worth it; it should only defer >>> *additional* work that was not productive. >> >> Yeah, that should be more optimal. >> > > Charan, is this something you'd like to follow up on, or should I take a > look instead? > Sure David. Happy to follow up on this. Thanks! > Thanks! > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project