[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAmzW4M0qS7XBQ1L+iWLWoLh2R30EeLaPy=5Ncw-Uz17bdKukg@mail.gmail.com>
Date: Fri, 11 Dec 2020 10:17:05 +0900
From: Joonsoo Kim <js1304@...il.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] mm, slab, slub: clear the slab_cache field when freeing page
2020년 12월 11일 (금) 오전 1:00, Vlastimil Babka <vbabka@...e.cz>님이 작성:
>
> The page allocator expects that page->mapping is NULL for a page being freed.
> SLAB and SLUB use the slab_cache field which is in union with mapping, but
> before freeing the page, the field is referenced with the "mapping" name when
> set to NULL.
>
> It's IMHO more correct (albeit functionally the same) to use the slab_cache
> name as that's the field we use in SL*B, and document why we clear it in a
> comment (we don't clear fields such as s_mem or freelist, as page allocator
> doesn't care about those). While using the 'mapping' name would automagically
> keep the code correct if the unions in struct page changed, such changes should
> be done consciously and needed changes evaluated - the comment should help with
> that.
>
> Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@....com>
Powered by blists - more mailing lists