From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23B55298CBC for ; Thu, 18 Dec 2025 23:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766101175; cv=none; b=SpFUfsNi+dvQTzNhaETJTyXXe3ykoJTTdloe1IY1b34qQM1tCqPc4W6MYRYcQqlBdy86+1ZUWwsu+dcEZH7M1hWa5p4dSO6QbYQ3a4Uh8sSXFRNoQrI6sw6EugXr+H8NuW3flYzIbAq7E1iHLSqHd+fRErxQgnjoJKh9qGhAse8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766101175; c=relaxed/simple; bh=+yOPZXvlIT/AWCKOBK/d1RWQn0A67VvX9jQAssS/E3M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZLRRJvs1J1+AAQwoZwwrZq3cRLKz+Qy6OApupzRaCKuNjdWkwLXoIAdKTZIqTDYPFHB1BKAUbzcTSPc81kMbgM/FEnNvm59NY4Y5e7YRI8Sd11uJjM38sv/nhM9nNXf8BG3w1+ms+bXYVtKZAzPgZnJ4pAITEGPHknxsXxyDnQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=OMkoO9FH; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="OMkoO9FH" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-8888a1c50e8so14180126d6.0 for ; Thu, 18 Dec 2025 15:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1766101171; x=1766705971; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vfMBm1bDNbFAwm3WT8c4tlLLumNOPMrsPhFihcCUs8I=; b=OMkoO9FHDZd0WxiEqn1CTkDlfXg/No3t2pLw+N+X0RxUNY/ILx2UnKLEMyd19NJY80 rPbjMiQbMz53NaYwbTlS3RjhgBsA2XAyNkW5SnEQNovHuzx2KrN6q4RaE6UV5LEMEvJW zC4xtiIVajO9oEJikQs5x+mVFowWAJrN+RzYnmTMQjxVnnfScbCACFHtxo8TLVg4iLOb tDPXTv+Hjk4QJ4V4RCWkO1FtYUEvzfX5aG1eGGcfQb35aAgeI4N5uvUhd6PWqgoI4JHk 3iecduRIckX2yJMbUDqRv7Oaek91UmsvBNhDZeSf8kzzN6fUEQtSuUvDcIdrcnxv6UMw cWHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766101171; x=1766705971; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vfMBm1bDNbFAwm3WT8c4tlLLumNOPMrsPhFihcCUs8I=; b=NTuSdyVu+rASHEoBoI5PFmutzzjGiOp1Pl0lkjLqQSmBeeArfIxRxjFJw3S53rMG5c 1loowA1OftrbqJQF5xQwk8SbRvRyyC1ZzeKTSZG1tEZeWWhw79oWTOSAwqfRphgmWJ/w XsgDdSeZDBR/k5n77CTngIjFgQG8gIDDnWqYdBlAtIWwsJ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ba0d:69a0 with SMTP id d75a77b69052e-4f4abccef51mr15467371cf.15.1766101170942; Thu, 18 Dec 2025 15:39:30 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c0970f5fcdsm52571485a.29.2025.12.18.15.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Dec 2025 15:39:28 -0800 (PST) Date: Thu, 18 Dec 2025 18:38:50 -0500 From: Gregory Price To: Johannes Weiner Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, akpm@linux-foundation.org, vbabka@suse.cz, surenb@google.com, mhocko@suse.com, jackmanb@google.com, ziy@nvidia.com, richard.weiyang@gmail.com, osalvador@suse.de, rientjes@google.com, david@redhat.com, joshua.hahnjy@gmail.com, fvdl@google.com Subject: Re: [PATCH v5] page_alloc: allow migration of smaller hugepages during contig_alloc Message-ID: References: <20251218190832.1319797-1-gourry@gourry.net> 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 Content-Disposition: inline In-Reply-To: On Thu, Dec 18, 2025 at 02:35:19PM -0500, Johannes Weiner wrote: > On Thu, Dec 18, 2025 at 02:08:31PM -0500, Gregory Price wrote: > > + page = compound_head(page); > > + order = compound_order(page); > > + if ((order >= MAX_FOLIO_ORDER) || > > + (nr_pages <= (1 << order))) > > + return false; > > If you keep searching past it, you can step over the whole page to > speed things up a bit: > > i += (1 << order) - 1; ack, good catch, added to v6 ~Gregory