Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp690381iog; Mon, 13 Jun 2022 10:43:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLGUW0vE/jblssotLBvsvMlgjhTF/L1bZav1Ni1D7fTwne0/rX5rRkSHh/rs+yNG0HF3m8 X-Received: by 2002:a17:90b:380b:b0:1e6:67f6:f70c with SMTP id mq11-20020a17090b380b00b001e667f6f70cmr16715978pjb.120.1655142223522; Mon, 13 Jun 2022 10:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655142223; cv=none; d=google.com; s=arc-20160816; b=RpUBnKCNAMzdQvz0UoWYMHdSV9YxNwUnvhLtvxcHZNo5ElRN4hvk3eR9vTIUsxta9O QkzikzSMlyl1ffthcIWRHfXCEbgWbO5LJlhHjcG95hH5SswUVJl6yS42RgX5ROARRSZd s8IzcVi/IKxTKo8t5VzViU8hlm557YXcB0x4KlRiXlG7r61f6iRiDRfwwsU17DSwUrr0 TP+W8ujDuEk1aj6IkiEmNxwYcoCntZoBtbObOuO87bDSoF/J2fXWoKvnoTdm/YwxQsVS Plw3N96x9YxrvgQYX6FMZEqNaR9GVwzEib+tl3JufHmnDs1XugyNImkyuu1J0zKx5qXu cEgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CpKbpBkRPx5i5h1XOAeKyIGn1KxXP1MbOZRyma+4oAc=; b=gY08TwaTD7vqvy65SnfelbL6cVRpf7Q0ezzvmp9ooWueOC2NRXSeFTRGWHY47bSoDE +SvD+m0zvLMlJN0ezrDVfcLCOq5HE3SBy9aKZ9i3cK89prRb7j4FjzF6oXV/mu5F3mZw OUBHssTs3qlmxw1l39wNL6r1tSDvGrYwqBnW6+nAG2sly0pmDhWxLW5bevIG9yGdV0KO /94h2preIo3VC0IMpEZAu8vbNxe6EZXF2yUM0bRpngwm0TBFsiitfD2v+tKrkAgaiTN1 hmg1RHvh8ygnaG928tA0P8iKsCj8tI/igrQmGWFufFvnvduFGSYvxNad86Rgrw1tG1zR crqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170902b28200b0016795e2dd72si9452236plr.359.2022.06.13.10.43.26; Mon, 13 Jun 2022 10:43:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbiFMRgV (ORCPT + 99 others); Mon, 13 Jun 2022 13:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239588AbiFMReo (ORCPT ); Mon, 13 Jun 2022 13:34:44 -0400 Received: from outbound-smtp01.blacknight.com (outbound-smtp01.blacknight.com [81.17.249.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D7416541A for ; Mon, 13 Jun 2022 05:57:16 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id 9DE02C4A2C 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)); } -- 2.35.3