From patchwork Mon Jul 29 08:04:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hao Ge X-Patchwork-Id: 13744518 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 85FE1C3DA61 for ; Mon, 29 Jul 2024 08:04:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C9F06B0096; Mon, 29 Jul 2024 04:04:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 179FE6B0099; Mon, 29 Jul 2024 04:04:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08FD66B009A; Mon, 29 Jul 2024 04:04:57 -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 DF3F76B0096 for ; Mon, 29 Jul 2024 04:04:56 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6E6541201BC for ; Mon, 29 Jul 2024 08:04:56 +0000 (UTC) X-FDA: 82392054192.27.7AE75C5 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) by imf29.hostedemail.com (Postfix) with ESMTP id 8864B120006 for ; Mon, 29 Jul 2024 08:04:54 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XuYwTP3X; spf=pass (imf29.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.173 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722240268; a=rsa-sha256; cv=none; b=hABWkyD2R/0NBxTYrIVWg9xn3RwbG1aE0szlyZuDPMJEt/NZhNZaWusSaxhA5yz0KCniT9 asGpWgxvC6uqoI2Js0FjCAgd5NjxzxH7CNRGpDMmrVO3kXrKJudkJWl9cs1fK53X6IMf/u Kd2JEOcSTaUDX1HzN8jNmYyZa81N4kA= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XuYwTP3X; spf=pass (imf29.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.173 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722240268; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=3tVz4BFyaI14oqW+O7DXBLdBOOgI2JMFxMa2wntnSZM=; b=OpIppXtKl9aSt4UMtsILEqDcA+IiTSZ0YfaSWGY0P4lk1Zdp0oPxqqOvy6Gegwj+NIdAZU 2jzZo7MdYkDlc21we/5Wo6+X29ThJ5rs+5dALlfyfLJa9RTNnfFwf1sfWOTNuwR+rmAJuR uADH4ldlv0OOdFEU4kDRDyqK/9OLFaw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1722240291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3tVz4BFyaI14oqW+O7DXBLdBOOgI2JMFxMa2wntnSZM=; b=XuYwTP3X/SdP2Q5XXdxn7aPntDKX/BhQluIrnSkfQRQ72tJ8IX64oNuDEQugRL6jf/tR2W W+K9s8o61kk6zSlEAHvcMho+gxw7tcwL7PKkp9iHadUlW3nBYikwOLiScxJbvI4XHcClcm AXLpJFaWFZ2Gn12NSyruZD9wYuujtfE= From: Hao Ge To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hao Ge Subject: [PATCH] mm/cma: Change the addition of totalcma_pages in the cma_init_reserved_mem Date: Mon, 29 Jul 2024 16:04:31 +0800 Message-Id: <20240729080431.70916-1-hao.ge@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 5giqit83xybq5gqxeo8uhufuasibptxz X-Rspamd-Queue-Id: 8864B120006 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722240294-881619 X-HE-Meta: U2FsdGVkX198dnBk8AzIrQsoSOi3Eyiytwgd23FZ6/cpTDcnhny7mzGL2hZ9Zh6NThQvE9P/LxHKI5QhdkC4ncwMnBP8S+wO/u0qbafJLxoZU6/zIMHAqBUb39Nt6XGWun5ONKAujGgBdBMN/re9pLwRd9Lv1A0xl40xV0Mb6tybzLaj6eJGAdJhA3gePlEA6+pYiRd3C/lJ9bdpfhzeGhPSt8zwuXiVJlp5iXqlMQeXSmdNEPeJof7K/XsdtllFFSnHirz9LqPwbAheZZYY5cwER7q01ahvbEmwqrQptNtydazD3Hj0BJiS3xb8Nl82+M13UYMiQqQjD+uzMXy0+aGb2pIHQLcl7ey407OI5guAavZIr1rnebzJou99ElVYBBtt5tBEQmtcNsyagaMfUWeoUp8vw9pQHw4Ey64o53sj1tyZzhdBjWFdbbp7X4wKu5JCV7PAUzvyJbGprKDD4MH73D/4Zj4UtowOEqZn4W9KdkevHvqzHp0OfgVrifyVWqhjI3QwhJPmB7qt2RKgCqDHUGPiR4LmUcjSVsB7yIT1B0TvnkFmw45irRX5SQkof1rHb+1uRABuLT09OHND7xqgWYSM55MhuLSp5x8c2WHl0G17r3fOTLzJwL7Run8YzZ/XpZBPfCK0d7JVuEJ1qvCmlVPhLENAukQdoTwzaUSWG4ZaKLYKt0bM9cOX5kLcibBnVp/PdBZbp1+SvGqV4L91hRgTjpg+/zlOEDPlTuF9J52LINjR/P80EtmtyWaqlVCAOn699nQe3kdDag0gvNugeiLiaQMVr2Jj2QxC7Q+YlfeqdWWjgp78shOII/FUAYrxjtXQsr9/EPCQATB8+573a7TcoBpKw4Q24LkGT2c4XUl46QBi01PWr+g6Jf4TAigSzDe6uLe89JwZlRC+WkPf4vBI4tHqhENz4S5EitqfmHhFdKdyvbLloJiiU8Gqpapa2tu6Q0ASgqDCNK9 nu1KNOFj qALb8SN41nCb24NnUvolUxUupB0OjbmjxrLBDjsgtU9r0yG1iVn6ri7mb7WTP33Q5tNyhtH2vngwx0u5LtfxsJR5AvjIsfniGNvzyVme2/FKmO06mBbFqJBgxiprM6HDm01cqcxmElzSVtyW2LcfluyyGKg== 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: List-Subscribe: List-Unsubscribe: From: Hao Ge Replace the unnecessary division calculation with cma->count when update the value of totalcma_pages. Signed-off-by: Hao Ge Reviewed-by: David Hildenbrand --- mm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 3e9724716bad..95d6950e177b 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -202,7 +202,7 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, cma->order_per_bit = order_per_bit; *res_cma = cma; cma_area_count++; - totalcma_pages += (size / PAGE_SIZE); + totalcma_pages += cma->count; return 0; }