From mboxrd@z Thu Jan 1 00:00:00 1970 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 E7D5EECAAD3 for ; Thu, 15 Sep 2022 04:34:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C79C6B0071; Thu, 15 Sep 2022 00:34:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 276166B0073; Thu, 15 Sep 2022 00:34:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13EC78D0001; Thu, 15 Sep 2022 00:34:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0231E6B0071 for ; Thu, 15 Sep 2022 00:34:05 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CEC88C0AE0 for ; Thu, 15 Sep 2022 04:34:05 +0000 (UTC) X-FDA: 79913052450.13.4064FA5 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf23.hostedemail.com (Postfix) with ESMTP id 7D46E1400BD for ; Thu, 15 Sep 2022 04:34:05 +0000 (UTC) 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> ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=QW+nu7Uh; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="Jnu//URw"; spf=pass (imf23.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663216445; a=rsa-sha256; cv=none; b=prebh5QPjsgm77qMLqZJ9uUc8kOc8Lvi+1cyoKwilyd8cWqg0LFmjK3fT8GDvwl/YBm9ZI Dh6ClVuSP3CPwEIAgmvZXXeMpFszpMVyWnOgdfl1QdkmdeMTvHjEb4+nbuERBIy0YYFK5K UnQ6A3wgBnH0W1WowRA4nEgFRRUw6Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663216445; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=G5/z54frbvxXoAbMjgu4uOYR70plD0Fi7+VY1zuIczo=; b=xtsMt1+KI60HRmH0iFxjzARJvg0sqH6nb1ueNxr+fL8P/LWDISdkVpIX4+igXdCRwpMyjY luHNW0Ycq1yQE12l3YhvbPLvtX/bV/wvzZpUKZRw2Mhh5CHWxC0hxtf4EtWmlLrWr8s8aw TIXAO7Qyq+YIWsTq7mx9CHys/jBMX1k= X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7D46E1400BD X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=QW+nu7Uh; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="Jnu//URw"; spf=pass (imf23.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Stat-Signature: t8uyaypy7rurs7poxz7h7kfsgfay157j X-HE-Tag: 1663216445-526718 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: 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