Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp314286rwn; Wed, 14 Sep 2022 21:45:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4NpysZOtkcu7jrva485iksEqIsVRLnw9M4GJlAR2Muul+F2krcc9i43hVBLA8yVx89ZMWb X-Received: by 2002:a17:906:ef90:b0:77c:280b:93a1 with SMTP id ze16-20020a170906ef9000b0077c280b93a1mr14899432ejb.709.1663217130645; Wed, 14 Sep 2022 21:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663217130; cv=none; d=google.com; s=arc-20160816; b=SVngL1ajG4xl9UoUKrNI3iOlj1hM5xVUxC1YkY/DGk63qr73STA43jfEyjHtb76Ot2 AwdpfvgtVR9GvCeC25MdC9Dk1lreJQjsxrkmjmIw6VopHWi7Rgk5teyEKcQN5ZOKWRUZ ERNvWC/rJazN2OKOCqGnsCE+Ets3Bgt6R+UxUr9OANZ21JCQasZ0pKsp4CPb8LW65GpZ IP0JbtssI+X9tPWw5ifKzBrsIWlccThkJKzEgFvIGzKwNpOVbtxVI/nnRW14gFJmhOSZ aBPe6rhXHEbuTnRqbU1R/E8Ku8NjMwwqkGEf1lWIQ27tTeq+ObPoWciEpSUni2+bpIAx CF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=G5/z54frbvxXoAbMjgu4uOYR70plD0Fi7+VY1zuIczo=; b=Vhg+kVWXsS5OlJFp6/bD/o+HLtmtBi4FbaoA8F8s37edW56nib5MxHJpRIyqtSRQhA anXwontKnyuLxYF3PubCepvKIkpWPG49Qalr+r8IWKkj7ut9RNi/++C78U31SrSgZdhE atUfNbe+bAZefqBMpTrO8NO/8cmDVjN5n63tkiXOtOZ6z0SbKJ7bEA9506qoxXLxoHtF V0aPA7cQg6lMclBWBQS9IME8pg1KS+4KOeZahNNHfkHHrbdS9258hrLjyrD7MhG2OBqz tSww33+RHFIPH8ZNf1jFgV7rXnl87obGFPsoIN3wwRGcZ9jpb6kDnfP94kZxvLKb/eAQ 46FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QW+nu7Uh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="Jnu//URw"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a50874e000000b0044869b3886bsi12217479edv.194.2022.09.14.21.45.04; Wed, 14 Sep 2022 21:45:30 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QW+nu7Uh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="Jnu//URw"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbiIOEeI (ORCPT + 99 others); Thu, 15 Sep 2022 00:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiIOEeH (ORCPT ); Thu, 15 Sep 2022 00:34:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F918E4EB for ; Wed, 14 Sep 2022 21:34:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3A88D5CCAE; Thu, 15 Sep 2022 04:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663216444; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G5/z54frbvxXoAbMjgu4uOYR70plD0Fi7+VY1zuIczo=; b=QW+nu7Uh54+PMwibzMW5XVBt0/dy9tJZ1fX+d2mUcurnS02kX0S+I+xG/uWUiCU/2z70xm q7iJXuLRxMatZTCNcMP6E2mZO0/cDlX+hDxleCuUrHIuJ6LeLZ1hdFkZS+HOD0fB4lq7dJ JVcC4ie5s74ONdsYaocqqa7rmO7XqzM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663216444; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G5/z54frbvxXoAbMjgu4uOYR70plD0Fi7+VY1zuIczo=; b=Jnu//URwA9D6Ch+X/Blx3j1U2Ed07UXsGkchW//dAlhN4R8Ic1VQ97sTQuN4l5sbTUElyd GBwttHts7KuaxHBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DCA1B139C8; Thu, 15 Sep 2022 04:34:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o/4yMzurImOrKAAAMHmgww (envelope-from ); Thu, 15 Sep 2022 04:34:03 +0000 Date: Thu, 15 Sep 2022 06:34:02 +0200 From: Oscar Salvador To: Miaohe Lin Cc: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/16] mm/page_alloc: ensure kswapd doesn't accidentally go to sleep Message-ID: References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-2-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909092451.24883-2-linmiaohe@huawei.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Fri, Sep 09, 2022 at 05:24:36PM +0800, 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. > > Fixes: 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") > Signed-off-by: Miaohe Lin Reviewed-by: Oscar Salvador > --- > 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 > -- Oscar Salvador SUSE Labs