linux-next: manual merge of the vhost tree with the origin tree

From: Mark Brown

Date: Thu Dec 03 2026 - 13:13:28 EST


Hi all,

Today's linux-next merge of the vhost tree got a conflict in:

drivers/vhost/vhost.c

between commit:

0af298e62e5cf ("treewide: refresh kmalloc_obj() conversions")

from the origin tree and commit:

d0795719d43ea ("vhost: account the per-device kernel allocations to memcg")

from the vhost tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/vhost/vhost.c
index 241a2e2a6e248,662db163d4a95..0000000000000
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@@ -526,10 -526,14 +526,14 @@@ static long vhost_dev_alloc_iovecs(stru

for (i = 0; i < dev->nvqs; ++i) {
vq = dev->vqs[i];
- vq->indirect = kmalloc_objs(*vq->indirect, UIO_MAXIOV);
- vq->log = kmalloc_objs(*vq->log, dev->iov_limit);
- vq->heads = kmalloc_objs(*vq->heads, dev->iov_limit);
- vq->nheads = kmalloc_objs(*vq->nheads, dev->iov_limit);
+ vq->indirect = kmalloc_objs(*vq->indirect, UIO_MAXIOV,
+ GFP_KERNEL_ACCOUNT);
+ vq->log = kmalloc_objs(*vq->log, dev->iov_limit,
+ GFP_KERNEL_ACCOUNT);
+ vq->heads = kmalloc_objs(*vq->heads, dev->iov_limit,
+ GFP_KERNEL_ACCOUNT);
+ vq->nheads = kmalloc_array(dev->iov_limit, sizeof(*vq->nheads),
+ GFP_KERNEL_ACCOUNT);
if (!vq->indirect || !vq->log || !vq->heads || !vq->nheads)
goto err_nomem;
}
@@@ -2052,7 -2056,8 +2056,8 @@@ static long vhost_set_memory(struct vho
return -E2BIG;
if (max_iotlb_entries <= 0)
return -EINVAL;
- newmem = kvzalloc_flex(*newmem, regions, mem.nregions);
+ newmem = kvzalloc_flex(*newmem, regions, mem.nregions,
+ GFP_KERNEL_ACCOUNT);
if (!newmem)
return -ENOMEM;

@@@ -3423,7 -3428,7 +3428,7 @@@ EXPORT_SYMBOL_GPL(vhost_disable_notify)
struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
{
/* Make sure all padding within the structure is initialized. */
- struct vhost_msg_node *node = kzalloc_obj(*node);
+ struct vhost_msg_node *node = kzalloc_obj(*node, GFP_KERNEL_ACCOUNT);
if (!node)
return NULL;

Attachment: signature.asc
Description: PGP signature