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.4 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 C6029C433E0 for ; Sat, 6 Feb 2021 01:57:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03D7965021 for ; Sat, 6 Feb 2021 01:57:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03D7965021 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 1AB166B0005; Fri, 5 Feb 2021 20:57:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 15E696B006C; Fri, 5 Feb 2021 20:57:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04CD06B006E; Fri, 5 Feb 2021 20:57:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id DF9976B0005 for ; Fri, 5 Feb 2021 20:57:17 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A7889181AEF1A for ; Sat, 6 Feb 2021 01:57:17 +0000 (UTC) X-FDA: 77786180514.13.vest45_34048fb275e9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 8926A18140B67 for ; Sat, 6 Feb 2021 01:57:17 +0000 (UTC) X-HE-Tag: vest45_34048fb275e9 X-Filterd-Recvd-Size: 4322 Received: from mail29.static.mailgun.info (mail29.static.mailgun.info [104.130.122.29]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Sat, 6 Feb 2021 01:57:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1612576637; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=Wp8L5Uv0x1WmD2G3Tgk2vfJDnMP6rhkD3cr6tfJd2/Y=; b=ERCuGbc6I3QxlnIBD8RqDqTDsQ4iiGPZY/b9VbC5AZ0O9UFoV2ECPgPWLNnENNWQDGVi5cJt 9cvrGdS/u2BAi/zSsxUFOriYEVHKLxonNRtxaE2QYKww4Byfm+H3MbAfWwLWOAn21SelIp8s 0U8/P9nXhzMMmjTcvdOq6y7lFxw= X-Mailgun-Sending-Ip: 104.130.122.29 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-n07.prod.us-east-1.postgun.com with SMTP id 601df77781f6c45dcebeed14 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sat, 06 Feb 2021 01:57:11 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8A3C1C43462; Sat, 6 Feb 2021 01:57:10 +0000 (UTC) Received: from [192.168.29.110] (unknown [49.37.158.25]) (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 9DFC5C433C6; Sat, 6 Feb 2021 01:57:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9DFC5C433C6 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> <160ba3b5-2cd4-5ff0-1348-fb477cefd33d@codeaurora.org> <1213f4c6-7557-268d-253e-23f8fea55b19@google.com> From: Charan Teja Kalla Message-ID: <8a03203b-e6dd-3a86-5b83-33d9c6adcc11@codeaurora.org> Date: Sat, 6 Feb 2021 07:27:04 +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: <1213f4c6-7557-268d-253e-23f8fea55b19@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000011, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/6/2021 3:58 AM, David Rientjes wrote: >> 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? >> > Your code is short-circuiting the rest of __alloc_pages_direct_compact() > where the return value is dictated by whether page is NULL or non-NULL. > We can't leak a captured page if we are testing for it being NULL or > non-NULL, which is what the rest of __alloc_pages_direct_compact() does > *before* your change. So the idea was to add a check the page is actually > NULL here since you are now relying on the return value of > compact_zone_order() to be COMPACT_SKIPPED to infer page == NULL. > > I agree that's currently true in the code, I was trying to catch any > errors where current->capture_control.page was non-NULL but > try_to_compact_pages() returns COMPACT_SKIPPED. There's some complexity > here. Thanks for the detailed explanation. This looks fine to me. I will send V2 with this information in the commit log. -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project