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 51D5FC4345F for ; Fri, 12 Apr 2024 12:18:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B22A56B007B; Fri, 12 Apr 2024 08:18:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD2F86B0083; Fri, 12 Apr 2024 08:18:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99A586B0087; Fri, 12 Apr 2024 08:18:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7AA1A6B007B for ; Fri, 12 Apr 2024 08:18:04 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 42FD280EB2 for ; Fri, 12 Apr 2024 12:18:04 +0000 (UTC) X-FDA: 82000781688.27.DEB12A4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 318E240008 for ; Fri, 12 Apr 2024 12:18:00 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=eQ0Mzhee; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712924281; a=rsa-sha256; cv=none; b=sap2JVRP9sdJoRzj/xxn/W3W64rMUVab3h+0lleS/K+yRAtmuDpnzUVHAD0EKuOMOAJS4h PnzfK3W8FgiFedu1gy/pOUQoedqLHGKgRbWBGGI9bJDO5cVyM6rHTGn5NFDEUfvjywpNmU dgCkzSN37qETzpk7AikgDiqFgkeFmzs= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=eQ0Mzhee; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712924281; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZqXAj2wZ5R12P6C44OmA4h+tQYrqOIgYJQ2uEwiP/bU=; b=LD/HB5pEO7FLO6Oh92s0iSxdZ7z5gmEGKTP59N8w+8yCXEiB8XIBHtdSv9RKjz6D8kOxSX w7PM9n08eKVd7JHeqHWdgBWNEmrC41GaJutIA5uXIGbklJGRu/s6qsADbBT/at6QJc9kkU VXhGYqD/iFYL8eMU4KQTbGkKjucZLQc= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZqXAj2wZ5R12P6C44OmA4h+tQYrqOIgYJQ2uEwiP/bU=; b=eQ0MzheeDDB9sQAcZLhIIMqr2R l2XwhdMHgjEfH5Q27nNvzsvoNVfAQbAE/HVPgUtZLiE/SM5PPTyDueqc4le2zXC1nyNpl0BMSqRJU X9Y34ws5wcNzqaLfBiOgm8hOWk3NKqy+NDDUEbvQAKVXo9sAEfe65KtF8OPn5LSp+PfYZqp5MGa3A 1DxNqamcf9bUc7KdQ09bJl7cJtSwY/WqzT3mqP516mjfXroKaxAj0odl7U7/QxP11uSeI6rXlJG1q 5v9sLxbyz16ZUZS9O6kVBeaV2V52m22t5Rqq7zbVx9ugx3tYwHXe/58PDHi+9jvpC3WG1CHKwwher iQ1Tz1Hw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvFqq-000000097Gs-0rGV; Fri, 12 Apr 2024 12:17:52 +0000 Date: Fri, 12 Apr 2024 13:17:52 +0100 From: Matthew Wilcox To: Vlastimil Babka Cc: "Christoph Lameter (Ampere)" , Haifeng Xu , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slub: Clear __GFP_COMP flag when allocating 0 order page Message-ID: References: <20240411091832.608280-1-haifeng.xu@shopee.com> <5482360c-0a0b-e5f5-b88e-4a6ec4d43f7d@linux.com> <5d3c4a5e-0c27-4058-adf1-91e9602e5ccb@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d3c4a5e-0c27-4058-adf1-91e9602e5ccb@suse.cz> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 318E240008 X-Stat-Signature: wbfot4anp53yxbpoohdxm4ckafhebenc X-Rspam-User: X-HE-Tag: 1712924280-543139 X-HE-Meta: U2FsdGVkX18irz3mqTMAmgJkpCIRoHyF0IvObqLjysXYXkt4BrMK41gO7VYNAmZNfJXh6gQ3KfJAOw70RJlINRS4uOLnBcGrtxTMl9vSTZlDlAr66194kFwGaKfJW9YUUq+6/H1g4Br8FzQxhLRYV5jjf6rBQh/HE1d8j5ts1z9eA5bFuZBfY0SZyv1JxkJ7ifyz5FFs1g4jkbD2gZFa0diY3FP/j467hxtnGr3zLVyiXQtfk8a+4xbg6JD3NiC0vQA35C4SJMlOTZ0TQlWKJ/l7SAubxp6LHSYrfLqLLcjmw6TguLZ4HkhilUuEE8WUipyCqDwKNlud4yRvESVlZCu+RUShZb4KN3FVEQNwxmd76AQMR0K6erw7+8NjxBKzYXMF9Kel0syN8Rn1p6ltjFRdkfcOr98t0578XmeYO99ETQtAS6u+trCQ6hBW34Kg5m7WuSV9m9Y4ozTzFSK64eYdb/Noei/f30TzBxgsWI1rIkRNryCPVOBXbg8XvCfuIwbMnAlkZ12JCDQV7Rw/o0nOazyRww8fhUiZgzL9fFAYvBMq2fUx0mQQqzC1/0ZWYI4ywJey20qlQCawW5Q6pHLAZYmXKe5t96BwHVcpZoRGGFnnGHh/Fuinu0EkmY0hiK9ZRf5/9so34sE0w3VpVZq8iWnF0whiP44qyMhf0YOfewJ2Cto9kq+ESpHSWOpGEnyjNoFNNgw49FU3MBW8a3q3PjtSV3Cge7pRbSwYiM2KcrxF34v9zmdnSgXgG0cl9QzYOs22j+VlQlXCXPpu2jucx+6xHgpZtzzjGVA1rgvou7BKpjBJLT6Ex6T8Kivrg1GuVq0wfE+q1n0E5Dptr6eJ0VYOT4USdNh/ciefXOZ9VDvJXwZmmOdc944L8I7Mjs2A8sPaykg8ffnWsZ8iOQej5Cpxja0xZ3jB9BYzFX7Ld4jQOp6HVPzkmd/Z8PodMVpt0+f4re+myEj5FBj wy93YioI Syxc3X54A9hVM8Ux789qpmBGAnNcztKx5ILy/nCD5cLSeYBHYpfL8NCN9562757WJz3lhOEVh7yHcDjrffy+aW19nuQybQIvkiCccKe8e4tJU/KsUxoy9+XLpygrMyVSiy0XkOqr33sp1sAv0/aFXVi4ypto1YyIXZXDlWWY/23cOrg0344LbrwXRBd1+qheZ8ld1hDX7Z4iVfpWbe+B4rY5iPBpMpECjXHYLaJEoY++VNTaJI3BNz0NbqMubTjinRxNZ 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: On Fri, Apr 12, 2024 at 10:01:29AM +0200, Vlastimil Babka wrote: > On 4/11/24 6:51 PM, Christoph Lameter (Ampere) wrote: > > On Thu, 11 Apr 2024, Haifeng Xu wrote: > > > >> @@ -1875,6 +1875,13 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node, > >> struct slab *slab; > >> unsigned int order = oo_order(oo); > >> > >> + /* > >> + * If fallback to the minimum order allocation and the order is 0, > >> + * clear the __GFP_COMP flag. > >> + */ > >> + if (order == 0) > >> + flags = flags & ~__GFP_COMP; > > > > > > This would be better placed in allocate_slab() when the need for a > > fallback to a lower order is detected after the first call to alloc_slab_page(). > > Yeah. Although I don't really see the harm of __GFP_COMP with order-0 in the > first place, if the only issue is that the error output might be confusing. > I'd also hope we should eventually get rid of those odd non-__GFP_COMP > high-order allocations and then can remove the flag. The patch seems pointless to me. I wouldn't clear the flag. If somebody finds it confusing, that's really just their expectations being wrong. folio_alloc() sets __GFP_COMP on all allocations, whether or not they're order 0.