From patchwork Mon Jun 13 12:56:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 12879688 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 75630C43334 for ; Mon, 13 Jun 2022 14:55:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06C2B8D0194; Mon, 13 Jun 2022 10:55:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01B6B8D0171; Mon, 13 Jun 2022 10:55:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E261D8D0194; Mon, 13 Jun 2022 10:55:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CE29E8D0171 for ; Mon, 13 Jun 2022 10:55:18 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AB137342DD for ; Mon, 13 Jun 2022 14:55:18 +0000 (UTC) X-FDA: 79573510716.02.61A63E4 Received: from outbound-smtp25.blacknight.com (outbound-smtp25.blacknight.com [81.17.249.193]) by imf01.hostedemail.com (Postfix) with ESMTP id 08B3F405D3 for ; Mon, 13 Jun 2022 14:53:42 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 9ECBFCAB91 for ; Mon, 13 Jun 2022 13:57:14 +0100 (IST) Received: (qmail 29193 invoked from network); 13 Jun 2022 12:57:14 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPA; 13 Jun 2022 12:57:14 -0000 From: Mel Gorman To: Andrew Morton Cc: Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , Hugh Dickins , LKML , Linux-MM , Mel Gorman Subject: [PATCH 4/7] mm/page_alloc: Remove mistaken page == NULL check in rmqueue Date: Mon, 13 Jun 2022 13:56:19 +0100 Message-Id: <20220613125622.18628-5-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220613125622.18628-1-mgorman@techsingularity.net> References: <20220613125622.18628-1-mgorman@techsingularity.net> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655132023; a=rsa-sha256; cv=none; b=HJsx354LHBZ4K3sD3r/CiXIFbzU/zSDs5M3PjDvTcYkGqjIzmAISY87X4wV5mzHB1s5XAw El2CCQH9ev7duKWgLCzqWwc+9+74kghr0Scoo2m0pSiyYF2fKXlGo1EAilABOGM8NAE5mH hwJZCB0I/+pl+lIkdaRpW5DwQMvQmAI= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf01.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655132023; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CpKbpBkRPx5i5h1XOAeKyIGn1KxXP1MbOZRyma+4oAc=; b=VWreFbqLiA7Jk1fDZU+g4rT5OQe0y8kY+NDz9sOg97XEjC/ztPeinownbzq4BKcqEdR4LC 7AP7pTOOAywo8dArqg1+ga3AUyJNYqt5bdGGrIg+L5RN0v6IIo7U5lz2SNWaoTaoRck8Ef pKy4EWos9u4Lxoyme7Noe+c5wCFVfAs= X-Stat-Signature: rs1gkt87zsrwrqye41948mmu3yk8e91q X-Rspamd-Queue-Id: 08B3F405D3 X-Rspam-User: X-Rspamd-Server: rspam09 Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf01.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.193 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-HE-Tag: 1655132022-693083 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: If a page allocation fails, the ZONE_BOOSTER_WATERMARK should be tested, cleared and kswapd woken whether the allocation attempt was via the PCP or directly via the buddy list. Remove the page == NULL so the ZONE_BOOSTED_WATERMARK bit is checked unconditionally. As it is unlikely that ZONE_BOOSTED_WATERMARK is set, mark the branch accordingly. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/page_alloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 44d198af4b35..7fb262eeec2f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3777,12 +3777,10 @@ struct page *rmqueue(struct zone *preferred_zone, page = rmqueue_buddy(preferred_zone, zone, order, alloc_flags, migratetype); - if (unlikely(!page)) - return NULL; out: /* Separate test+clear to avoid unnecessary atomics */ - if (test_bit(ZONE_BOOSTED_WATERMARK, &zone->flags)) { + if (unlikely(test_bit(ZONE_BOOSTED_WATERMARK, &zone->flags))) { clear_bit(ZONE_BOOSTED_WATERMARK, &zone->flags); wakeup_kswapd(zone, 0, 0, zone_idx(zone)); }