Message ID | 20230721014116.3388-1-yangyifei03@kuaishou.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 3651BEB64DD for <linux-mm@archiver.kernel.org>; Fri, 21 Jul 2023 01:43:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66778280175; Thu, 20 Jul 2023 21:43:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F06A28004C; Thu, 20 Jul 2023 21:43:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49122280175; Thu, 20 Jul 2023 21:43:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3634F28004C for <linux-mm@kvack.org>; Thu, 20 Jul 2023 21:43:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0F7241C8DB1 for <linux-mm@kvack.org>; Fri, 21 Jul 2023 01:43:56 +0000 (UTC) X-FDA: 81033922872.09.C31493C Received: from bjm7-spam01.kuaishou.com (smtpcn03.kuaishou.com [103.107.217.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 899CD1C0005 for <linux-mm@kvack.org>; Fri, 21 Jul 2023 01:43:52 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kuaishou.com header.s=dkim header.b=Uaujp7Jr; spf=pass (imf21.hostedemail.com: domain of yangyifei03@kuaishou.com designates 103.107.217.217 as permitted sender) smtp.mailfrom=yangyifei03@kuaishou.com; dmarc=pass (policy=none) header.from=kuaishou.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689903834; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=WfBeYmQN+HAjcDnQhJBJiepaQUpxGJpfp8LGbLzGAuw=; b=798KBGf0Yl4ehKxk5esumO8/LDkMMOEjfNkktxCBAt6MI8AWbz4of5+6gWhVO/yuP7rgHu 2KWqSQaT0Xn6z2RNLM5pdyzjDM1kdqd6YU7JtIQ6mJCOOjQmtPn68wwdIRJEyRr8F/rD+s ILwaRd1zVJ8wE9rqVc6mg13EW1G3Ig0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689903834; a=rsa-sha256; cv=none; b=i1L2fzddOrROsejwHVHhMmft4vBooah4Qql+r6wzMW6ssIyHlY7HKkWJP1bQ5b40rnuedp m8AAE2NlMTtGUvceYZIXC5ubiWMYPrY2MdvqR5xG/Zu+UKkIJYAhMs6gkoaj/pIOE2/Nq5 J8bXX/tzHblSimyPYW49qZYaiY5iGi0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kuaishou.com header.s=dkim header.b=Uaujp7Jr; spf=pass (imf21.hostedemail.com: domain of yangyifei03@kuaishou.com designates 103.107.217.217 as permitted sender) smtp.mailfrom=yangyifei03@kuaishou.com; dmarc=pass (policy=none) header.from=kuaishou.com Received: from bjm7-pm-mail12.kuaishou.com ([172.28.1.94]) by bjm7-spam01.kuaishou.com with ESMTPS id 36L1hd8D011485 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Jul 2023 09:43:39 +0800 (GMT-8) (envelope-from yangyifei03@kuaishou.com) DKIM-Signature: v=1; a=rsa-sha256; d=kuaishou.com; s=dkim; c=relaxed/relaxed; t=1689903819; h=from:subject:to:date:message-id; bh=WfBeYmQN+HAjcDnQhJBJiepaQUpxGJpfp8LGbLzGAuw=; b=Uaujp7JrVr1HhJ67/IKB8PC6lCzPwguABUa/mYbRzCJlEzSqAEHPT0u5lEaBUcmfYhVglsuMskD zNAu9f2cVSHPRTkK2DKpir1lJq754dPe/xWT7D0VITqwOEDznIdlwlwb4C36JHtvxa6y3QNe7yz8J QjoFX/q8VCAyp35S4jU= Received: from public-bjmt-d51.idcyz.hb1.kwaidc.com (172.28.1.32) by bjm7-pm-mail12.kuaishou.com (172.28.1.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Fri, 21 Jul 2023 09:43:38 +0800 From: Efly Young <yangyifei03@kuaishou.com> To: <hannes@cmpxchg.org> CC: <bpf@vger.kernel.org>, <cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, <mhocko@suse.com>, <shakeelb@google.com>, <yosryahmed@google.com>, <yangyifei03@kuaishou.com> Subject: [PATCH] mm:vmscan: fix inaccurate reclaim during proactive reclaim Date: Fri, 21 Jul 2023 09:41:16 +0800 Message-ID: <20230721014116.3388-1-yangyifei03@kuaishou.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.28.1.32] X-ClientProxiedBy: bjxm-pm-mail01.kuaishou.com (172.28.128.1) To bjm7-pm-mail12.kuaishou.com (172.28.1.94) X-DNSRBL: X-MAIL: bjm7-spam01.kuaishou.com 36L1hd8D011485 X-Stat-Signature: nbaoggub33qktoazqg7fi1mako167t8p X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 899CD1C0005 X-Rspam-User: X-HE-Tag: 1689903832-386454 X-HE-Meta: U2FsdGVkX19lRGjmZtwXGYhyyqDD6WjAqTzlTetLjPMPe08U9/Jeud9xRaeclMkUToXvTRIk/yZvSvzTLZ3cRdSdw/U0j0tuOTQb/UAU1cIY5x2BeIXyd2FEddv+f+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79vcFo7G9QxiVFQXvSHZVo3X6AoYffA9g8Md6A7zKlABDos+sKVmy+dBA5zIzwOiuQlwj7J+0rkXU47vAsfqa93fCSiq56imPsKlU5g/hF/fqm 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: <linux-mm.kvack.org> |
Series |
mm:vmscan: fix inaccurate reclaim during proactive reclaim
|
expand
|
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4b27e24..d36cf88 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6741,8 +6741,8 @@ static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf, lru_add_drain_all(); reclaimed = try_to_free_mem_cgroup_pages(memcg, - nr_to_reclaim - nr_reclaimed, - GFP_KERNEL, reclaim_options); + min(nr_to_reclaim - nr_reclaimed, SWAP_CLUSTER_MAX), + GFP_KERNEL, reclaim_options); if (!reclaimed && !nr_retries--) return -EAGAIN;