Re: [PATCH v2] mm/debug: Fix minor issues in mm
From: Matthew Wilcox
Date: Wed Mar 12 2025 - 08:21:04 EST
On Wed, Mar 12, 2025 at 11:23:44AM +0800, Liu Ye wrote:
> - Simplify compound page judgment conditions.
> @@ -132,15 +132,15 @@ static void __dump_page(const struct page *page)
> again:
> memcpy(&precise, page, sizeof(*page));
> head = precise.compound_head;
> - if ((head & 1) == 0) {
> + if (head & 1) {
> + foliop = (struct folio *)(head - 1);
> + idx = folio_page_idx(foliop, page);
> + } else {
> foliop = (struct folio *)&precise;
> idx = 0;
> if (!folio_test_large(foliop))
> goto dump;
> foliop = (struct folio *)page;
> - } else {
> - foliop = (struct folio *)(head - 1);
> - idx = folio_page_idx(foliop, page);
> }
>
> if (idx < MAX_FOLIO_NR_PAGES) {
How is this "simpler"? It seems like churn for the sake of churn.
NACK.