/* * struct zpdesc - Memory descriptor for zpool memory. * @flags: Page flags, mostly unused by zsmalloc. * @lru: Indirectly used by page migration. * @movable_ops: Used by page migration. * @next: Next zpdesc in a zspage in zsmalloc zpool. * @handle: For huge zspage in zsmalloc zpool. * @zspage: Points to the zspage this zpdesc is a part of. * @first_obj_offset: First object offset in zsmalloc zpool. * @_refcount: The number of references to this zpdesc. * * This struct overlays struct page for now. Do not modify without a good * understanding of the issues. In particular, do not expand into the overlap * with memcg_data. * * Page flags used: * * PG_private identifies the first component page. * * PG_locked is used by page migration code.
*/ struct zpdesc { unsignedlong flags; struct list_head lru; unsignedlong movable_ops; union { struct zpdesc *next; unsignedlong handle;
}; struct zspage *zspage; /* * Only the lower 24 bits are available for offset, limiting a page * to 16 MiB. The upper 8 bits are reserved for PGTY_zsmalloc. * * Do not access this field directly. * Instead, use {get,set}_first_obj_offset() helpers.
*/ unsignedint first_obj_offset;
atomic_t _refcount;
}; #define ZPDESC_MATCH(pg, zp) \
static_assert(offsetof(struct page, pg) == offsetof(struct zpdesc, zp))
/* * zpdesc_page - The first struct page allocated for a zpdesc * @zp: The zpdesc. * * A convenience wrapper for converting zpdesc to the first struct page of the * underlying folio, to communicate with code not yet converted to folio or * struct zpdesc. *
*/ #define zpdesc_page(zp) (_Generic((zp), \ conststruct zpdesc *: (conststruct page *)(zp), \ struct zpdesc *: (struct page *)(zp)))
/** * zpdesc_folio - The folio allocated for a zpdesc * @zp: The zpdesc. * * Zpdescs are descriptors for zpool memory. The zpool memory itself is * allocated as folios that contain the zpool objects, and zpdesc uses specific * fields in the first struct page of the folio - those fields are now accessed * by struct zpdesc. * * It is occasionally necessary convert to back to a folio in order to * communicate with the rest of the mm. Please use this helper function * instead of casting yourself, as the implementation may change in the future.
*/ #define zpdesc_folio(zp) (_Generic((zp), \ conststruct zpdesc *: (conststruct folio *)(zp), \ struct zpdesc *: (struct folio *)(zp))) /** * page_zpdesc - Converts from first struct page to zpdesc. * @p: The first (either head of compound or single) page of zpdesc. * * A temporary wrapper to convert struct page to struct zpdesc in situations * where we know the page is the compound head, or single order-0 page. * * Long-term ideally everything would work with struct zpdesc directly or go * through folio to struct zpdesc. * * Return: The zpdesc which contains this page
*/ #define page_zpdesc(p) (_Generic((p), \ conststruct page *: (conststruct zpdesc *)(p), \ struct page *: (struct zpdesc *)(p)))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.