From patchwork Fri Sep 16 10:58:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 12978409 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 B296DECAAD8 for ; Fri, 16 Sep 2022 10:59:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E00AB8D0002; Fri, 16 Sep 2022 06:58:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB11B8D0001; Fri, 16 Sep 2022 06:58:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C78D78D0002; Fri, 16 Sep 2022 06:58:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B2E418D0001 for ; Fri, 16 Sep 2022 06:58:59 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 87A23120A6D for ; Fri, 16 Sep 2022 10:58:59 +0000 (UTC) X-FDA: 79917651198.15.474A0CC Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf05.hostedemail.com (Postfix) with ESMTP id 5BBB01000B9 for ; Fri, 16 Sep 2022 10:58:57 +0000 (UTC) Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTPS id 28GAwVml097851 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 16 Sep 2022 18:58:31 +0800 (CST) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 16 Sep 2022 18:58:31 +0800 From: "zhaoyang.huang" To: Mel Gorman , Andrew Morton , Zhaoyang Huang , , , Subject: [RFC PATCH] mm: check global free_list if there is ongoing reclaiming when pcp fail Date: Fri, 16 Sep 2022 18:58:12 +0800 Message-ID: <1663325892-9825-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 28GAwVml097851 ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663325939; a=rsa-sha256; cv=none; b=fXmYya9juoXfncftVBNYsQyBRxZEae+MOfWum3+8R5T9npWI/iqi4OpTZTpEO0lHnrs8qg ueFKj8lDBcqqXrFfzfo0IWxm40DB7dZdq1/ILs602id5nBP5EUhzPqFinXYlBG81TQZ/yy +/TzyRIUduguKQ6F0J8uUPMLCE9Y04E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663325939; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=heyAav7cP5DeiLAyZVkPXilu+yl/Pdp1UrBG+LNPCfw=; b=xgl8LGe6lwxGEqoy/ZwOJ0bNmDIrBjNb5tAqyRK8QkgQh17dZJavBakreURoEnHrE6qkio //fdpQi0EmPZwYMnyArgm0pOgjbcUqVqLKeZa5K3tZDxv73FYvT9NUiqUvBnYHDOrbbyji +13ctG9+dW8J3ySG9A66DShemiDv4eY= X-Rspamd-Queue-Id: 5BBB01000B9 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none X-Stat-Signature: 3i4e9me6add5kynurm9t9r7ehwbh1wzz X-Rspamd-Server: rspam04 X-HE-Tag: 1663325937-76590 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: From: Zhaoyang Huang Check the global free list again even if rmqueue_bulk failed for pcp pages when there is ongoing reclaiming, which could eliminate potential direct reclaim by chance. Signed-off-by: Zhaoyang Huang --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e008a3d..7e99f7d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3729,7 +3729,8 @@ struct page *rmqueue(struct zone *preferred_zone, migratetype != MIGRATE_MOVABLE) { page = rmqueue_pcplist(preferred_zone, zone, order, gfp_flags, migratetype, alloc_flags); - goto out; + if (page || !test_bit(ZONE_RECLAIM_ACTIVE, &zone->flags)) + goto out; } }