From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796304284; b=GzJIaQX9LSGyQ/FQ+6Gu/4B0ubt2YIzyIu2DjPjZR6C3UWaTCdfGkAiGVBmKyl/n4tH3 wgayt2zGp6GSZ8D7EQjGCFBlJu6CFhBsYku/+Yl9hY0dAIPGyoyjqnSu3ZvknQVjOVw3f dkKm3yHexWr+HJlBogkz3tKuDPdTdubsVg3OWGtmyM/kFVJCyEAtG0OAXOFqBm/74GJ0X 8iufnEk5j9NPrqQGPCNkCk5D8Godd17xzyNv/CxW49aMbtY18msOG8/iwTo4oOzFuNp58 gOttT3i2J7IxusJaJTrRL6hm3iGusVJg9EORgODgtil3b+ELQp8NncsaDvmtbMlTn7A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304284; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=hSPSVLMxyngYTAnFgueVH4KaaK0foAJv0ucDIccjZjo=; b=u3VhBtziA11Kz5J81e6dZREVUy1yUXMEj+gtkMHGR2yS31//LSf7C2d2rjwhq5B34ZN8 ETGoR/bLAk1YPdkFdtz2SJKrOq7bYxOV4GVIRYVFIOeOzOKtmnW6wGRB5uYkest0qBY4M qET9IkuuJdBZjIC8jruWDKPS1RyuFxLEA1qaxl+wGfnFvhcrxRqqvVqNB8UX3Iid4GM6T 0MW1JIMLVdT1QijNcKMxa499kao98YuHiC23dGB2W1B+WxpACMBvlsPtVF+1P9bhm5xqp h1yBMuAJoGcPPXMG8Vl6w2lihlUqPVzQxn5mHLI9ZdYQ4Vb1Esk/3h6HMVFe3e5ja3A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NrMPgOFc; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79400606A322; Thu, 3 Dec 2026 13:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NrMPgOFc Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796304284; b=C09ii0bYUFsJTFt7MUKAKEfEKVDNLc5tx11C2eN6k1+m5r/pDpQamdXuswnuI4aABgzb qXxzhJ4gn5pp1fVPRN7NV8qQfxQ0dI1Bcfe4eIxacyC5CJzwM0ZDXq1/e513WlfQHVC9c a1K3mhIYK3WAYUcrtlupBR1yJ6QWE0kLEtRroSImnD82d2gAOD8JlAWZ1CDL63d8PuX6S uOx0mRnNnCvMwwr8BqhFUeI2lPW6v6aMGPzRGHliNYCB7U4WNo3n0lJyZ/tdPq+P7co/O 5/ATMSOWCfZPPdP6mPwtp4KUS0jtx7DnEhb1OuqyjjCuArlBp8mXhTD/mw9+I6Nsqzw== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796304284; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=hSPSVLMxyngYTAnFgueVH4KaaK0foAJv0ucDIccjZjo=; b=wU1mfaKtv47DwBKP36Q+1UmMgUouXO+Q0ww+RSztJJxDINZqa+7A/iDDcVYjthod4P9I pV3+iRgH/kxy/O+umWGuf1y3vHFwkZRDFmaLDmMxB/KvAWx6HQ4YiFP1LwMHU6BU7sS+d q0sqkIrH8hXTes2yzFCKvvJFenpvmzHSaZ2Od/cztlfz6k77QPXwnvYk3Y7ZdkbiqQqUd FhIJuREr9sKMZpzx/YUWAQGqdfJ8Gni0xmWR19DDk5E5r80P21FbKLfOV/VFiZe2zElVR TP4PFy1jTWYAD7kQ2LICDNHT+XuaFpGRBWl/kRhXAcdKy7lIQbAFbIbTIEWNf6wrRFQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 67C311F00896; Thu, 3 Dec 2026 13:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796304284; bh=hSPSVLMxyngYTAnFgueVH4KaaK0foAJv0ucDIccjZjo=; h=From:Subject:Date:To:Cc:Reply-To; b=NrMPgOFcCTWUjbMaKLtIoTShyGE2N4tDyqRYuy2+gQOpPo/lv/6zPByjxWWmxi4CF gj2oTAODI0jugWJ+uaTQCrxIamM3EHkkKWeHDAumxkCWd2zqDsz7j/xUtxlGK14rjw MUca8U7Uo3dniVkewaop0V4qTMUMpKnuq87zK+yZKpKyPwd2I+VUydGqeAs8m3B4R5 xkurZOSmFTIUqTLHnwnosAlb8/TnQhLxjapz+mJ9t/+j1RGAGOIqgtPIeVcaPdEwHW yFSkTSIzXVD8zJqQGsbRoD3Fjf0ubckybXJ9MirnomZZBVSMuNtBtRRvuiMn73Qr6L LtSCfe48McA7Q== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id B78A14F9A7; Thu, 3 Dec 2026 13:24:42 +0000 (UTC) From: Xiubo Li via B4 Relay Subject: [PATCH v2 0/4] libceph: support pg_upmap_primary (the read balancer) Date: Thu, 03 Dec 2026 14:24:19 +0100 Message-Id: <20261203-b4-libceph-upmap-primary-v2-0-8a15d2fc7318@clyso.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/42NQQ6CMBBFr0Jm7Zi2IIor72FYtGWQMUCbFoiEc HcBL+DyJe+/v0CkwBThniwQaOLIrt9AnRKwje5fhFxtDEqoXMpUoMmwZWPJNzj6Tnv0gTsdZix qW1RGm1t+UbDNfaCaP0f6Wf44juZNdth7u9FwHFyYj+9J7t4fN5NEgSq7GqHTSpFMH7adoztb1 0G5rusXYV6dW9IAAAA= X-Change-ID: 20261130-b4-libceph-upmap-primary-9fc9dbab8652 To: Ilya Dryomov , Alex Markuze , Viacheslav Dubeyko Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Xiubo Li X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796304272; l=3184; i=xiubo.li@clyso.com; s=20260625; h=from:subject:message-id; bh=LxQsw7BtH+rdtP+hPDg50eoy6C/iKmjTrZpK9DwbVAE=; b=tDURPSuFc5a9pvDN14VL2oOcHToYjlSPNyD5ymL4UkdyFP3X0uf2v3G7fTPdDWEctVV2gxDZK skFw9rJsPg+BjPuFq84CepHrF2WZwpgZqtXrO7o4MqQScca9m/prG6w X-Developer-Key: i=xiubo.li@clyso.com; a=ed25519; pk=V3NGr0AgAopiUhaLY51ipBkLN5LlcLhjOEfLEq1RoZ8= X-Endpoint-Received: by B4 Relay for xiubo.li@clyso.com/20260625 with auth_id=840 X-Original-From: Xiubo Li Reply-To: xiubo.li@clyso.com Since reef, the mgr read balancer ("ceph balancer mode read" or "upmap-read") and "ceph osd pg-upmap-primary" choose the primary of each PG explicitly, so that reads, which normally go to the primary, are spread evenly over the OSDs. Kernel clients cannot take part today. libceph does not decode pg_upmap_primary and does not advertise SERVER_REEF, the feature the monitors require from every client once the OSDMap holds such an entry. So "ceph osd set-require-min-compat-client reef" is refused while kernel clients are connected, and a kernel client can neither mount CephFS nor map an rbd image on a cluster that already uses the read balancer: libceph: RADOS feature set mismatch: server's required > my supported 0x2f018fb87aa4aafe, missing 0x80000000 libceph: mon0 (2)127.0.0.1:17300 missing required protocol features Patches 1 and 2 fix two older libceph problems that a changing primary makes easier to hit. Patch 1 resends a balanced or localized read on any new interval, as the replica drops it otherwise, also when only the up set changes. Patch 2 asks for a full map when an incremental fails to apply half way, instead of routing requests with the half updated map. Patch 3 decodes the mappings from full and incremental maps and applies them the way OSDMap::_apply_upmap() does. Patch 4 advertises SERVER_REEF, which towards clients only selects the OSDMap encodings that carry pg_upmap_primary. Tested with the series applied to a 7.2-based tree, built as the libceph, ceph and rbd modules, against a 3-OSD tentacle cluster: CephFS mounts and rbd maps work with the read balancer on, the kernel's pg_upmap_primary entries follow the cluster through full and incremental maps, and all I/O of a PG goes to the chosen primary. Without entries, krbd fio and an IO500 run show no difference from the unpatched modules. The read balancer numbers are in patch 4. --- Changes in v2: - New patch 1: resend replica reads on a new interval, also when the acting set does not change (Alex). - New patch 2: get a full osdmap after failing to apply an incremental, instead of keeping a partially applied map (Alex). - Patches 3 and 4 are v1 patches 1 and 2; patch 3 only tab-aligns a comment in osdmap.h. - Link to v1: https://patch.msgid.link/20261130-b4-libceph-upmap-primary-v1-0-247b0a3d2e13@clyso.com --- Xiubo Li (4): libceph: resend replica reads on a new interval libceph: get a full osdmap after failing to apply an incremental libceph: decode and apply pg_upmap_primary mappings libceph: advertise SERVER_REEF include/linux/ceph/ceph_features.h | 4 +- include/linux/ceph/osd_client.h | 1 + include/linux/ceph/osdmap.h | 4 ++ net/ceph/debugfs.c | 12 ++++- net/ceph/osd_client.c | 71 +++++++++++++++++++++------ net/ceph/osdmap.c | 99 +++++++++++++++++++++++++++++++++++++- 6 files changed, 173 insertions(+), 18 deletions(-) --- base-commit: 3f90412e989cb381d4bf96260468f5c7b2d08655 change-id: 20261130-b4-libceph-upmap-primary-9fc9dbab8652 Best regards, -- Xiubo Li