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 X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B83AC433E6 for ; Wed, 27 Jan 2021 15:48:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9084A207C4 for ; Wed, 27 Jan 2021 15:48:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9084A207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 769036B006C; Wed, 27 Jan 2021 10:48:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F2DE6B006E; Wed, 27 Jan 2021 10:48:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E1AA6B0070; Wed, 27 Jan 2021 10:48:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 3E8596B006C for ; Wed, 27 Jan 2021 10:48:55 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0125D180AD81D for ; Wed, 27 Jan 2021 15:48:55 +0000 (UTC) X-FDA: 77751988230.26.tiger14_0602a4c27598 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id C773D1804B669 for ; Wed, 27 Jan 2021 15:48:12 +0000 (UTC) X-HE-Tag: tiger14_0602a4c27598 X-Filterd-Recvd-Size: 5161 Received: from m42-8.mailgun.net (m42-8.mailgun.net [69.72.42.8]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 15:48:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611762492; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=KK5LTyLrZxs4hbfirnv0cqVe1btPvHM4AcbOjvUNy6k=; b=IHy+ge/H4KwecUXJxoZIlkYnjxZ5yJOMpDGfhyvVP7a8KVyLaG1ROQMaE30Zyv8pm/gNpvVe 0LHJYi2X8KMeKSpVWMzkGHsFqg7GUPhWO6oIERsD+DyaramiktedBxiwX2KXqgW3flSbyiBP HmUou5sDGCBQeYuWnI5w1qUeezI= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-east-1.postgun.com with SMTP id 60118b35fb02735e8cf4c412 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 27 Jan 2021 15:48:05 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3DC99C433C6; Wed, 27 Jan 2021 15:48:04 +0000 (UTC) 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 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 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