Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp622006pxb; Tue, 2 Feb 2021 13:29:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJygvoKqefJ9WM9MNJXOqFKUSrd0eTW6ooIZPgFAYXKce5IvDdqhKZkIdZ/4q/9n05KDjnKs X-Received: by 2002:a17:906:8053:: with SMTP id x19mr14149950ejw.470.1612301363967; Tue, 02 Feb 2021 13:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612301363; cv=none; d=google.com; s=arc-20160816; b=p7SUNWr2QpOMakNj0Sme1MsHfaStknHJ4oRvYMNQs3t2ArUmPrvkL7NILq50nciw5V Dkel1lRfeEiWUtUOoN2H0LkFA78btlMC96QBDtLuWGLP5q66KfSx0clT67eDWI78yEn9 tmB8Ur7UlhOV6EeMvXhPGOXOlNemMyXggchUgOhxxADsg1o+fLtOTg032Z7icjou3sq/ Xmatd9dpdEh5MFQuW35+AeEZ0RKDYS21tQ6SKFKztufW4qLomKli0u1mcyBBHWBHUuAA PK0kJTv1/ele5zuKN+Yq6bwPV/Is1cLnDEy2fwKUqUafxlcTUeDq3c4EYHmeLoHfFU/I 96TA== 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=J/NXG1LRk/BPgg6FDhPDMsreIASGs/2C+VqHxELMnyo=; b=PcM2SudHCPlBhTb+DcJDN+BXeXoHrvTuKPvbK5bTqPYtvSNLngeSh363/mRAwD9pCv Bk3MQ9Rf59OpaiLhRY2twDpzykWDDcgYTsXfqsK39HQA5Shp+UM+mZKGEQnJO4El+Gse JYKGB+obxClosvL1FHcCHX3JBCFxnJeGhwVbg8Cmeaj7Pj1+92lcqMTxB5s7gZWhrGwB UWqblucVxt7r/q9ORtWU3p+Yc0gmqoZfyUylWkbXOog83FpvySVtt/UPnIFRhTSgMQCO KfcnQrj6M6E6dLPNm8eb1kWySn0jyLMit0uoVDoCJCHuErO/20U/r2TZed6nA0xDiKZY Ampg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=lnSBuMzU; 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 c24si15872976edt.431.2021.02.02.13.28.59; Tue, 02 Feb 2021 13:29:23 -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=lnSBuMzU; 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 S231705AbhBBMvG (ORCPT + 99 others); Tue, 2 Feb 2021 07:51:06 -0500 Received: from so15.mailgun.net ([198.61.254.15]:31413 "EHLO so15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231397AbhBBMup (ORCPT ); Tue, 2 Feb 2021 07:50:45 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1612270224; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=J/NXG1LRk/BPgg6FDhPDMsreIASGs/2C+VqHxELMnyo=; b=lnSBuMzUJjklyVjnT41roBlyKRAFSyxb6xtjs1S6qdPIrje9aGPCgJnnrD/uTSBaaR9rUIrC gZzOduFcdNtaorbkuSBF6lSLmUy2y4Pio9S/mvAlN/vDAzAGa8jklnan12qYCq48EVFsn1lW TPw6PQzNCpz/i0Y9hQ2nF4p1Hhk= X-Mailgun-Sending-Ip: 198.61.254.15 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-n07.prod.us-east-1.postgun.com with SMTP id 60194a71bfd95207230a6257 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 02 Feb 2021 12:49:53 GMT Sender: charante=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 95909C43466; Tue, 2 Feb 2021 12:49:52 +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=-3.1 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.29.110] (unknown [49.37.149.94]) (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 652EBC433CA; Tue, 2 Feb 2021 12:49:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 652EBC433CA 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] mm: page_alloc: update the COMPACT[STALL|FAIL] events properly To: David Rientjes Cc: akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, vinmenon@codeaurora.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1612187338-19100-1-git-send-email-charante@codeaurora.org> From: Charan Teja Kalla Message-ID: <160ba3b5-2cd4-5ff0-1348-fb477cefd33d@codeaurora.org> Date: Tue, 2 Feb 2021 18:19:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: 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 Thanks David for the review!! On 2/2/2021 2:54 AM, David Rientjes wrote: > On Mon, 1 Feb 2021, Charan Teja Reddy wrote: > >> By defination, COMPACT[STALL|FAIL] events needs to be counted when there > > s/defination/definition/\ Done. > >> is 'At least in one zone compaction wasn't deferred or skipped from the >> direct compaction'. And when compaction is skipped or deferred, >> COMPACT_SKIPPED will be returned but it will still go and update these >> compaction events which is wrong in the sense that COMPACT[STALL|FAIL] >> is counted without even trying the compaction. >> >> Correct this by skipping the counting of these events when >> COMPACT_SKIPPED is returned for compaction. This indirectly also avoid >> the unnecessary try into the get_page_from_freelist() when compaction is >> not even tried. >> >> Signed-off-by: Charan Teja Reddy >> --- >> mm/page_alloc.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index 519a60d..531f244 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -4152,6 +4152,8 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, >> memalloc_noreclaim_restore(noreclaim_flag); >> psi_memstall_leave(&pflags); >> >> + if (*compact_result == COMPACT_SKIPPED) >> + return NULL; >> /* >> * At least in one zone compaction wasn't deferred or skipped, so let's >> * count a compaction stall > > This makes sense, I wonder if it would also be useful to check that > page == NULL, either in try_to_compact_pages() or here for > COMPACT_SKIPPED? In the code, when COMPACT_SKIPPED is being returned, the page will always be NULL. So, I'm not sure how much useful it is for the page == NULL check here. Or I failed to understand your point here? As, till now, COMPACTFAIL also presents page allocation failures because of the direct compaction is skipped, creating a separate COMPACTSKIPFAIL event which indicates that 'failed to get the free page as direct compaction is skipped' is useful? > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project