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=1796019163; b=2KjfwFnxjFRV05QjICs16E5k7U9WYXFUoFTAe5QC3yNw0EJ24bgC2UxQDMBZWJdDU9Zr ag7j6EAch0dxxjCD6787/ropfLjYtCjWmUeryR/YMaFdRQDmaM/h//yTzb6wMTWroHz/+ yrkaZmWDbJmvJPGeQ/eKbv59gifeGnTIl+rnIJt54/Gds9TJf587PMDr8w/LQE/ByYh2p ut8l4QQpSA47voHvppjlhj4Q9cROyjp9ngWV3DyrVKx95bi9unCt4iAj6opZ+vYIl5Xce qmLSgrm04r1O2TgpPMUuImJLbj1dL1RM/lUwqbN/gbudsVbKDWmsl7oQ/HTihsVMxMg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796019163; 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=UPHyQ2bWXtVjXRrtOwcsNrT/h9q+/dDIJDfuWSBcFKI=; b=LZ//Xr8EohD2qxNDNN/AceFK40lgzaIox1TKJLqOB1+emRrAyed5o4Kv8MfpzJ1wfvgA wF+I8+y9b1/df2UxiMpLCs5bWrWUdrUWM2VYrSRQ3PWefLGA4Mae/ZA/2FBjR/aMU3+gZ 2++R61hJqglaWWlHOZsmW/RfJRbqVn2OLyaC2mEjtPhvw10rUGf+taXjq7UPRA49IOpMu o0dpBT3puLDj7iqNnoJ8b9NqRPVAO8WIe0hl+uV4rJObZEQL+X1bmkYSfOVZtBH1bMvI2 YO+QrvLBbWKIbzSvmnPeWC6SIC1wQXmWteY9cQTrZDTyK+j3mdG07jkdtnQ6GKDeMrQ== 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=Bnogx+67; 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 B9D00606A31C; Mon, 30 Nov 2026 06:12:43 +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=Bnogx+67 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=1796019163; b=dl67PVXFVQMtDbijiAW44I9S9AGXLFe6/RlCzezS0y3wFavzCZ4Z8F4pWNRWw5dzGFgQ AL/UT4KWqsdtl4G9gmCI88HEzyPpSFziL5YJJMoRVk9krqoSyfZgCewJPnTyHBKbDn34B X+UgQu5sm4Bma6UCxfnlQcl6VG88aAvQc73gmX0hkXc835UNDVGefl5c6O3k0+KSOdtdQ 9PzFZ7A03tKkY0HuYvy+5OSnvDrrqwaCntA7VpDr9nmbOlSqPfOUavIe+pFaNzwkhkBOF Ue/kL/AdAKPYuhBcqBINlmnydXq8KhDcW31W0J2k9207yto/G4inewCHkGRPr6I6r1g== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796019163; 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=UPHyQ2bWXtVjXRrtOwcsNrT/h9q+/dDIJDfuWSBcFKI=; b=zsgXiDamkjWoizQJ0qS2e4/Lq7bRj/azffNA2E6T2/GibQ/k/cuq3na9HFbbBsOBtutx cQBLZDgvzURbxk+ksr8slIyA0MJ7XQ8XnsWVm+8eKqBBUsQ+mccMWqRmqsZWVn1bVh3xM hsMxHoMcMU/lLaP1cn+AcldDAvrUamwcobQ0/7wj+0FxM6AnwQ3ypw+rPaZWAOuCIVxQd Gsgvlmkn1+qyqgbM9d/lhviNsKeoMkuA3BU21RmH7VOiosZ/HMCWAxMTFBDOoCusGk1Yg 4lzVf90tumP4uvu9EPbyFdQbxKwJ3m5V9QwOxIn14n/0OAw1B8mnpkn5JzTawoUJ4sQ== 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 E2B981F000C1; Mon, 30 Nov 2026 06:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796019163; bh=UPHyQ2bWXtVjXRrtOwcsNrT/h9q+/dDIJDfuWSBcFKI=; h=From:Subject:Date:To:Cc:Reply-To; b=Bnogx+67f9lig98govM9fXSup8xvu4oYcdVagiJkkxFOEn64sDR3vUIoxIfed/+VZ 18spzeeom+V2Jn2nxfneuYpd7QDj92K5GQgIYKkUyctmmRXNTk2myXbXTQbm9BZhkP bbnluNqIQwb+Ixs+qdTjgGOwqyeXF5EeOinlx/L95SR/5WQICHqKjsGfc03t5HT2GC 5Otq3zeGjsgI1tDaDaeRdYGq+AEasDOefmvT3Yuq3EJuMTlFS+CoQrtLM2ka6ge6jp FyC61RhReD6JYqWKlVaOLVkQcbCQ9YUvCWI9cuTTjQeJL0vNK7PCyz5hxXcIHVx3bR lqsfq9YRXmmOw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 48DB54E6CC; Mon, 30 Nov 2026 06:12:39 +0000 (UTC) From: Xiubo Li via B4 Relay Subject: [PATCH 0/2] libceph: support pg_upmap_primary (the read balancer) Date: Mon, 30 Nov 2026 07:12:03 +0100 Message-Id: <20261130-b4-libceph-upmap-primary-v1-0-247b0a3d2e13@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/yXMQQ6CQAxA0auQrmnCjErEqxAW06FIjWDTAaMh3 N1Rl2/x/waJTTjBpdjA+ClJHnOGKwuIY5ivjNJng6987dyhQjriXSiyjrjqFBTVZAr2xmaITU+ BzvXJQ87VeJDXb912f6eVbhyX7w/2/QOoF0EofAAAAA== 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=1796019157; l=2123; i=xiubo.li@clyso.com; s=20260625; h=from:subject:message-id; bh=a03fZRdicpP3MTe/EhgRsAPoFkrKycv7XkjPc2F+8fA=; b=tnVkbPNtjCQp1CnwW6AFNMvr9AH0wnp25QARD9jRuZyJpqMNgTAUrQypMMM7VH8bdfDGu8zhH CAd372P5lEcDNCqnxo4yW3Q976O7suA+tAszJgPxsXQSaBduIYEll8D 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 Patch 1 decodes the mappings from full and incremental maps and applies them the way OSDMap::_apply_upmap() does. Patch 2 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 2. --- Xiubo Li (2): libceph: decode and apply pg_upmap_primary mappings libceph: advertise SERVER_REEF include/linux/ceph/ceph_features.h | 4 +- include/linux/ceph/osdmap.h | 4 ++ net/ceph/debugfs.c | 7 +++ net/ceph/osdmap.c | 99 +++++++++++++++++++++++++++++++++++++- 4 files changed, 112 insertions(+), 2 deletions(-) --- base-commit: 3f90412e989cb381d4bf96260468f5c7b2d08655 change-id: 20261130-b4-libceph-upmap-primary-9fc9dbab8652 Best regards, -- Xiubo Li