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 462A23A9625 for ; Thu, 7 May 2026 22:23:47 +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=1778192632; cv=none; b=XWdfDzcqBLYqLSehjNxJa4abNIfD5tj9S/5LbW8dqDz0Cfu+pFXGXiw6Q3QXZZ88WZOxUAZB6Au/dkTVh75Ac6ZurGxM/PnNedgcHkqswMlbyropSUpCa7QdCtHmwV9IKb1DgIR3wRSjR+QyR4wuw1QBDVPIjn3iaYmpj7ZhQUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778192632; c=relaxed/simple; bh=mQqx6N7f4HKujpbDEae/MRGG23U+Ado82zzAxmBrUmI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iZ97llygY6Qw98Vo03tbgZtKo86GsR4KzJczXSw3AoHtnauzkB1uLC++m5bUsMZz5Xi+Q1XV9sLXwbRdyFro39YSwlcudWQO51QOHcVL/xolDH0gwljSqctqfNct4q69kX1HgrFHfMl+sIOruEgcys4AzCKB2dY3Suj2F668kws= 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=ikEesiH4; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=IIg4ENo1; 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="ikEesiH4"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="IIg4ENo1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778192625; 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=MpBn8Jg+yemSfT/rKcYB8AJ8VmedmgkSc9fIviOsi3s=; b=ikEesiH4aJ/nIOpNNaMGgO8oRGbgVzSiAeCLMh5tXxVlfJGPGksEWeFRuCBbIkawl5prIq NBX2ofqdqbfCAlTYPqwj1FGzY5wTqG+pht07DtBlisDSSCZx/6C4E9wRLi5rpvONtJaKUB H1cFSjQ+QtYwGUBaL3zskz/Ti7sE1Ag= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-5UA7EUNUNB-4_ftyXDy0Tg-1; Thu, 07 May 2026 18:23:44 -0400 X-MC-Unique: 5UA7EUNUNB-4_ftyXDy0Tg-1 X-Mimecast-MFC-AGG-ID: 5UA7EUNUNB-4_ftyXDy0Tg_1778192623 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-43d789cebcfso1679853f8f.1 for ; Thu, 07 May 2026 15:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778192623; x=1778797423; 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=MpBn8Jg+yemSfT/rKcYB8AJ8VmedmgkSc9fIviOsi3s=; b=IIg4ENo1FSvvS8jpFolifWd8thcHGhV5q+ZpjTHdhCCjAfkHFpmQyI9UDgd572nT++ NOL666pXt435sfNsAhfwGmLFJBFZK5Chl88zh0TYpbh+aD2MOKH6PQy3EWwr4H+BdNnC 1xynTQSj8P7cCMZ542CyVDrp+I6uiEm2BfUqcxccIK4WgUseLWP8Pc+OcxzMY2ZIUI3b Hh2kY3sMhFdTbhzqH/NSHuEdZ3o9xNgiHNbnsBoFkEOAPWTxXOQWjdmVQZYiGfGEkTw7 GJJu61xSHwDuQpGZEfHtJlng/zKs8bGIwu+aKALLsAKrBFBP0bgSvGxW3CI8Jb9PsQxz lStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192623; x=1778797423; 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=MpBn8Jg+yemSfT/rKcYB8AJ8VmedmgkSc9fIviOsi3s=; b=HYqV8U34mIDRhGik0DAJb0Oe/+CpdLUkP8SXmPVstePpnwduMevQ5Ig8DOnIfCNpAW MCPeUsA9P8KC3M18K12hDrqbXd17dkzh53wFir/ib8fDarbgy7a7aNkpYvCRlM66g6// /1mpFa6TLLk00IBttsVQpOSiQoJHKvUZzWiyAjDxDCRBQG43YvLvDTOB2IdUfZ7SE624 /2v5Kip+1KvWwu06JG0NoUsuyL5yOL+h+5awijbc1qM4Tce5Jk81TGdEHNY+W85z7kud JWzKWCgeoeTAbUlHK9PoqXcLYbtiaMcMfW34CVtS8gKnGUHAVgrYRGijLJuoCI01rxe4 Y/Fw== X-Gm-Message-State: AOJu0Yw/3axxPJPcrJVZ8ltvaN1KeRijPPCXmssPat9ZBqYUYGqTD9/F fri/rTAOjqdHLsAmQI3xagUD5axCmDM66MK9wDxP+HhJUgASgQc6w6Y2yCm73xbOrERa9SwKqHl dcU5zA//BDdBWYnh3nRWttgcoaBMBp6EJvkDpCMnDxEUzh4x70YVCV+MjkzELHnf2gg/2hW3eHq TUmTM1snEKBJV1oKyBK0cMY4o4aaAeNFEHaEyXzgEuEgU= X-Gm-Gg: AeBDiesZDVqXQLOT4wvbF4evFhHL+RXNixV/nDUGtqaIpOuWKSi6anOlaKu3IccGg3y oipukn9+qFoRQTxYLzefm4qN3CxKZOZ5oQyl1rAp7gO38zhjdhVjNKhCYSvn3lL9mFQ3JEpUJA1 9cYssFCHERkIHzF4n3qrVid0O/O/MebEyuEC1PcnI92R1rs/A8EU/gk9C3CWAEEkY5hbRQSp9Ho CG1DplbaPv93YIPagkHp1HqYzqrV6/HGLRCoANygKkRxRVleFiZtwpez5ghdDTEWHvIA63sWOxw KK75thK0rplWEKQWANpNuKIXNLS4EHURr7zBxeu3Xh2EJnT/ZtQ33DuR8pSNi1sEGlhmH8e6g52 ywxNfX0mNkSCytwhpy3h/y6RcYGcXZv23Yxs7QyNP X-Received: by 2002:a05:600c:a10a:b0:48d:50a:6ef4 with SMTP id 5b1f17b1804b1-48e5dffab24mr53046545e9.11.1778192622634; Thu, 07 May 2026 15:23:42 -0700 (PDT) X-Received: by 2002:a05:600c:a10a:b0:48d:50a:6ef4 with SMTP id 5b1f17b1804b1-48e5dffab24mr53046285e9.11.1778192622056; Thu, 07 May 2026 15:23:42 -0700 (PDT) Received: from redhat.com (IGLD-80-230-48-7.inter.net.il. [80.230.48.7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e538a517bsm166228835e9.4.2026.05.07.15.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:23:41 -0700 (PDT) Date: Thu, 7 May 2026 18:23:40 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Andrew Morton , David Hildenbrand , linux-mm@kvack.org, virtualization@lists.linux.dev Subject: [PATCH v5 26/28] mm: balloon: use put_page_zeroed for zeroed balloon pages Message-ID: References: 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: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent When a balloon page marked PageZeroed is freed during migration, use put_page_zeroed() to propagate the zeroed hint to the buddy allocator. Previously the hint was silently lost via plain put_page(). Signed-off-by: Michael S. Tsirkin Assisted-by: Claude:claude-opus-4-6 --- mm/balloon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/balloon.c b/mm/balloon.c index 96a8f1e20bc6..1bf7eb2642a9 100644 --- a/mm/balloon.c +++ b/mm/balloon.c @@ -324,7 +324,12 @@ static int balloon_page_migrate(struct page *newpage, struct page *page, balloon_page_finalize(page); spin_unlock_irqrestore(&balloon_pages_lock, flags); - put_page(page); + if (PageZeroed(page)) { + __ClearPageZeroed(page); + put_page_zeroed(page); + } else { + put_page(page); + } return 0; } -- MST