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.133.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 D88E664AA4 for ; Sun, 5 Jul 2026 08:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783239968; cv=none; b=BexjRvkRTZEhwae/nsqnhELRdYCAXTeOy19Q0MCbQBnXslklXs7ri0HG/F+ajLa/rzBtukXyMMvofTcaDwyniKjNI5cRCWdNLNjWeXgIa89UOBpCJMHjmHTU3Vk+zeULqcw5OS4lXm+KvpyqCJWnu9CmJUiCbU3K++s4nzl9z4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783239968; c=relaxed/simple; bh=7U9R/BgGzycEyFVA/zLCcA9BsS+PXBMQtdKxjzYfIeo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ge9yqQdWJfNZ7hsOjGyOroYG/9xnKISKgPbjPSdHJi83QH+QGGg80XV9CZae98dyBEl1tTbnbTE3qZDkzsYKEkwlVXNE5AKyDPNJsNMstYYhRjuS1bqnK+6iKgAclf4C/j8GtmQCk+UcwNKfVjLO2zQT9AcT8+QWu3jvauQkBb4= 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=A29Co1Js; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Jy/6RCZd; arc=none smtp.client-ip=170.10.133.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="A29Co1Js"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Jy/6RCZd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783239965; 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=8QARhhZ6+Yy8zGrmYtr8GGmZltZ9TCRLEJ8tCyAg6hw=; b=A29Co1JsXzockG7pkELMvg2Acr2z2G8u1E0qElhTCJ+Mon9t7QOYqL63qENlNk55d3Oiz5 2SaA5nsrpWpNBanbKehPZ6K9g4ElIfczfNZjNclZnSLiF9Wap4KXgecNfNSnrMeuEwxQuV RCIQxHmIFimvgaQxGl0XmsOpCy2ARvg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-266-OUitTkXfNx-g4_n8jkmOyQ-1; Sun, 05 Jul 2026 04:25:59 -0400 X-MC-Unique: OUitTkXfNx-g4_n8jkmOyQ-1 X-Mimecast-MFC-AGG-ID: OUitTkXfNx-g4_n8jkmOyQ_1783239958 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-493a6fe9ebdso9029935e9.0 for ; Sun, 05 Jul 2026 01:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783239958; x=1783844758; 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=8QARhhZ6+Yy8zGrmYtr8GGmZltZ9TCRLEJ8tCyAg6hw=; b=Jy/6RCZd8Qc3BZaTt8xzxFDfzXsl1jByORqm6OhmTseCkMrYAHdIe4ixByQDIDHpnu rOU7w+7cIzDO3VxlwZq3xpxo/eb1wMYe0GvOV6mdz8TCtweVFXtTn+Z79EjpKeXlZZ98 oUxrSUDs7oqJojX4jDPp0PbdpvJX74rGnZVrb/WSSfORi05V1bcLd01phDG0r37FddRp SncnGTWVm3M2JEvmUJef/a+M/1eIhF3LOke5fgHMPLQVlIDtIORe6aRDIpU0Hpnygf3z DdWhbfwy57BA0jlxuoo4LNY9T3KOCcbuQsKyYdugcAxpoeNjxJP9bm112jdZiswDArf8 WAkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783239958; x=1783844758; 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=8QARhhZ6+Yy8zGrmYtr8GGmZltZ9TCRLEJ8tCyAg6hw=; b=neppkXEMdY/hoRaFaSe5IN8m4VXRovVWDB4rcj+7Dkh1e/a42ctk9tHGCBtj1VZ3al q4GZyK3VAX8fPd9/f3/ZdoATin9h62H6V6YM+7CDKlOJmBm3nuNOvMEwS1sXv0RDDxFX 0JNUWL85iGt+RNnCPn7rM7cv08joIsXtxS9MbUjI2wB7b4CwE404E3FAUeI8ckEZ4QTh fYnKJRZGLZ+hhIi3duPKBzygOr37dytpQB6hcEk+0ifSf8nL1e0n9DxtRd+itT5x8L6p R8193PaccL1ETI34Otd6aJm8WkC+ScBlXYM2xWrB0oRWxyyBEAhmY9hy6b2XiZexXQ+T UHFA== X-Gm-Message-State: AOJu0YyKYs8ztK/kzP6/jVXa7FqLV3BgzhM3Ibr35LwzqPRRaHWBzcH9 aXBbIOI3UCL56S8lRjj6mDtd7rnioGzU+/LFTX9u1LqDaAQrdxLjrEIvmLVKMINL2pwZiEPVc41 +zCGyDyHIHCCuVj4pSotRMOUa6OoIXhuPL//4xdxbJGwUZnBhNiPC74sNP8dU2zi//Q== X-Gm-Gg: AfdE7ckKzlK4SkSIt4Kp7/1Qs0Zx1JpQUAwo9G59SM5lZT0Mot7iMsMSBMIblQSb0ef eL6sPoFDL+CHI5SD/FUjnxaSkoL5PRzTs9ZNPawGv7z/9RKif8ssg3uq+W4W1bJtDYnEuKFRGvG +rG3QdLKT27EP/6m0BKgJOq1YTmMFgI5c/94DsxV3OqZaDaDr4DlhE93WsO4Ma12MzwjOzGVUFt dj+vw5DI9skMGuMFxkaQZQm6yc29u/FflSYbKAB9JYJLvCeY+U2cWcvZV1U4YHH1YN9SPHFESye Ct8wgYgS8Denh/Ck6zDR6aIyXBuirLx08N0gzLk9W9rqp3v3lv2YDTUMLMkoMUFeLFuobYTLPWq wKwR0XfhpddUcJKgTHN2Doia3rv2YSNzz X-Received: by 2002:a05:600c:4687:b0:493:bd2f:c5dd with SMTP id 5b1f17b1804b1-493d11f3769mr69488655e9.21.1783239958231; Sun, 05 Jul 2026 01:25:58 -0700 (PDT) X-Received: by 2002:a05:600c:4687:b0:493:bd2f:c5dd with SMTP id 5b1f17b1804b1-493d11f3769mr69488415e9.21.1783239957721; Sun, 05 Jul 2026 01:25:57 -0700 (PDT) Received: from redhat.com (IGLD-80-230-68-31.inter.net.il. [80.230.68.31]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960816sm13749921f8f.29.2026.07.05.01.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 01:25:57 -0700 (PDT) Date: Sun, 5 Jul 2026 04:25:53 -0400 From: "Michael S. Tsirkin" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, "David Hildenbrand (Arm)" , Gregory Price , Zi Yan , Pankaj Gupta , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Alexander Duyck , virtualization@lists.linux.dev, linux-mm@kvack.org Subject: Re: [PATCH v3] mm: page_reporting: allow driver to set batch capacity Message-ID: <20260705042313-mutt-send-email-mst@kernel.org> References: <444c24cf39f3f3620fc90ef4695bd6b0979f4c4b.1783232420.git.mst@redhat.com> <20260705011635.9974cac7f0defec9961e85c4@linux-foundation.org> 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: <20260705011635.9974cac7f0defec9961e85c4@linux-foundation.org> On Sun, Jul 05, 2026 at 01:16:35AM -0700, Andrew Morton wrote: > On Sun, 5 Jul 2026 02:25:13 -0400 "Michael S. Tsirkin" wrote: > > > At the moment, if a virtio balloon device has a page reporting vq but > > its size is < PAGE_REPORTING_CAPACITY (32), the balloon driver fails > > probe. > > > > But, there's no way for host to know this value, so it can easily > > create a smaller vq and suddenly adding the reporting capability > > to the device makes all of the driver fail. Not pretty. > > > > Add a capacity field to page_reporting_dev_info so drivers can > > control the maximum number of pages per report batch. > > > > In virtio-balloon, set the capacity to the reporting virtqueue size, > > letting page_reporting adapt to whatever the device provides. > > > > Capacity need not be a power of two. Code previously called out > > division by PAGE_REPORTING_CAPACITY as cheap since it was a power > > of 2, but no performance difference was observed with non-power-of-2 > > values. > > > > If capacity is 0 or exceeds PAGE_REPORTING_CAPACITY, it defaults > > to PAGE_REPORTING_CAPACITY. The 0 check and the clamping is done in > > page_reporting_register(), before the reporting work is scheduled, > > so we never get division by 0. > > Thanks. What's the priority here? Should we fix 7.2? Earlier? If possible, I'd like it in 7.2, have a setup like this (small queue is useful for perf testing). It's very early in the cycle and the code seems straight forward... I judge the chances of breaking anything is tiny because it just failed probe previously. > It seems that Sashiko has found a pre-existing issue, a hard-to-hit > error path thing: > > https://sashiko.dev/#/patchset/444c24cf39f3f3620fc90ef4695bd6b0979f4c4b.1783232420.git.mst@redhat.com > will look into this, thanks!