From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 4A80C3D16FD for ; Tue, 21 Apr 2026 13:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776776603; cv=none; b=HifxS7SGwy+12p/7UltWQg1lrXjuKqOxUz34oxBsxfx+25ti/Xazt0KP9H6ivrW+3HXGa7mrVw119HL0EsWL+XmMLZWnlAOr0phBuJYtjOCnZTdojqcBchAdVV4csVYKyx7T8c9GjtlNzHJ6gfoBcg6AxQVZRJps6xcPshiS+YM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776776603; c=relaxed/simple; bh=A9z3EUE6nKMyvYqIonXmWDAZV+Q7qvCA03jrurpJIyI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kAYijfYIMa0CG40kqtmG5Ei8AvQ9Sj+RT5aHHKdhuld3CMMTeKc7XUDolZsfFESQOL3jUcgdunpqOLC0fu1rxS3WkG+1gZI/3tNxChwsQzbNtLMxA/s23WBtGolgDBlqst7g9pZzgfxekdeiypqDLlCntD3fgxjF6KyaafPf280= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cbObPZEH; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=mdVar3Tn; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cbObPZEH"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="mdVar3Tn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776776601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sVf8kdVYwRFUCCaA8aQHSDPXaxh6wDEbfv1fdU/ML/U=; b=cbObPZEHOJyDEYybnSvujQc6G/hxV5uxFOICGszbBFAHfMIX6wQln3j2OEUHa2CXhjgiaL Nj3irE+0f3OLeAr16HKZoizxre2OcgGmorAoS9FXLWgEw+X7PO5dw4HQBff45UWuGVu1ws b5GlXR+9MI3efsEzFa0SzbUObFNzpJ8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-8H5wq-mjNHSwAjRMZImK7w-1; Tue, 21 Apr 2026 09:03:20 -0400 X-MC-Unique: 8H5wq-mjNHSwAjRMZImK7w-1 X-Mimecast-MFC-AGG-ID: 8H5wq-mjNHSwAjRMZImK7w_1776776599 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48a55d82e0eso4854545e9.1 for ; Tue, 21 Apr 2026 06:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776776599; x=1777381399; 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=sVf8kdVYwRFUCCaA8aQHSDPXaxh6wDEbfv1fdU/ML/U=; b=mdVar3TnAkGe/tJMkT5tJ4w87lTojtZw6yBcDcUVk0X+auTyvuK0+Y7+g+g6mcp5v1 ZCX7f0pbdzTUXcDHMLBuWt6vo/uR8wc/2EBx42Xxv90qGHiLc45YmJ1N3wxzBIEY7N3T Cf3nWx+SdDAt5GxUGFBORaenzTz9C2tplTHFwnRJxB7pRa0s66ZoQqUhv9E2e1pnz1Ky XoMUmdK6H3r9/AOJys8VbLDAb/0N4HXVWHykq77c2G8WeTNsrecos6lBWK2gKMOh2JyX Fnlq8fZoBTFSKx9TZ6HgSeqDtlS0IwZpKULESy5K10lWjSSgL6F1MOmF5ZVhcC+xw/VX l2uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776776599; x=1777381399; 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=sVf8kdVYwRFUCCaA8aQHSDPXaxh6wDEbfv1fdU/ML/U=; b=M5WQuW+TTV3BEv+aOYpRKseJ0kYS8mvSHpLPYzd7uTRF5KUwLCGci9xjVscWt68yqg ol/2N/rUkq5+NoZXZMQpYtQnCxe3dgx8GPHkTEESRJ6yU4+em71A4ANE086dW4EpP2bd n/avwCHn+51zEVzPmfYkMRc1dQ3ha7fdlWFlMSFIc0vBydAlH94HfXPk89ms0MNN7xv2 vrgKIVX/XrxIx9jiG7OGUKQrKlQDEM1LGycY9aHaODR/qg8ife1AsqljHAWtxTANSC07 Te1rYThO2kI/aI0r0zTNDra1EKai975Hvb38z3FtUUatfDhMof1fg91dhiIUYDYFAdYx bLLA== X-Gm-Message-State: AOJu0YwmGFkdTN4HQpul/hguc5KnR30ggCyOZFRrFV3QL5Jml5savpie rc2/noNlROK1Js9jFzLh/s3Aan1Mm/hM92LicQMewCSNe2oq+fIeTxC5NeoJ6qUgkacBvNPrPl2 5pepf+iB0gspNm5XoSjuP7rK8q4RhAeLfdl/7Y7bDuahtt8y0n6LLkjP0r6efqeBekQ== X-Gm-Gg: AeBDiesMBFnA/gTnqb3n+qO5S8EwUhEz0qY/SfCbUl+AQR+krhPIWGz96V3daDTiorT XfRXnG8exmBmhD8HlWRxa61QBjxWERY55Zy+gBtjabSkwBdXL4C4WOFLSh4rdvl3lEcbts2E/DB NDujpn/1l5rFwVtAuq6szJcMpq/fSWp7LlRkeKsqdB0MdsGE/Ok0cE6JDdlEzHOBhPfug3vxxZv ptfe4bBMZeWF7cn17+NKT5A9QpOUtiCZBCFO9HMXLo92Z7HFyS87CThc0wvPMIvuGyu3GkZgNCf ubZWjVORgjSjBhR/hxlgiSLPn4iO7FcZyFBHAZE8uj5ftrBEyjXCwpA9O7UcSpyoqxENTrr6T6M 0T4EDZNGu+aqgR1BGdwAKxqNw34xXFTbmoOlESwelhZ9nPtIM9I6BSA== X-Received: by 2002:a05:600c:c4a6:b0:48a:761:57fe with SMTP id 5b1f17b1804b1-48a07615be4mr102694755e9.0.1776776598653; Tue, 21 Apr 2026 06:03:18 -0700 (PDT) X-Received: by 2002:a05:600c:c4a6:b0:48a:761:57fe with SMTP id 5b1f17b1804b1-48a07615be4mr102693515e9.0.1776776597864; Tue, 21 Apr 2026 06:03:17 -0700 (PDT) Received: from redhat.com (IGLD-80-230-25-21.inter.net.il. [80.230.25.21]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7c0eacsm116411425e9.35.2026.04.21.06.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 06:03:16 -0700 (PDT) Date: Tue, 21 Apr 2026 09:03:12 -0400 From: "Michael S. Tsirkin" To: "Huang, Ying" Cc: linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Vlastimil Babka , Brendan Jackman , Michal Hocko , Suren Baghdasaryan , Jason Wang , Andrea Arcangeli , linux-mm@kvack.org, virtualization@lists.linux.dev, Johannes Weiner , Zi Yan , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Alistair Popple Subject: Re: [PATCH RFC v2 02/18] mm: add pghint_t type and vma_alloc_folio_hints API Message-ID: <20260421090238-mutt-send-email-mst@kernel.org> References: <290d615a001cf121dc0c604eb79451bcc7917baa.1776689093.git.mst@redhat.com> <87pl3ti0x8.fsf@DESKTOP-5N7EMDA> 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: <87pl3ti0x8.fsf@DESKTOP-5N7EMDA> On Tue, Apr 21, 2026 at 08:58:59AM +0800, Huang, Ying wrote: > "Michael S. Tsirkin" writes: > > > Add pghint_t, a bitwise type for communicating page allocation hints > > between the allocator and callers. Define PGHINT_ZEROED to indicate > > that the allocated page contents are known to be zero. > > > > Add _hints variants of the allocation functions that accept a > > pghint_t *hints output parameter: > > > > vma_alloc_folio_hints() -> folio_alloc_mpol_hints (internal) > > -> __alloc_frozen_pages_hints() > > > > The existing APIs are unchanged and continue to work without hints. > > For now, hints is always initialized to 0. A subsequent patch will > > set PGHINT_ZEROED when the page was pre-zeroed by the host. > > Why do we need this feature? Is there any performance impact? If so, > please provide some performance data. It's in the cover letter: Performance with THP enabled on a 2GB VM, 1 vCPU, allocating 256MB of anonymous pages: metric baseline optimized delta task-clock 191 +- 31 ms 60 +- 35 ms -68% cache-misses 1.10M +- 460K 269K +- 31K -76% instructions 4.54M +- 275K 4.10M +- 130K -10% With hugetlb surplus pages: metric baseline optimized delta task-clock 183 +- 24 ms 45 +- 23 ms -76% cache-misses 1.27M +- 544K 270K +- 16K -79% instructions 5.37M +- 254K 4.94M +- 155K -8% > [snip] > > --- > Best Regards, > Huang, Ying