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: <20250508211109.GC323143@cmpxchg.org>
Date: Thu, 8 May 2025 17:11:09 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Zi Yan <ziy@...dia.com>
Cc: David Hildenbrand <david@...hat.com>, linux-mm@...ck.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Oscar Salvador <osalvador@...e.de>,
	Vlastimil Babka <vbabka@...e.cz>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
	Mel Gorman <mgorman@...hsingularity.net>,
	Suren Baghdasaryan <surenb@...gle.com>,
	Michal Hocko <mhocko@...e.com>,
	Brendan Jackman <jackmanb@...gle.com>,
	Richard Chang <richardycc@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/4] mm/page_isolation: remove migratetype parameter
 from more functions.

On Wed, May 07, 2025 at 05:10:59PM -0400, Zi Yan wrote:
> @@ -22,8 +22,17 @@ static inline bool is_migrate_isolate(int migratetype)
>  }
>  #endif
>  
> -#define MEMORY_OFFLINE	0x1
> -#define REPORT_FAILURE	0x2
> +/*
> + * Isolation flags:
> + * MEMORY_OFFLINE - isolate to offline (!allocate) memory e.g., skip over
> + *		    PageHWPoison() pages and PageOffline() pages.
> + * REPORT_FAILURE - report details about the failure to isolate the range
> + * CMA_ALLOCATION - isolate for CMA allocations
> + */
> +typedef unsigned int __bitwise isol_flags_t;
> +#define MEMORY_OFFLINE		((__force isol_flags_t)BIT(0))
> +#define REPORT_FAILURE		((__force isol_flags_t)BIT(1))
> +#define CMA_ALLOCATION		((__force isol_flags_t)BIT(2))

Should this be a mode enum instead? MEMORY_OFFLINE and CMA_ALLOCATION
are exclusive modes AFAICS. REPORT_FAILURE is a flag, but it's only
used by MEMORY_OFFLINE, so probably better to make it a part of that
instead of having both a mode and a flag field.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ