From mboxrd@z Thu Jan 1 00:00:00 1970 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 1DA5ACE8D68 for ; Thu, 19 Sep 2024 09:50:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AEDEF6B0099; Thu, 19 Sep 2024 05:50:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9DA76B009A; Thu, 19 Sep 2024 05:50:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98C866B009B; Thu, 19 Sep 2024 05:50:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 798E66B0099 for ; Thu, 19 Sep 2024 05:50:18 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3B3B9AB00C for ; Thu, 19 Sep 2024 09:50:18 +0000 (UTC) X-FDA: 82581017316.14.562668A Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id 0C1CD8000E for ; Thu, 19 Sep 2024 09:50:15 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726739384; 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; bh=GcArAxyyZDMXUZn25iB+12TK0nq1QmCFWPyTg9VALOc=; b=LttpGXdKWk+4Yp9j64pswk/L3TZAOXmLQt3TJzH3dffPc3b9185fnjXJ7ORfr2ETHjMECM yY8VXor2OcIwN9gtdIuEtFb7DBezizxEzEMST3sV7cTNdW4L1iNx3fOd8CAtIeNt2mZW9V IuHox0JKJKlRAg6jKtJeUg9K+t83GVI= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726739384; a=rsa-sha256; cv=none; b=C04Uqn3yvvTD1guaHeCSLoy/LIpet2r05QA9gYwDphaN3a2dAwyjIUXTWxOPPtfobdOhgc nO2kPYAL7Sfv8KT9SNUFW/5TvAdOIgLTOQj56cmevZdBaok5YmxLzia+dGDutTXUz5VbZd 2WltLLt5ZtcylQAo/Tvc7eyYhb69ikE= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92DC01007; Thu, 19 Sep 2024 02:50:44 -0700 (PDT) Received: from [10.163.34.169] (unknown [10.163.34.169]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4EB303F64C; Thu, 19 Sep 2024 02:50:12 -0700 (PDT) Message-ID: <069fea6a-3c14-49c8-b9d6-72b49616ff2e@arm.com> Date: Thu, 19 Sep 2024 15:20:09 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/page_alloc: Add some comments for specific scenarios to make it easier to understand why unmovable and reclaimable allocations can steal from moveable pageblocks by default. To: Xiang Gao , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, gaoxiang17 References: <20240918045836.10825-1-gxxa03070307@gmail.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20240918045836.10825-1-gxxa03070307@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: s9bxwkibprdk63z54s4h8hz4xhsc55ao X-Rspamd-Queue-Id: 0C1CD8000E X-Rspamd-Server: rspam11 X-HE-Tag: 1726739415-805981 X-HE-Meta: U2FsdGVkX185oCblgTZFr41Mh7Qi2xsy8caLdj92E3anQfrmZr7wYdwUICSA0yHNjdoZnXAvrUBAyiinCQRCghRLRLhWi7U2avqBnjSZfPLGuuhoysbS72nnWNnEGAGs6cja9j2CK2q0aBStakbFPcHoI3qsjcjAbzaQfxWdxgYZbkq5gd/cph+Inv49Vti6w/6VlaUskeLn+kdjgwrmAAGspHKvZp2DB8kes7mOTqb3E7N7qtP7zoL23Xkj9SOahCh6DOPcywB7EAigb+P/f53mK1Kvvrl94QRIfohhf7nSyXLWZP4BDHisfQsVYrpTMN2ZcqzVvVyqi5TxizfEx/UWYHB7lzTskDHPjAkk1n17TttXyXpLluu6zFAa/73RtGaa616ichIGWa3gH+0x1AubpRVA1reHh4FpFctwqgpokP/pbs6I01OlL8ZhZB6KaAML+WwW/KVneMd16oBk8KeW/9iWpftMAt+3TNrbbeJZZbgvohYUrT8aVkGNXVkH6bWo5EDmZIRSraYyehAW+0DNvJsfPfEosylSCGNTkUEQGHZ6XGPeo7BvmJM+Ohy34tSw+c0wfuFTbllE3th7Rr+/OYlMPnxCdqoTRT02GsHjkTGJC7MBE+0rK0RP/YiYbJ2mwiQQ6O/7D4uLS8iMAPjdpMe8tC1PdWvypLzy/UROK3YRqCqMWgOzc+9U8NMjJdlJlJqRODYXyA0/+UPG/CnKpUmNvF+M4FCjjU9HUzfEfFgPL6RDkaIAFsn9SeuJXEsp051JLh0lF/zHaDULTQVmJ89/4N5N0c7RXUeVdmym66q7U24o1j8piZxTu3YzTS9dIl56CkZapwgU8Cj1U6t1j0yPUrU/YEd6l8wzXEGuR8IghhzGMAz7r6Mzawiv1A+ZrbO93nxV4zv1rLR7zc2v7d0Mi1ksPBGpYsNmaZYbwwprSpkfx34r34+0+FCKQtyM+ysIhSyS8HSjZSP iOtCmXqR bIJQOrX7KhJgNfw6s5ng3yiyoeJoKDRfMoZtPxpqsCbk3+1+BPLfLtOb1RFgmZDRSltD/IkROT1ViG3oSiydTliraFZjIoyFcg+8jAMvGSjI2jsgt0EjGIyblVYrBPZI/uiMZ6l1Lf0HbfbDwGzPPXDCADwdm2G6cZk0vj0c8hJGTH9W55pAERFRSoaophxbTrYORQBpCbXouT0iF/YEAKjtVmnje2ptDe5NLQpQqCVFdhCqx3wXkray+xjlBBWtgNvfIodqoDuAG2uZBnVFWia6Vm5ehxCGdYpbveF+SylzMCF3nF/HSTPwE9d7HgBg3/MBs X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The subject line is too big. On 9/18/24 10:28, Xiang Gao wrote: > From: gaoxiang17 Also there is no commit message here as well. Please do follow the instructions for submitting patches as explained in the documentation below and then resend the patch. https://www.kernel.org/doc/html/v6.11/process/submitting-patches.html > > Signed-off-by: gaoxiang17 > --- > mm/page_alloc.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 91ace8ca97e2..cc8a7a0772cb 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1818,6 +1818,13 @@ static bool can_steal_fallback(unsigned int order, int start_mt) > if (order >= pageblock_order) > return true; > > + /* > + * The reasons why unmovable and reclaimable allocations can steal from > + * moveable pageblocks by default aside from the above comments, a different > + * and better understood scenario is: System initializations are all movable > + * pageblocks. If you want to alloc unmovable and reclaimable pages, > + * you have to steal from moveable pageblocks or it may fail. > + */ Although there are sufficient comments for this particular function, it does seem like this new comment tries to explain why using unmovable and reclaimable migrate types as steal fallback makes sense. But this can use some clean up and rewriting. > if (order >= pageblock_order / 2 || > start_mt == MIGRATE_RECLAIMABLE || > start_mt == MIGRATE_UNMOVABLE ||