Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6218475rwn; Tue, 13 Sep 2022 00:16:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6r3/gonaQhMDdl4Z2rC0yrxW7tMsJCt/dGO2zgH69LEQMmJtBobc9VSkdjnGQbW9gsZcAC X-Received: by 2002:a05:6a00:8cc:b0:52c:7ab5:2ce7 with SMTP id s12-20020a056a0008cc00b0052c7ab52ce7mr30936606pfu.28.1663053400771; Tue, 13 Sep 2022 00:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663053400; cv=none; d=google.com; s=arc-20160816; b=xo/Y4ytFrd33AlKI/Wf9g5+vpD9yUXOF4B8yMoCHn7l+N9LLqPGMZrFK3uN4a9CQS0 7HlxetKYwbafT/IC7SjyCWYfwJNr7748OCXs9bihWfbAvIfTIFldj8d3ND5IwPClT5v5 iS370gPd+oojoS/oB4EhUmG3MaAOuqZvMxikgEFTQgQasu9VxmPmTen6RAbrt8tOU8IG pzXuKm9+UBUtZlcHzBzKbduSNDLvS4cDU9uLTj0uT61qj8nWHB6PBlb2DhHfFCAwd9wQ LSSoPtnmwGwxTGOYnekZb0LsFMMmqw1ioeKw85DBj41pxrOVgNQV3pscD34wUkPs7ss9 h/dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pm8TCpT9zgQTq/4Ov0Ex0044yIsgbuV+Uar88QFBeps=; b=jVwEayWIoCPf8+iNsIAW39REm05B7CG5RIMGpoOXzfXVdhH9KWNLr+eiyI2jYBkUQ+ OorNYkBoTisDwQQPRGbxB4JfZuvGWb0y+B0YR+Dq76UmEGTedRo6nqOszQyolpbbKR6M P0oVD0uqGJmm4T/fackUWyPYk6YmpAJinpXs3I8xlRT8eiaaUowLgPTmwR4sdKUu/eZr y2HEs5/EA6ReI6RMZWNo/jJCmir22yO+Stcwf5X5myhjF//mP1w6j3SEALBlqvdO4wAm PcIONtYROEg6l/Xy0qwSQVwC7nla38j+zSLampVxbxEb2SarwymV7pN7ZYEhVrKU/mFh uA2Q== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a17090ab88e00b002008d0b0838si9822635pjr.178.2022.09.13.00.16.27; Tue, 13 Sep 2022 00:16:40 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbiIMHDA (ORCPT + 99 others); Tue, 13 Sep 2022 03:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbiIMHC6 (ORCPT ); Tue, 13 Sep 2022 03:02:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 383DA14D14 for ; Tue, 13 Sep 2022 00:02:56 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DF4A7106F; Tue, 13 Sep 2022 00:03:02 -0700 (PDT) Received: from [10.162.42.9] (unknown [10.162.42.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 123293F73B; Tue, 13 Sep 2022 00:03:21 -0700 (PDT) Message-ID: Date: Tue, 13 Sep 2022 12:32:50 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 01/16] mm/page_alloc: ensure kswapd doesn't accidentally go to sleep Content-Language: en-US To: Miaohe Lin , akpm@linux-foundation.org Cc: david@redhat.com, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-2-linmiaohe@huawei.com> From: Anshuman Khandual In-Reply-To: <20220909092451.24883-2-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,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 On 9/9/22 14:54, Miaohe Lin wrote: > 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. Currently wake_all_kswapds() gets skipped subsequently if ALLOC_KSWAPD is lost, but this only happens when the 'retry:' loops is taken ? > > 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