linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>
Subject: Re: [PATCH v2 4/6] slub: Use a folio in __kmalloc_large_node
Date: Tue, 2 Jan 2024 12:21:04 +0100	[thread overview]
Message-ID: <0c13399e-70c4-4787-9e1e-97ecb2fd368e@suse.cz> (raw)
In-Reply-To: <20231228085748.1083901-5-willy@infradead.org>

On 12/28/23 09:57, Matthew Wilcox (Oracle) wrote:
> Mirror the code in free_large_kmalloc() and alloc_pages_node()
> and use a folio directly.  Avoid the use of folio_alloc() as
> that will set up an rmappable folio which we do not want here.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/slub.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index 58b4936f2a29..71d5840de65d 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -3915,7 +3915,7 @@ EXPORT_SYMBOL(kmem_cache_alloc_node);
>   */
>  static void *__kmalloc_large_node(size_t size, gfp_t flags, int node)
>  {
> -	struct page *page;
> +	struct folio *folio;
>  	void *ptr = NULL;
>  	unsigned int order = get_order(size);
>  
> @@ -3923,10 +3923,10 @@ static void *__kmalloc_large_node(size_t size, gfp_t flags, int node)
>  		flags = kmalloc_fix_flags(flags);
>  
>  	flags |= __GFP_COMP;
> -	page = alloc_pages_node(node, flags, order);
> -	if (page) {
> -		ptr = page_address(page);
> -		mod_lruvec_page_state(page, NR_SLAB_UNRECLAIMABLE_B,
> +	folio = (struct folio *)alloc_pages_node(node, flags, order);
> +	if (folio) {
> +		ptr = folio_address(folio);
> +		lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B,
>  				      PAGE_SIZE << order);
>  	}
>  



  parent reply	other threads:[~2024-01-02 11:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  8:57 [PATCH v2 0/6] Remove some lruvec page accounting functions Matthew Wilcox (Oracle)
2023-12-28  8:57 ` [PATCH v2 1/6] mm: Remove inc/dec lruvec page state functions Matthew Wilcox (Oracle)
2024-01-02 11:02   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 2/6] slub: Use alloc_pages_node() in alloc_slab_page() Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:06   ` Vlastimil Babka
2024-07-09 17:12   ` Christoph Lameter (Ampere)
2024-07-10 10:35     ` Vlastimil Babka
2024-07-10 16:43       ` Christoph Lameter (Ampere)
2024-07-11  7:54         ` Vlastimil Babka
2024-07-11 18:04           ` Christoph Lameter (Ampere)
2024-07-12  7:47             ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 3/6] slub: Use folio APIs in free_large_kmalloc() Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:10   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 4/6] slub: Use a folio in __kmalloc_large_node Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:21   ` Vlastimil Babka [this message]
2023-12-28  8:57 ` [PATCH v2 5/6] mm/khugepaged: Use a folio more in collapse_file() Matthew Wilcox (Oracle)
2023-12-28 21:10   ` Zi Yan
2024-01-02 11:24   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 6/6] mm/memcontrol: Remove __mod_lruvec_page_state() Matthew Wilcox (Oracle)
2023-12-28 21:24   ` Zi Yan
2023-12-28 22:31   ` Shakeel Butt
2024-01-02 11:56   ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c13399e-70c4-4787-9e1e-97ecb2fd368e@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox