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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CBB5C54EE9 for ; Tue, 20 Sep 2022 09:08:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAD75940009; Tue, 20 Sep 2022 05:08:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5D35940007; Tue, 20 Sep 2022 05:08:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92470940009; Tue, 20 Sep 2022 05:08:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 84471940007 for ; Tue, 20 Sep 2022 05:08:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3FBABABB36 for ; Tue, 20 Sep 2022 09:08:03 +0000 (UTC) X-FDA: 79931886846.05.C12BFE8 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by imf29.hostedemail.com (Postfix) with ESMTP id 05D8C120012 for ; Tue, 20 Sep 2022 09:08:02 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id z25so2715887lfr.2 for ; Tue, 20 Sep 2022 02:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=lTwQgGKsN4u+IHIwS7NB3rxBXGJGFOsQ4NRRi3geOiA=; b=i3RphDML/blXszxKEWFj2igVbpOcSOH7TgpMIy0B6DcHZFoa42jUI0WiZjFXXimooT L+nCMfCIbmj29DgFHspN7eGv7Y7ZdsgsMenlxtYjKx0Avsv5YZ3TbE2OYD919oUJ0LBZ DegB7SZhhY36JPgwvmjvYcwhej0Edm80mB1z7VJLbkx61vWljlxEkcIeZKyYrHqLsOvU AoTDLjS4pOfFOWkwpm69U3haWb5HGkYsjwH3rS+zRcOl04ruLL0LSALoOv6P98fILWSb uEnpD12nyUcBDhyueGgiDs4rRRxEjZ8d1CyiWWj0DALcLP9jDhtq/EtyFIfXhlii1uz2 Dq/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=lTwQgGKsN4u+IHIwS7NB3rxBXGJGFOsQ4NRRi3geOiA=; b=kk8amVuz5wC9dDJ9yXG4qniEHXPJ1LH67FiJKQJcBJhs8QczSoaWlFfAMrtIm+5seE 2tJb7ADZGDyHHKRQZH7AiK9ho+oNavA5XhtawzVFZW+cusa2UK9uFXBc5IbyfbskRva/ es+8ajgIcTDtwBqh0dgZv6/YQN1tQsnxjnqKQETf1dJypzoTgxuRWP31SzSGuQ1TwK80 1ceIwpzl63Hpof3QA6JK+OzwcZFuCP1zXJWk3BOOGTJr9pIeCb+xPWc4FAPmBCMB26Ze R5dThm9oU+IiZHeXifgoF72CK85+4e8UrkSsPOD6z4A9mehyCt3HuylY1JquKNPqw858 BZkw== X-Gm-Message-State: ACrzQf3z30H01EY+akycRJq/IlXJXF3fVsYFvLYX/pjLFRGkoNUJR2+3 Z+WS0zCV6fwbOScoc/Jm0hH3ZCkcIKrXvD1fsmGNq9X7o1Q= X-Google-Smtp-Source: AMsMyM7NOubRpDrd2wtB5vj/FYh5Cxm1ew8oaIofNOeyAv2a+rf+IxsKz/AWngvtLvYwF7zn6FG1yDanFNDKC1QfbTM= X-Received: by 2002:a05:6512:151a:b0:49c:2f02:4e22 with SMTP id bq26-20020a056512151a00b0049c2f024e22mr8308280lfb.130.1663664881408; Tue, 20 Sep 2022 02:08:01 -0700 (PDT) MIME-Version: 1.0 References: <1663634940-6515-1-git-send-email-zhaoyang.huang@unisoc.com> <20220920085437.ngyrzgxe2uoi7g4a@techsingularity.net> In-Reply-To: <20220920085437.ngyrzgxe2uoi7g4a@techsingularity.net> From: Zhaoyang Huang Date: Tue, 20 Sep 2022 17:07:33 +0800 Message-ID: Subject: Re: [PATCHv2] mm: check high-order page when free it to pcp To: Mel Gorman Cc: "zhaoyang.huang" , Andrew Morton , "open list:MEMORY MANAGEMENT" , LKML , Ke Wang Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663664883; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lTwQgGKsN4u+IHIwS7NB3rxBXGJGFOsQ4NRRi3geOiA=; b=PlsIggFA1DY8BY5+YjKRWI/qY5gApq6yYxfEANNn9bwbPR0IExT0i4wK+KCkd63uODeYzm KQDuEHjxISsD6/Wc1P98TcdZslAIuYmdyOPDSBtqn2r8Km+bktN6+mveuTrwahEpo6YK+x d8bqiT4HdDe+49DskHOeygzxXx57KII= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i3RphDML; spf=pass (imf29.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663664883; a=rsa-sha256; cv=none; b=aob9SV6QVije6eAxxfCoEThwIMUFiukzWtgRpcMzKBf+Lh34uCenXKSIAnbyMry7MQ7ovF efX/fYZSxU+lQ68ebcM3zv6WEOK6MDJ8jC4YM+ObaDN9hkysvDC6Pp7c1KP8RLnV3EUnPA oXI8ebJ8gLGZ64uR0aTAefNjJdHaNfs= X-Stat-Signature: udy1jkac95wa4ixqjr743acx5bgxbcoz X-Rspam-User: X-Rspamd-Queue-Id: 05D8C120012 X-Rspamd-Server: rspam02 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i3RphDML; spf=pass (imf29.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1663664882-974174 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 Tue, Sep 20, 2022 at 4:55 PM Mel Gorman wrote: > > On Tue, Sep 20, 2022 at 08:49:00AM +0800, zhaoyang.huang wrote: > > From: Zhaoyang Huang > > > > High-order pcp page escaped from checking when both of DEBUG_VM and debug_pagealloc > > are all disabled if it allocated again from pcp_list without going to global > > free list, which should be introduced by 44042b4498. > > > > fix:44042b4498 > > > > Signed-off-by: Zhaoyang Huang > > Why is the order check needed? In this case, I think the comment itself was > wrong and should be corrected. free_pcp_prepare is called when dealing with > a PCP page being freed and these days that may order-0 or high-order pages. > Wieh DEBUG_VM disabled, the pages are checked in by bulkfree_pcp_prepare > when freeing pages from PCP to the core allocator. Why would just > high-order pages be checked in free_pcp_prepare and checked again in > bulkfree_pcp_prepare? for high-order pcp pages(head page in fact), they might escape from bulkfree_pcp_prepare if they were allocated from pcp-list again(pcp->count < high) prior to going to core allocator. for order-0 pcp pages, they will not be checked at all for the purpose of reducing overhead. > > -- > Mel Gorman > SUSE Labs