From patchwork Sat Jun 22 03:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "yongfa.hu" X-Patchwork-Id: 13708194 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 3CE88C27C4F for ; Sat, 22 Jun 2024 03:28:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB2828D01B2; Fri, 21 Jun 2024 23:28:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B613D8D01AF; Fri, 21 Jun 2024 23:28:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A28EF8D01B2; Fri, 21 Jun 2024 23:28:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 855358D01AF for ; Fri, 21 Jun 2024 23:28:34 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1A89B1212D6 for ; Sat, 22 Jun 2024 03:28:34 +0000 (UTC) X-FDA: 82257092148.14.CC24602 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) by imf29.hostedemail.com (Postfix) with ESMTP id 7CB48120005 for ; Sat, 22 Jun 2024 03:28:31 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=163.com header.s=s110527 header.b=AWiB9So9; spf=pass (imf29.hostedemail.com: domain of hushange@163.com designates 220.197.31.5 as permitted sender) smtp.mailfrom=hushange@163.com; dmarc=pass (policy=none) header.from=163.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719026901; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=lIGxqX9x+SGOnQIbd5VQLVmLF3zctLikoC965VXpZOc=; b=S1nCoh9tYEhiUy4ZaDz+w+7cbSKpqRk4veTSH1Gs9NWW7+TVfRZ0TxYntdUc5UnKYj8zqt TlpnZdlmPLhQt8tZgJ91Xmlm45+jDytRKdCeqIrKoq9NOiwVVraOE1D7PwXtttnKTjDaFC p+Sh9uQlqHJGl8oftxYOuChww3srOJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719026901; a=rsa-sha256; cv=none; b=Gv6zhuA2cfSYXnxZL0RqY3o4nlJyH8rBMNYt54wYrjN3VvAOhIhABjO/qGqbX3g/ErySlw 5zRS7Vl43lcYiuDS1TlXGByvf5rcnEXlyW8mFMj2/TC5yvogTMUr9niaBoMHItFwB08541 4TTR2Whii82/COAeOQodnjxtwpEizFk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=163.com header.s=s110527 header.b=AWiB9So9; spf=pass (imf29.hostedemail.com: domain of hushange@163.com designates 220.197.31.5 as permitted sender) smtp.mailfrom=hushange@163.com; dmarc=pass (policy=none) header.from=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=lIGxqX9x+SGOnQIbd5 VQLVmLF3zctLikoC965VXpZOc=; b=AWiB9So9B+6nRX3D0g9qlRUW1XrdR29XZx GozJXLFbY34FGVOYak6tckCArfKSafYFjqnTyxEGdcKtZ9PQuOGyHQ9EFLZ1O2GT vnQZVC0RPclEg+n/MBlb1ze8slxSlQGRiiExT2EbS+y1JBS+XeQB6gvPpjA02AIY CL7fraw60= Received: from localhost.localdomain (unknown [120.229.10.157]) by gzga-smtp-mta-g2-1 (Coremail) with SMTP id _____wD3_xjaRHZm8F+GBw--.59538S2; Sat, 22 Jun 2024 11:28:27 +0800 (CST) From: "yongfa.hu" To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hushange@163.com Subject: [PATCH] mm: rename no_progress_loops to reclaim_retries. variable no_progress_loops exectly means reclaim retry counts, renameing makes it easier to understand. and has the same style as variable compaction_retries. Date: Sat, 22 Jun 2024 11:28:17 +0800 Message-Id: <20240622032817.24064-1-hushange@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wD3_xjaRHZm8F+GBw--.59538S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAF4kCr4DAFWrXF1fCF4kZwb_yoW5Jw4fpF 4xu3ZrGrZYqFnxJFZ5Aa109F18A3s7KFZ8Xr1xKryxZw1fJrya9rW7Kry2vF18XF4DXayY vFs8Ar40grn8Aa7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRo5lbUUUUU= X-Originating-IP: [120.229.10.157] X-CM-SenderInfo: xkxvxtxqjhqiywtou0bp/1tbiLxwGnmVOEcRDEgAAsE X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7CB48120005 X-Stat-Signature: deixhdf1ntfi8r6gsemzmkxmth96y7t4 X-HE-Tag: 1719026911-426596 X-HE-Meta: U2FsdGVkX1+Glw67LL7t8l5gzS44THFE6oODdMnJyGzuP8btidj+MMdIVQ/mJK4/MyigCo1WvXmmGZ8eGFoIyqU8auZyT+Ymju+1c3N9YM1f79NVHJZSZcEG/7T3omEhD0oNCoSPPQRJOJpMmY631vFWYqyTZLevDuyV7BlToNOJR1tfziJtkxtCku0nupQPqt5RKrNlJpgNQmZP8i2llZ61+Ja8iPFiIvl0SpiGaiYzvP9Ey5LiUw2oSuM3pO2uJr/AJYLMwW7NiFNX73nuhAIrKYp87vuW3gVnnwep/ZXCnz9DcxoK2nZibuw4ZnznqkzyTPzgH4atVLtuMLNqAuB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Uw1FOLp0LhRjOiR+qRG+PAF/mFa7OnKlqT+y3mEpXyCGXwOKx3LEtYp/ifuTfi5l1F4YkdRCqQ/BBYwzq2xKL9I5WKLeYW8v9/ZShfIc3vcy X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Signed-off-by: yongfa.hu --- mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9054645ed..1435a9587 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4107,7 +4107,7 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask) static inline bool should_reclaim_retry(gfp_t gfp_mask, unsigned order, struct alloc_context *ac, int alloc_flags, - bool did_some_progress, int *no_progress_loops) + bool did_some_progress, int *reclaim_retries) { struct zone *zone; struct zoneref *z; @@ -4119,11 +4119,11 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, * always increment the no progress counter for them */ if (did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER) - *no_progress_loops = 0; + *reclaim_retries = 0; else - (*no_progress_loops)++; + (*reclaim_retries)++; - if (*no_progress_loops > MAX_RECLAIM_RETRIES) + if (*reclaim_retries > MAX_RECLAIM_RETRIES) goto out; @@ -4150,7 +4150,7 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, wmark = __zone_watermark_ok(zone, order, min_wmark, ac->highest_zoneidx, alloc_flags, available); trace_reclaim_retry_zone(z, order, reclaimable, - available, min_wmark, *no_progress_loops, wmark); + available, min_wmark, *reclaim_retries, wmark); if (wmark) { ret = true; break; @@ -4222,14 +4222,14 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, enum compact_priority compact_priority; enum compact_result compact_result; int compaction_retries; - int no_progress_loops; + int reclaim_retries; unsigned int cpuset_mems_cookie; unsigned int zonelist_iter_cookie; int reserve_flags; restart: compaction_retries = 0; - no_progress_loops = 0; + reclaim_retries = 0; compact_priority = DEF_COMPACT_PRIORITY; cpuset_mems_cookie = read_mems_allowed_begin(); zonelist_iter_cookie = zonelist_iter_begin(); @@ -4390,7 +4390,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, goto nopage; if (should_reclaim_retry(gfp_mask, order, ac, alloc_flags, - did_some_progress > 0, &no_progress_loops)) + did_some_progress > 0, &reclaim_retries)) goto retry; /* @@ -4427,7 +4427,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, /* Retry as long as the OOM killer is making progress */ if (did_some_progress) { - no_progress_loops = 0; + reclaim_retries = 0; goto retry; }