Message ID | 20240326061134.1055295-8-bhe@redhat.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 D7FFCC54E67 for <linux-mm@archiver.kernel.org>; Tue, 26 Mar 2024 06:12:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68A9D6B0099; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 614DE6B009A; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417BE6B009B; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2C59A6B0099 for <linux-mm@kvack.org>; Tue, 26 Mar 2024 02:12:10 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 04CF516098B for <linux-mm@kvack.org>; Tue, 26 Mar 2024 06:12:09 +0000 (UTC) X-FDA: 81938170020.25.425004B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 236B4100002 for <linux-mm@kvack.org>; Tue, 26 Mar 2024 06:12:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KQUM+TY7; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433528; a=rsa-sha256; cv=none; b=cUT00Yhl8Oj3QInE1eKFYKbUvzRWX1rbgLuTUVJ7iZXMjqrW/tvm2xtIf3infF34fNkmnh tuLnqhqG8HSp4MgX5a+Do2NepM7iKjtFLNIAKDR8fP1pEmnoKd2l+CbyotyQl2yTuHvPmA e/bL9qBkG0wNFhmqa11h/WKfH9/uVPo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KQUM+TY7; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711433528; 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:in-reply-to:references:references:dkim-signature; bh=5++WqQNUkBC8lt2n6PufkCB9EJJxn34hVbC1UG4qfn0=; b=LbmaWjkfzZWUT5ufY79X62rBX6Fypn6AMHz/9whrpK2hoTYG8Lrwy24UiTlecXtWdEK22A 9CbaGA5mvv5EuMhJ4rzieTPDJOMkZtsL0hW9fHDofmJGp98igje1ldQNQCRrkNnZEa6odh rTamjhHGbV8N0CNDR+EHtWm5mZw9HoM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433527; h=from:from: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:in-reply-to:references:references; bh=5++WqQNUkBC8lt2n6PufkCB9EJJxn34hVbC1UG4qfn0=; b=KQUM+TY7SzidSOnje8YhYuKDQm8nQzsgGlWZA7pacerJ4Mw88cCburtZactCMDUHB2RgHF pMgzQtsJ7Fr2V098FFoxvPLwUUVkvsiSD0xyrpTYq6GSddEoAxaIR7VS1v5PrL1DxAW/zu x8uAktF3JZng1LUys0ly7WWXPlqFcVY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-382-4Es8gUDVPT-zpcGukC52cw-1; Tue, 26 Mar 2024 02:12:02 -0400 X-MC-Unique: 4Es8gUDVPT-zpcGukC52cw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DE55800262; Tue, 26 Mar 2024 06:12:02 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BBA81074E; Tue, 26 Mar 2024 06:12:00 +0000 (UTC) From: Baoquan He <bhe@redhat.com> To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He <bhe@redhat.com> Subject: [PATCH 7/7] mm/page_alloc.c: change the array-length to MIGRATE_PCPTYPES Date: Tue, 26 Mar 2024 14:11:33 +0800 Message-ID: <20240326061134.1055295-8-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 236B4100002 X-Stat-Signature: maft7am5ambifxmk9ga4j3bs6errfd4u X-Rspam-User: X-HE-Tag: 1711433527-71901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JADu+f+kaWPsAjPIc1orgHdWo/qtjIMZwN/q2PtYuIARUJewHkw09qfDVieFWqEgDnSR3Q2Evp6nlHYup1ExEiJZean+bvA3sgrWVAa11biMbs+rurP9MCcDbunFdW2EY87kSYaasHD8Q== 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/init: minor clean up and improvement
|
expand
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ce1d12cf2ec7..b60cdcda46d2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1592,7 +1592,7 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order, * * The other migratetypes do not have fallbacks. */ -static int fallbacks[MIGRATE_TYPES][MIGRATE_PCPTYPES - 1] = { +static int fallbacks[MIGRATE_PCPTYPES][MIGRATE_PCPTYPES - 1] = { [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE }, [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE }, [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE },
Earlier, in commit 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable pageblocks with others"), migrate type MIGRATE_CMA and MIGRATE_ISOLATE are removed from fallbacks list since they are never used. Later on, in commit ("aa02d3c174ab mm/page_alloc: reduce fallbacks to (MIGRATE_PCPTYPES - 1)"), the array column size is reduced to 'MIGRATE_PCPTYPES - 1'. In fact, the array row size need be reduced to MIGRATE_PCPTYPES too since it's only covering rows of the number MIGRATE_PCPTYPES. Even though the current code has handled cases when the migratetype is CMA, HIGHATOMIC and MEMORY_ISOLATION, making the row size right is still good to avoid future error and confusion. Signed-off-by: Baoquan He <bhe@redhat.com> --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)