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 BBFCD3FBEC2 for ; Wed, 8 Jul 2026 10:29:12 +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=1783506558; cv=none; b=qVB5tAVGJ0bFExT8h5649mxrW0HsytL3006TVwZKUHOdvpKaHZ9Xf3A+YxlMPJiDmMZQ1mqV/FEf6DCthXAnFncvyhoBKKPbhNeE0D1nntim/WwpzITM8f2ERB4p6Phl7UW4XRoI6mLMY6EAnqdhXMi4o4GgiBhxKGPrdCQH2uA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783506558; c=relaxed/simple; bh=5P3Ch4NcxEeqmveBzaLX+zkEGpQ11ii8Z8OoJFfzhLA=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=qE4DO1sFqYJJrDmXnoz4KjGauql6onV6x7Dl66UURoSGtnb0G6+Kh1/e9n/bNDmlDCBgtVsseNzU4YAojt10nzrzCgONFkOdqI0wrhaXqjXgerghUBMVer80BH2OQP7KOc7GHTNRxdXQcbk7AG27foMzPp/e7lQjqQJHKcs2beA= 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=Od7xGImP; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=SEjAzWqw; 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="Od7xGImP"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="SEjAzWqw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783506551; 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: content-transfer-encoding:content-transfer-encoding; bh=VKbeenKshINiNwrwcYYrN7tTsXlZGXZFYsepVeLpk40=; b=Od7xGImP9RfwY2PaeDOnH5/7Omf9fn9Lo8nZCMzf6t3X6i6ncZyxY2wRKF8sCzoFtXD+up LOxIq/v2x8dE1OFMtxVlWRNFbufUcKBLncnpuASdH0S7DiER/nKzqKDayHKlLuM3a5gX38 A3SnSHk/DV2OQqXvM4J3q0/QwH5Vc7M= 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-296-C_V_IVGsMs255VhfdEnZLw-1; Wed, 08 Jul 2026 06:29:08 -0400 X-MC-Unique: C_V_IVGsMs255VhfdEnZLw-1 X-Mimecast-MFC-AGG-ID: C_V_IVGsMs255VhfdEnZLw_1783506548 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-493bf840a69so4278295e9.3 for ; Wed, 08 Jul 2026 03:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1783506547; x=1784111347; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:content-type:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VKbeenKshINiNwrwcYYrN7tTsXlZGXZFYsepVeLpk40=; b=SEjAzWqwOK8G5rxOGN2R5pLijuYMcr/c+SEWjJ28pwAlI47Etd+lnCT2SxFZAPwgCX OOpatT43NToL3n7h3emdpEjjvLmniC+HuoNWIpzoU1SoZHdNLzmetYEM11pgmLcD0BGp pvsaIdBsJAUnHARNUqg1BOHttU2BP9lyXUBETGK3ISHXAfBEqHGl+LbmjdStPrnLnA+0 vwiHVzi67TkhtRjdOd4AAg2Am0p8oYLvwTwUWD383X91fBn9/9sDQH8GzWPJ7jKacBXx /OQosDD7WSWYH+1/+gX/qwUHRh3VN8hdWOnG1n2Fem2RdPTZHZQuWvZ30SaQYFtKcuJZ I2yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783506547; x=1784111347; h=content-transfer-encoding:mime-version:content-type:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VKbeenKshINiNwrwcYYrN7tTsXlZGXZFYsepVeLpk40=; b=FLm43Er7jKtYltxoHOnSrrgYc8rTN6z2eg2x/mSg4IFx3IrLLpRKZi4aMpiYXE8rLO cT0oyCSSZx1H+x58Jv/yt8uNv/1rPhsvQ5DoFyDEC9/j703Fg58sVgJq9Nvn2v+7cIAz 7SPp9i4COd+kpmrpSTF1WKhJG3NGJRKEZfw6LTmuGz86P118Et5amedIYhraZw8i5Ey7 cpVwwJbahdVbPIsfwTPGSlHTwAbAr+WN/+BwIxjYEmnwBJ0Kjh+9/pbrcNhTWGzEujRx B7xljZxouDRkyyd5jz9W8cahw854RkMp3c31Jd5odaOl8Bg2hldz1aJwKa/xY3E057rd +M+w== X-Forwarded-Encrypted: i=1; AHgh+Rr3lv5J9nu4XaBF2G+yhJPfgl/0HWBWIqTL9mI0Y4OT9PQLjXDv1AK38hS2aZWsdZOUgCneqzhDO8svmc4=@vger.kernel.org X-Gm-Message-State: AOJu0YzmfL6mkVrzTjepsyxXBDWWMK8DplNaUYoKrwSWBUHH94Rxx6AY FiHAhMgPkhrPmEZ0S40ui0Uv4RH+DI6r8jPAuYSy9Y1r3LZhkNr11hP/7l6ZidMQgghkMgZWup+ rSHtiW3UdNLF6KB+8YTBth/UjR9sA5AOo6BAbgop9hXH4coKdJLtuMC6mtJku6rWHig== X-Gm-Gg: AfdE7ckzIOVDEMMMf9Xs0fN9YvnFBi47PGqnqG3eTVH6fvHp3PbLT4DyPQlxtjcbE0F YtpezTcSiTUFt3PdAk1CKJyDMNowKQ3p0edTN+ZtZUPYokkQADIpLZqNdHnkKqvo16pGFFa+5+i k7Ont8GKa3+iNUVvg1K9Z0Pkf5ErU0UV5eUo4zQCrpml5mHNQGlIp74CROtKghKvdqRLo6OQNzq +SC2XuyeOrgEXfPqYHSUlzMDeTIxYgmqk++OMJ5C5vCOoDvhBt5Q30eR62xRNRTb/egY2zLp7WG pOXYOfLcXtufduTv2me8jMKfeHTyACwtoVPdGVRd4t2ODJyXEuhFbuf5PE2Bl/Dci8QWdGz/wzE 39t7p4G8PlVGTv2S40OXjDTkB/trHLvmAWGvfyVjaojk5iPo= X-Received: by 2002:a05:600c:628e:b0:492:6113:d4fc with SMTP id 5b1f17b1804b1-493e68cfbbcmr20997245e9.17.1783506547618; Wed, 08 Jul 2026 03:29:07 -0700 (PDT) X-Received: by 2002:a05:600c:628e:b0:492:6113:d4fc with SMTP id 5b1f17b1804b1-493e68cfbbcmr20996675e9.17.1783506547139; Wed, 08 Jul 2026 03:29:07 -0700 (PDT) Received: from stex1 (host-79-34-22-35.business.telecomitalia.it. [79.34.22.35]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e0ebf593sm135475255e9.0.2026.07.08.03.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2026 03:29:06 -0700 (PDT) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: Jason Wang , Stefano Garzarella , Xuan Zhuo , Eric Dumazet , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Simon Horman , Stefan Hajnoczi , "David S. Miller" , linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , kvm@vger.kernel.org, Paolo Abeni , virtualization@lists.linux.dev, Jakub Kicinski , Jason Wang Subject: [PATCH net v2 0/2] vsock/virtio: collapse receive queue under memory pressure Date: Wed, 8 Jul 2026 12:29:02 +0200 Message-ID: <20260708102904.50732-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.55.0 Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series contains a patch (the first one) that is part of work I'm doing to improve the tracking of memory used by AF_VSOCK sockets. The second patch is a test for our suite that highlights the issue. Since Brien reported an issue with his environment (based on Linux 6.12.y) related to the work I’m doing, I extracted this patch and tried to make it as easy as possible to backport. Brien tested it by backporting it to 6.12.y, which now contains the backport of the 059b7dbd20a6 ("vsock/virtio: fix potential unbounded skb queue"). This patch primarily fixes STREAM sockets, but also partially fixes SEQPACKET (with the exception of EOMs, which are kept in separate skbs to avoid overcomplicating the code). The rest of the work, I feel, is more net-next material and still needs some work to be completed. Changelog --------- v2: - defined MAX_COLLAPSE_LEN macro instead of using a variable [Paolo] - added a threshold to avoid walking all the queue while collapsing [Paolo] - collapsed the queue before calling virtio_transport_inc_rx_pkt(). While working on the threshold, I figured out that the check I was introducing can also be used to proactively trigger the collapse, so I moved the call to virtio_transport_collapse_rx_queue() before acquiring the rx_lock to have also a better diff to simplify backports - improved code readability (removed `out` label, `keep` initialization, etc.) [Paolo + other small stuff] - Brien kindly retested this version as well (thank you so much) v1: https://lore.kernel.org/netdev/20260626134823.206676-1-sgarzare@redhat.com/ Thanks, Stefano Stefano Garzarella (2): vsock/virtio: collapse receive queue under memory pressure vsock/test: add test for small packets under pressure net/vmw_vsock/virtio_transport_common.c | 165 +++++++++++++++++++++++- tools/testing/vsock/vsock_test.c | 87 +++++++++++++ 2 files changed, 251 insertions(+), 1 deletion(-) -- 2.55.0