i915: convert shmem_sg_free_table() to use a folio_batch
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 21 Jun 2023 16:45:48 +0000 (17:45 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 23 Jun 2023 23:59:28 +0000 (16:59 -0700)
commit0b62af28f249b9c4036a05acfb053058dc02e2e2
tree6cd399c495f9b25756e401f9de8d6caa2f35b55c
parentbdadc6d83156016d2b5eed582c1458c881c53a1e
i915: convert shmem_sg_free_table() to use a folio_batch

Remove a few hidden compound_head() calls by converting the returned page
to a folio once and using the folio APIs.  We also only increment the
refcount on the folio once instead of once for each page.  Ideally, we
would have a for_each_sgt_folio macro, but until then this will do.

Link: https://lkml.kernel.org/r/20230621164557.3510324-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/gpu/drm/i915/gem/i915_gem_shmem.c