All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vishal Moola <vishal.moola@gmail.com>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, hughd@google.com, david@redhat.com,
	rppt@kernel.org, willy@infradead.org, muchun.song@linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH 3/3] s390: supplement for ptdesc conversion
Date: Tue, 26 Mar 2024 12:48:09 -0700	[thread overview]
Message-ID: <ZgMmec2paNA0GFwY@fedora> (raw)
In-Reply-To: <04beaf3255056ffe131a5ea595736066c1e84756.1709541697.git.zhengqi.arch@bytedance.com>

On Mon, Mar 04, 2024 at 07:07:20PM +0800, Qi Zheng wrote:
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -206,9 +206,11 @@ static void gmap_free(struct gmap *gmap)
>  
>  	/* Free additional data for a shadow gmap */
>  	if (gmap_is_shadow(gmap)) {
> +		struct ptdesc *ptdesc;
> +
>  		/* Free all page tables. */
> -		list_for_each_entry_safe(page, next, &gmap->pt_list, lru)
> -			page_table_free_pgste(page);
> +		list_for_each_entry_safe(ptdesc, next, &gmap->pt_list, pt_list)
> +			page_table_free_pgste(ptdesc);

An important note: ptdesc allocation/freeing is different than the
standard alloc_pages()/free_pages() routines architectures are used to.
Are we sure we don't have memory leaks here?

We always allocate and free ptdescs as compound pages; for page table
struct pages, most archictectures do not. s390 has CRST_ALLOC_ORDER
pagetables, meaning if we free anything using the ptdesc api, we better
be sure it was allocated using the ptdesc api as well.

Like you, I don't have a s390 to test on, so hopefully some s390 expert
can chime in to let us know if we need a fix for this.

  parent reply	other threads:[~2024-03-26 19:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 11:07 [PATCH 0/3] minor fixes and supplement for ptdesc Qi Zheng
2024-03-04 11:07 ` [PATCH 1/3] mm: pgtable: correct the wrong comment about ptdesc->__page_flags Qi Zheng
2024-03-26 19:12   ` Vishal Moola
2024-03-27  2:00     ` Qi Zheng
2024-03-04 11:07 ` [PATCH 2/3] mm: pgtable: add missing pt_index to struct ptdesc Qi Zheng
2024-03-26 19:25   ` Vishal Moola
2024-03-27  2:06     ` Qi Zheng
2024-03-04 11:07 ` [PATCH 3/3] s390: supplement for ptdesc conversion Qi Zheng
2024-03-05  7:21   ` [PATCH v2 " Qi Zheng
2024-03-26  7:46     ` Heiko Carstens
2024-03-05 22:32   ` [PATCH " kernel test robot
2024-03-06  2:46     ` Qi Zheng
2024-03-06  4:53   ` kernel test robot
2024-03-26 19:48   ` Vishal Moola [this message]
2024-03-27  2:11     ` Qi Zheng
2024-03-26 19:07 ` [PATCH 0/3] minor fixes and supplement for ptdesc Vishal Moola
2024-03-27  8:52   ` David Hildenbrand

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=ZgMmec2paNA0GFwY@fedora \
    --to=vishal.moola@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=hughd@google.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=rppt@kernel.org \
    --cc=willy@infradead.org \
    --cc=zhengqi.arch@bytedance.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.