From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 8AE962356BA for ; Fri, 19 Dec 2025 14:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766154441; cv=none; b=ZMCXbEqyNSw8p2atAXLHaMfuh9h8WAH6Xtro2hkzX3nBvN/9ebuHfA2yH5UjUWfg6TMKZJifS9gvn4znK41YVxNQB74MuQJNjGsLTOWYdr/yY39HkUcXoG/dSxqUuNrXGqQyfMSP08+RM3rkCTdDttE3+jSa59h1wwCCkt2CPFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766154441; c=relaxed/simple; bh=/sqSy8m6dAG2KFAaHREULNxX9c42ZcmVvyEIY4DjdlM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s+hpmetnlrdGLYkXOLFkpZaNU6R1blFVzj/k8PqBwF4db8bTRrs2AG+TJIg/L94idEe20SGw/i198Ov4rCDe8m+8A5FpwwBfQh/CDqpPy+vt4VBLSePu+l/X1FKBSkB47qi/03PgX0kecLzsI2h804NXDcAF0mVoOBVQdXqrggE= 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=O7/epju0; arc=none smtp.client-ip=209.85.219.43 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="O7/epju0" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-88a3d2f3299so21134316d6.2 for ; Fri, 19 Dec 2025 06:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1766154438; x=1766759238; 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=u5IhjDUP/NczS+J8Ok9NbT6xw9wH/Rgf3ojkCWKEhKc=; b=O7/epju0XXgawkG/pJ0u3mOH58SexC7bOZ2J7L5MlAqbRf5wBpE4Gzd93PExX/c4NL hpDqx/qCXh5Kz6JfTvfwClQk25o6nHMNUyCLWkzpziV1ISAkmevCTNcgOuFxR8bb3r1m ZVrhOP9yL43GU0e1b9UxP0d5u85VECl/Icws48FJkShGXMxEFVbZSAbjHC7/RiiTIYuO AFXY60PrdmJyY2rGQBJti0CCLHmyNlfboqZmMofVWksHHTIcqHKph8kzj58JlKJ53m7R /M8pYjae07/F5GuWxhQ9neFA6EY1uDEQwq0+BqV7OrlUss+/cWrvLWfonpmIwfzW+Q+W a/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766154438; x=1766759238; 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=u5IhjDUP/NczS+J8Ok9NbT6xw9wH/Rgf3ojkCWKEhKc=; b=I7m8ZwfxwTPvthrgTVbjBFomGzfNGvrxyVPVd5PKlMI0jTufA99iFy9dtbzWR+qRL+ bJXk0R/Y0Ca3UQEPBShP8kj3m1gxCWeeEqnKjlFwMsL55I5Cu1oyGGvxFdLiFBqbsZlZ ME5lykAk12X/2cFLtOX1NUo5vGqr0UonFNQLuL3Uy95gS7S9CQDGVyL1RjFsLtI2shc/ /Ivkt7Q/2kB4opuqTkbbUts2dceErFi1a1RXq61+l6rNBR0RV6vAAX5gZS3ixpTZjhWf mPrX7RhpzA3yavQaeRqxO5iGtI4hgLL1uDZoHMlfYrmelotUOBeajTt0W6lJ9d4+9MXp Q4Fg== X-Forwarded-Encrypted: i=1; AJvYcCWicfs8nxMpnJ1g6Y5j5oNgeXNghB4tG9IcDlA7m0r0quT2XcMWFN2EgkMqxcNjzdPAgTGSRLK5RBNjjz0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxxm3k3WIDMy3EiLUhTiTZsYwMKNhJzMD/95LUqIeEolehYVRbc Mskj9Don1k17AON9VEfvM0txgy6Yprt19NS5VObIfN9maoc6Yx2nzW2GHQqI1nY22u8= X-Gm-Gg: AY/fxX6kY753jVBCJj4VSXEUSciz0toQwBc5TnNChDpsDYaxU2uskDAlIcsB89374Xu Opz6FoRbqQcmH7XTXJLaGaXN1VJz0mevZEw7j32NsTPvQihZcUHaAjcUNQNZJPqtmeK0CvoZuTX i5eQKZ3PKtsycTuoB5E1NYt4OUispMowlAhR4nVW4he2IuqQvMxFkLHuKylNrNg7pfUDR3L/cvu kilTuFDD9WITHSblOEntFywFSRzmVOUJHrSh1K5hMCWKNtSu3Qj353NpZv0ARhuO97Fs9xs80K1 T+cLa/y61SpsZhvmMRRxrl2U+rh+s82u4USTCGOTbinW/YQHMVpNhhd2JHkNSe1fpchmDX5ksUh 0fvOPJW4CTGDQ59aubSWKoXEY77kLdY4Blv6gvw3Vwu9kDAamnBx3X6q2ZVO67bRLHhUIKI/U2N C4w1B6auoirUOBFcT65JpevqjZYHnZbeW7yUQ5uiCJt8CoOmMkczUlP3vainIsy83GlEus+g== X-Google-Smtp-Source: AGHT+IGBIKHJ5spcgh/qjVrTK4bS+iVhwL7ifjF3JY46vvR0Acnl2S82zGRYZj6g/6YfbIpf102MhQ== X-Received: by 2002:a05:6214:2c02:b0:880:4ac3:fbde with SMTP id 6a1803df08f44-88d86869862mr54299226d6.46.1766154438159; Fri, 19 Dec 2025 06:27:18 -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-8c096a8c758sm193246585a.24.2025.12.19.06.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 06:27:17 -0800 (PST) Date: Fri, 19 Dec 2025 09:26:40 -0500 From: Gregory Price To: Wei Yang 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, hannes@cmpxchg.org, ziy@nvidia.com, osalvador@suse.de, rientjes@google.com, david@redhat.com, joshua.hahnjy@gmail.com, fvdl@google.com Subject: Re: [PATCH v6] page_alloc: allow migration of smaller hugepages during contig_alloc Message-ID: References: <20251218233804.1395835-1-gourry@gourry.net> <20251219000800.tnpqzvcdyeqcwryt@master> 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: <20251219000800.tnpqzvcdyeqcwryt@master> On Fri, Dec 19, 2025 at 12:08:00AM +0000, Wei Yang wrote: > >+ > >+ page = compound_head(page); > >+ order = compound_order(page); > > The order is get from head page. > > >+ if ((order >= MAX_FOLIO_ORDER) || > >+ (nr_pages <= (1 << order))) > >+ return false; > >+ > >+ /* No need to check the pfns for this page */ > >+ i += (1 << order) - 1; > > So this advance should based on "head page" instead of original page, right? > hm, I think the thought here was that since we're moving forward from start of an aligned chunk, we'd never hit a non-head page - but this may not be true. Will think about this for a bit. ~Gregory