Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp105274lqj; Thu, 11 Apr 2024 11:05:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuZh8l47YPURWRXiyTKuMCb0J9YYPYdTtOVD1usOls9/5LSAuO1QyF9pCHsd8w+BslIDa24juaKclZYpeE5wiV5BRQpG7phps2/pNBPQ== X-Google-Smtp-Source: AGHT+IGcAIus/8D6/7khMQawEL3YIM+2Y+bY2MEstf1rrWaI++M1TE7Pf6Axf9la5OVnvxMowmhm X-Received: by 2002:a17:902:e948:b0:1e5:5cab:3186 with SMTP id b8-20020a170902e94800b001e55cab3186mr279594pll.12.1712858705540; Thu, 11 Apr 2024 11:05:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712858705; cv=pass; d=google.com; s=arc-20160816; b=dqndSfZ3t0GG2FPdBx6yYcipKs5uveZfzX5wGJgtqZFZE51TAQUiWn97EXhQLM0D2b hVLcsbHbJ3Nf2ljN4SsShQLljZWbkB455tvUZ5KtMWKEw4now11g+jJD+AT/nU7qhZct TCY5qGnBRU3Et6N4+8nq0Zqpf3uXvALBDGoUzeUqkzhfrJ83D+Wcsuks0MYdfTANaR6b lgocuBVfpHmJEN66CwSu4yMJbCbnlDRDj6BLUEcfBK1ObjQ43GwW+sqxJy4T7Sysz/41 l7Gf+KGAYlQntDoUogXMDOhpGcFeSYDVBmIEwetB4LOfznbFRvia7i7YOrxIIwSTB20R 01Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date; bh=MibdMJWbAGkXU+bJBEHPDcusRTLoUkXBmxnDnt1+roE=; fh=c9zZ7QT/8tVJocxdBvsRpKKg0ug2kKuwj+qa8DnkZEE=; b=urDZuGCq0IMYCwrxt9Zjf2LamEsPzouwugH33OkqhWnsXAWIJQQkbON2q61T9qiNK4 aQXUbKb3LsojmrerDX/ncYKOlETXzh6dlug7xvsjlNNkVfLeObIP276ACPPOVcAgP7a7 dVBCFOmjt1vlXpt2eSyvA+ZrvdwvjyijfnG8umeQWVvr5fw4aW2p6eA8JunIcQNIa5XV HLdzFbMcuWlEko3EeOSSpPmiNh/EDvh08xkO0+LCBfcRF1pkzsjtyyAHGHe5ibpJjLrq zC16bhPkPIw21RbN8oM3YuCsg5vyxZVgJyRVlTNwCzBy8VQFdy+9YKsYX5P33f2gG1AJ 9F4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-141355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mb8-20020a170903098800b001e3e6ec10e3si1650120plb.481.2024.04.11.11.05.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:05:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-141355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC4C228534A for ; Thu, 11 Apr 2024 18:05:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 424471CB32F; Thu, 11 Apr 2024 16:51:23 +0000 (UTC) Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7D771CB31E for ; Thu, 11 Apr 2024 16:51:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712854282; cv=none; b=KjtRqwHWGbGfDkc1ii/nYj+hnl4h8DA4ziExTddNUnkVSlXQYLKf27MoY3Idj5TpOP1EC+mn7LhNWA+EjLV+jBjmXLVsSe9nSY5gM0LzVUTwUzYs9NnAS7YHt2hZaGCUyG3eE54Q7G1HFn6CX0SmjglnFmOk2TIPAf8O73BOyYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712854282; c=relaxed/simple; bh=Os98TDCvVSWZkblSP4h3+hUapsolTLDw4CY/UVEaWYg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=d4dZbpFZlifIGdPw9PfgLrZTcQfFQPjFNM93Pi5mGnwR5w6wDplxTguhoXTyC/GwwfBkIOUmA/5dscnEsZYBD6eCRHXN9+vUZFBCVUUiQsFPYtBwUwnU5/y/+pbyEZ/HwhcVLk2MfuOm9qE+hcvtg5Uq14m0+Twn4r8lg4Y/+yk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=fail smtp.mailfrom=linux.com; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=linux.com Received: by gentwo.org (Postfix, from userid 1003) id DF1AF40AFA; Thu, 11 Apr 2024 09:51:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id DE85240A90; Thu, 11 Apr 2024 09:51:13 -0700 (PDT) Date: Thu, 11 Apr 2024 09:51:13 -0700 (PDT) From: "Christoph Lameter (Ampere)" To: Haifeng Xu cc: vbabka@suse.cz, 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 In-Reply-To: <20240411091832.608280-1-haifeng.xu@shopee.com> Message-ID: <5482360c-0a0b-e5f5-b88e-4a6ec4d43f7d@linux.com> References: <20240411091832.608280-1-haifeng.xu@shopee.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed 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().