Skip to content

lib/scatterlist: Small SGL tidy

Tvrtko Ursulin linux-scsi lkml target-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6lib/scatterlist: Tidy types and fix overflow checking in sgl_alloc_orderinclude/linux/scatterlist.h lib/scatterlist.c+36 -313 replies
2/6lib/scatterlist: Skip requesting zeroed allocations in sgl_alloc_orderlib/scatterlist.c+1 -22 replies
3/6lib/scatterlist: Do not leak pages when high-order allocation failslib/scatterlist.c+4 -22 replies
4/6lib/scatterlist: Unexport some trivial wrappersinclude/linux/scatterlist.h lib/scatterlist.c+34 -402 replies
5/6lib/scatterlist: Drop unused sgl_free_orderinclude/linux/scatterlist.h+1 -110 replies
6/6lib/scatterlist: Drop order argument from sgl_free_n_orderdrivers/target/target_core_transport.c include/linux/scatterlist.h lib/scatterlist.c+9 -147 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] lib/scatterlist: Small SGL tidy

From: Tvrtko Ursulin <[email protected]>

I spotted a few small issues in the recent added SGL code so am sending some patches to tidy this.

My motivation was looking at sgl_alloc_order to potentially use from the i915 driver, with a small addition to support fall-back to smaller order allocation if so was requested.

But then I realized scatterlist table allocated with sgl_alloc_order is not compatible with being put into the sg_table container due different allocator being used.

If it had used the standard chained scatterlist allocation, it would benefit from less memory pressure for small-order large length allocations (in other words large nent - as it stands it can request really large kmalloc allocations for those cases), but to convert it to use that looks to would require some refactoring of the SGL API users. So I wasn't sure how feasible would that be.

There were some other unclear bits to me in the SGL API, like why so much API some of which is unused, so I tried to trim that as well.

So don't know - comments are welcome.

Tvrtko Ursulin (6):
lib/scatterlist: Tidy types and fix overflow checking in
sgl_alloc_order
lib/scatterlist: Skip requesting zeroed allocations in sgl_alloc_order lib/scatterlist: Do not leak pages when high-order allocation fails lib/scatterlist: Unexport some trivial wrappers lib/scatterlist: Drop unused sgl_free_order lib/scatterlist: Drop order argument from sgl_free_n_order

 drivers/target/target_core_transport.c |  2 +-
 include/linux/scatterlist.h            | 36 +++++++++++---
 lib/scatterlist.c                      | 91 +++++++++++-----------------------
 3 files changed, 57 insertions(+), 72 deletions(-)

---
Cc: Bart Van Assche <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Johannes Thumshirn <[email protected]>
Cc: Jens Axboe <[email protected]>

Signature · 1 line
2.14.1