Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1704067rwn; Fri, 9 Sep 2022 02:46:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR58t3z92TzW742ktfe2kD6kl7XCxfp3McfderHebJH+aGgkqZW85F7ohfI98tMAgAkqLaBw X-Received: by 2002:a05:6512:3cd:b0:492:f0c2:60b7 with SMTP id w13-20020a05651203cd00b00492f0c260b7mr4513162lfp.639.1662716765154; Fri, 09 Sep 2022 02:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662716765; cv=none; d=google.com; s=arc-20160816; b=JrkBayTMOAZoWKsi66lG/hqCNq8F3uF5Do7Ret2k6wytydht+3cfv0JlhBu5Wk1HNy jr+3t/shgoim2mHvWm4hxbQt/qhJaRWZr1w+56QPyUtkfxgiQzhdal6WIZiIUe9XOmGj Kz5kMllsFUm+QcB+bokys2qWI/HV2eit4cg49cViyN53ruduZirXV3uw26JwwuVv5iBJ QfLOE83Lpbw5lzaXS6BVaoUjMrMVc+kvQxnGESG9P6Sy/ai6WKiOBxvjaRBqh3RNNTaz olVr5c90eaFeQp2/AOeOf/6/Y36ipGXj5hjiSoqrfXtV8fH8CGUBmOn9aAqFfqu/e6Ej Bu6Q== 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=daC2cXG7zrZFjqSO0XVftvX+386KNf8k7c3qi0Xnvxw=; b=nKVI3SdA+dPQw0ZsgLXBh1Q/MM/pArP9NQP841lOA+RUV+gudLA7IV13AztYky9n6a xyuZkzrxxkS6aZD3bthyMgDLGgx2C1rTeCx1tJp+pjIhie+9Z7wL5Y5KaUGzXWLwu+D8 sADnZoaPW/SopA8gNGWyG7SvDkLwXn9qBBr/ZR3Ufd4ciirnW2nNI6F9wAKlnwxLkeMN +GRHiWJRBwYNGairieozuHvZ+NyHv4m7POegi87U+zEXo3l4jxsr2EArif+FjPfSgq5q OeAP+L2RNGmPvVhv2xDOjx4/65iZFdxUVt++wf4VY/QADWDuREWIpXfLvaBdOOOsqsmQ OzzA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a056512098d00b00498f87ccadfsi18098lft.433.2022.09.09.02.45.35; Fri, 09 Sep 2022 02:46:05 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbiIIJ1P (ORCPT + 99 others); Fri, 9 Sep 2022 05:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbiIIJ0x (ORCPT ); Fri, 9 Sep 2022 05:26:53 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D4D5B8F38 for ; Fri, 9 Sep 2022 02:25:28 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9VN2BY0zmVDv; Fri, 9 Sep 2022 17:21:48 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:25 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 01/16] mm/page_alloc: ensure kswapd doesn't accidentally go to sleep Date: Fri, 9 Sep 2022 17:24:36 +0800 Message-ID: <20220909092451.24883-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 ALLOC_KSWAPD is set, wake_all_kswapds() will be called to ensure kswapd doesn't accidentally go to sleep. But when reserve_flags is set, alloc_flags will be overwritten and ALLOC_KSWAPD is thus lost. Preserve the ALLOC_KSWAPD flag in alloc_flags to ensure kswapd won't go to sleep accidentally. Fixes: 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") Signed-off-by: Miaohe Lin --- 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 ba5c9402a5cb..4b97a03fa2dd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5147,7 +5147,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, reserve_flags = __gfp_pfmemalloc_flags(gfp_mask); if (reserve_flags) - alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, reserve_flags); + alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, reserve_flags) | + (alloc_flags & ALLOC_KSWAPD); /* * Reset the nodemask and zonelist iterators if memory policies can be -- 2.23.0