Skip to content
Snippets Groups Projects
Commit c1b3bb73 authored by Alex Shi's avatar Alex Shi Committed by Andrew Morton
Browse files

mm/zsmalloc: use zpdesc in trylock_zspage()/lock_zspage()


Convert trylock_zspage() and lock_zspage() to use zpdesc. To achieve
that, introduce a couple of helper functions:
  - zpdesc_lock()
  - zpdesc_unlock()
  - zpdesc_trylock()
  - zpdesc_wait_locked()
  - zpdesc_get()
  - zpdesc_put()

Here we use the folio version of functions for 2 reasons.  First,
zswap.zpool currently only uses order-0 pages and using folio could save
some compound_head checks.  Second, folio_put could bypass devmap checking
that we don't need.

BTW, thanks Intel LKP found a build warning on the patch.

Originally-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
Link: https://lkml.kernel.org/r/20241216150450.1228021-3-42.hyeyoo@gmail.com


Signed-off-by: default avatarAlex Shi <alexs@kernel.org>
Signed-off-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
Acked-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Tested-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f4e33d32
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment