Skip to contentSkip to conversation

libceph: remove pinning assertion in ceph_msg_data_iter_next()

PATCH Applied Tal Zussman 3 participants 3 messages Aug 25 – Sep 2 Ceph common code (libceph)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libceph: remove pinning assertion in ceph_msg_data_iter_next()

ceph_msg_data_iter_next() gets a page reference from iov_iter_get_pages2() only to immediately drop it, asserting that the page is pinned some other way. The assertion is the last caller of PageWriteback() in the tree, blocking removal of the PG_writeback page flag accessors.

Remove the assertion, as it is a CONFIG_DEBUG_VM-only check of an assumption the FIXME comment already documents. Converting to iov_iter_extract_pages() instead was considered, but the messenger never releases what it extracts, so it would still rely entirely on the caller holding the pages. That would be just as much of an abuse of the API, so leave it as-is for now.

---
The assertion is the last caller of PageWriteback() in the tree. The removal of the PG_writeback page flag accessors will be sent separately.

Changes in v2:
- Only delete the assertion and leave the rest as-is, per Christoph.
- Rebase onto latest ceph for-linus branch, as v1 was applied to the
testing branch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 net/ceph/messenger.c | 1 -
 1 file changed, 1 deletion(-)
net/ceph/messenger.c +0 -1
index 34b3097b4c7b..95929eeb1f85 100644
@@ -1003,7 +1003,6 @@ static struct page *ceph_msg_data_iter_next(struct ceph_msg_data_cursor *cursor,
 	 *	  we'll get an iov_iter_get_pages2 variant that doesn't take
 	 *	  page refs. Until then, just put the page ref.
 	 */
-	VM_BUG_ON_PAGE(!PageWriteback(page) && page_count(page) < 2, page);
 	put_page(page);
 
 	*length = min_t(size_t, len, cursor->resid);

---
base-commit: 91880e4a7fac45bc407771bc57bbaf4f37e9b4c3
change-id: 20260808-ceph-msgr-writeback-a67d25e28f1e

Best regards,

Signature · 1 line
Tal Zussman <[email protected]>
maintainer Applied
#2 lore raw
In reply to Tal Zussman
Quoted 46 lines · Tal Zussman

ceph_msg_data_iter_next() gets a page reference from iov_iter_get_pages2() only to immediately drop it, asserting that the page is pinned some other way. The assertion is the last caller of PageWriteback() in the tree, blocking removal of the PG_writeback page flag accessors.

Remove the assertion, as it is a CONFIG_DEBUG_VM-only check of an assumption the FIXME comment already documents. Converting to iov_iter_extract_pages() instead was considered, but the messenger never releases what it extracts, so it would still rely entirely on the caller holding the pages. That would be just as much of an abuse of the API, so leave it as-is for now.

---
The assertion is the last caller of PageWriteback() in the tree. The removal of the PG_writeback page flag accessors will be sent separately.

Changes in v2:
- Only delete the assertion and leave the rest as-is, per Christoph.
- Rebase onto latest ceph for-linus branch, as v1 was applied to the
testing branch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 net/ceph/messenger.c | 1 -
 1 file changed, 1 deletion(-)
net/ceph/messenger.c +0 -2
index 34b3097b4c7b..95929eeb1f85 100644
@@ -1003,7 +1003,6 @@ static struct page *ceph_msg_data_iter_next(struct ceph_msg_data_cursor *cursor,
         *        we'll get an iov_iter_get_pages2 variant that doesn't take
         *        page refs. Until then, just put the page ref.
         */
-       VM_BUG_ON_PAGE(!PageWriteback(page) && page_count(page) < 2, page);
        put_page(page);
 
        *length = min_t(size_t, len, cursor->resid);
 
---

base-commit: 91880e4a7fac45bc407771bc57bbaf4f37e9b4c3
change-id: 20260808-ceph-msgr-writeback-a67d25e28f1e

Quoted 4 lines

Best regards,
--
Tal Zussman <[email protected]>

Applied.

Thanks,

Ilya