summaryrefslogtreecommitdiff
path: root/fs/9p
diff options
context:
space:
mode:
authorAlexander Duyck <alexanderduyck@fb.com>2022-01-31 19:40:01 +0300
committerDavid S. Miller <davem@davemloft.net>2022-02-03 14:49:03 +0300
commit52cc6ffc0ab2c61a76127b9347567fc97c15582f (patch)
tree90a1729f5ae2dd3d78bfa8937cdfc36d0a32c29d /fs/9p
parent33f7a32dd4b6d3c2b4d003582ccdd1a4c765b1e9 (diff)
downloadlinux-52cc6ffc0ab2c61a76127b9347567fc97c15582f.tar.xz
page_pool: Refactor page_pool to enable fragmenting after allocation
This change is meant to permit a driver to perform "fragmenting" of the page from within the driver instead of the current model which requires pre-partitioning the page. The main motivation behind this is to support use cases where the page will be split up by the driver after DMA instead of before. With this change it becomes possible to start using page pool to replace some of the existing use cases where multiple references were being used for a single page, but the number needed was unknown as the size could be dynamic. For example, with this code it would be possible to do something like the following to handle allocation: page = page_pool_alloc_pages(); if (!page) return NULL; page_pool_fragment_page(page, DRIVER_PAGECNT_BIAS_MAX); rx_buf->page = page; rx_buf->pagecnt_bias = DRIVER_PAGECNT_BIAS_MAX; Then we would process a received buffer by handling it with: rx_buf->pagecnt_bias--; Once the page has been fully consumed we could then flush the remaining instances with: if (page_pool_defrag_page(page, rx_buf->pagecnt_bias)) continue; page_pool_put_defragged_page(pool, page -1, !!budget); The general idea is that we want to have the ability to allocate a page with excess fragment count and then trim off the unneeded fragments. Signed-off-by: Alexander Duyck <alexanderduyck@fb.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/9p')
0 files changed, 0 insertions, 0 deletions