lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zq0zucMFsOwATsAC@casper.infradead.org>
Date: Fri, 2 Aug 2024 20:30:01 +0100
From: Matthew Wilcox <willy@...radead.org>
To: alexs@...nel.org
Cc: Vitaly Wool <vitaly.wool@...sulko.com>,
	Miaohe Lin <linmiaohe@...wei.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	minchan@...nel.org, senozhatsky@...omium.org, david@...hat.com,
	42.hyeyoo@...il.com, Yosry Ahmed <yosryahmed@...gle.com>,
	nphamcs@...il.com
Subject: Re: [PATCH v4 01/22] mm/zsmalloc: add zpdesc memory descriptor for
 zswap.zpool

On Mon, Jul 29, 2024 at 07:25:13PM +0800, alexs@...nel.org wrote:
> +/*
> + * struct zpdesc -	Memory descriptor for zpool memory, now is for zsmalloc
> + * @flags:		Page flags, PG_private: identifies the first component page
> + * @lru:		Indirectly used by page migration
> + * @mops:		Used by page migration
> + * @next:		Next zpdesc in a zspage in zsmalloc zpool
> + * @handle:		For huge zspage in zsmalloc zpool
> + * @zspage:		Pointer to zspage in zsmalloc
> + * @memcg_data:		Memory Control Group data.
> + *
> + * This struct overlays struct page for now. Do not modify without a good
> + * understanding of the issues.
> + */
> +struct zpdesc {
> +	unsigned long flags;
> +	struct list_head lru;
> +	struct movable_operations *mops;
> +	union {
> +		/* Next zpdescs in a zspage in zsmalloc zpool */
> +		struct zpdesc *next;
> +		/* For huge zspage in zsmalloc zpool */
> +		unsigned long handle;
> +	};
> +	struct zspage *zspage;
> +	unsigned long _zp_pad_1;
> +#ifdef CONFIG_MEMCG
> +	unsigned long memcg_data;
> +#endif
> +};

Before we do a v5, what's the plan for a shrunk struct page?  It feels
like a lot of what's going on here is just "because we can".  But if you
actually had to allocate the memory, would you?

That is, if we get to

struct page {
	unsigned long memdesc;
};

what do you put in the 60  bits of information?  Do you allocate a
per-page struct zpdesc, and have each one pointing to a zspage?  Or do
you extend the current contents of zspage to describe the pages allocated
to it, and make each struct page point to the zspage?

I don't know your code, so I'm not trying to choose for you.  I'm just
trying to make sure we're walking in the right direction.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ