From patchwork Mon Dec 6 03:19:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoyang Huang X-Patchwork-Id: 12657639 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 C554DC433F5 for ; Mon, 6 Dec 2021 03:20:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15F9E6B007B; Sun, 5 Dec 2021 22:19:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10F316B007D; Sun, 5 Dec 2021 22:19:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF2AC6B007E; Sun, 5 Dec 2021 22:19:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id DE5B66B007B for ; Sun, 5 Dec 2021 22:19:51 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9559C180DD560 for ; Mon, 6 Dec 2021 03:19:41 +0000 (UTC) X-FDA: 78885914562.12.FD43F96 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf28.hostedemail.com (Postfix) with ESMTP id 3DD81900009A for ; Mon, 6 Dec 2021 03:19:41 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso7232614pjb.0 for ; Sun, 05 Dec 2021 19:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id; bh=JRCJVtamUUaroED1nWHJzoeg1mlyoIA8vGQkHPHJwiY=; b=ZUU/lOAa5jYgUc0gr1xv7DnfvA4g/hfTf2f4Pv59OJHFCocSPx+Hji2is4ixK/RZAz l3FrXhR2QKbZwJQVSxFd2MLwEFDbkZ89K5Qs+WAELUQLJpRFJFhaI+NScqxQBWeTDYPl sCI+pDfDCFgVsPEGfAfjNGIDU1uV955XYNAJbCMhXYDaEQM16j0rm6+xz3kqG/AEo1xZ +0q/zTVxWCFuyxUMTuav452wKFSvDxP+XKdnFq2+//ULfiRKZ/jA/xXpMrUexwZ+SqXv CYg5deeJiIEPUvoL4lrLZ+hQ3iDWFjGXmNbXy/YDTa5sVMkuX4OPLJKTLua9rwKLLw+6 q3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id; bh=JRCJVtamUUaroED1nWHJzoeg1mlyoIA8vGQkHPHJwiY=; b=ZjbBMrFIQjl4ZDR0NpAMXWpTkvZzEQ00dFNWefm7HNd7rsPhICq6PRXvwD0IBIC2on bXbz4XKYp2B5azsQu8XWgbf/BIiiKGnKwxjuMQZ2nhwu6B7gvzweH8glWOXaGWahZMws hyQsRPs7XdEUPMrEvvp8I+U/X1cqyviSG0Gt4l0avD401FoZW1jApbw5888N39z6d+K7 xF083gEhd/1hodluio5xPW5ttQMXE13/y1U/n5uKmw4EvwanJxf6tYA6FikeZR9G4rSv rTSzzJcOuJCgo9dqskVA/slSUaNT3Hm4uNk4+e8nFmzFehwI/h8qn4gQEykuXKoK+lj4 rq5Q== X-Gm-Message-State: AOAM532xIjhGufL3bE74IPEc4KESG2zbaEgQ66i94JKmbGVX5b0xqvKl xKjBAbg+x/ZKJtLTh01QxYw= X-Google-Smtp-Source: ABdhPJx9jlXIb3H3+JFdf3F4ytE+Cz8tBA+7WqQMV07bzmBVohEGoUcJzPHMi7eKVMYXA/krteEXuA== X-Received: by 2002:a17:903:10d:b0:142:6343:a48e with SMTP id y13-20020a170903010d00b001426343a48emr40568502plc.29.1638760780269; Sun, 05 Dec 2021 19:19:40 -0800 (PST) Received: from bj03382pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d20sm10200261pfl.88.2021.12.05.19.19.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Dec 2021 19:19:39 -0800 (PST) From: Huangzhaoyang To: Andrew Morton , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: mask DIRECT_RECLAIM in kswapd Date: Mon, 6 Dec 2021 11:19:22 +0800 Message-Id: <1638760762-27239-1-git-send-email-huangzhaoyang@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3DD81900009A X-Stat-Signature: do7dk5frg3bhggm6f4daqbezt9qqxghn Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="ZUU/lOAa"; spf=pass (imf28.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1638760781-806338 X-Bogosity: Ham, tests=bogofilter, spamicity=0.009694, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Zhaoyang Huang As the eg bellowing, using GFP_KERNEL could confuse the registered .releasepage or .shrinker functions when called in kswapd and have them acting wrongly.Mask __GFP_DIRECT_RECLAIM in kswapd. eg, kswapd shrink_page_list try_to_release_page __fscache_maybe_release_page ... if (!(gfp & __GFP_DIRECT_RECLAIM) || !(gfp & __GFP_FS)) { fscache_stat(&fscache_n_store_vmscan_busy); return false; } Signed-off-by: Zhaoyang Huang --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index ef4a6dc..3b5c5e6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4083,7 +4083,7 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx) bool boosted; struct zone *zone; struct scan_control sc = { - .gfp_mask = GFP_KERNEL, + .gfp_mask = GFP_KERNEL & ~__GFP_DIRECT_RECLAIM, .order = order, .may_unmap = 1, };