linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Moola <vishal.moola@gmail.com>
To: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-openrisc@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	sparclinux@vger.kernel.org,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-hexagon@vger.kernel.org,
	David Hildenbrand <david@redhat.com>,
	Hugh Dickins <hughd@google.com>,
	linux-csky@vger.kernel.org, xen-devel@lists.xenproject.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org,
	loongarch@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-mm@kvack.org, linux-mips@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 03/34] s390: Use pt_frag_refcount for pagetables
Date: Thu, 1 Jun 2023 13:43:20 -0700	[thread overview]
Message-ID: <CAOzc2pyjLh_GV1PL7CPkkPGcASHULhir_rJgB+UhwzPgQZD8Bw@mail.gmail.com> (raw)
In-Reply-To: <20230601151900.6f184e8c@thinkpad-T15>

On Thu, Jun 1, 2023 at 6:19 AM Gerald Schaefer
<gerald.schaefer@linux.ibm.com> wrote:
>
>  On Wed, 31 May 2023 14:30:01 -0700
> "Vishal Moola (Oracle)" <vishal.moola@gmail.com> wrote:
>
> > s390 currently uses _refcount to identify fragmented page tables.
> > The page table struct already has a member pt_frag_refcount used by
> > powerpc, so have s390 use that instead of the _refcount field as well.
> > This improves the safety for _refcount and the page table tracking.
> >
> > This also allows us to simplify the tracking since we can once again use
> > the lower byte of pt_frag_refcount instead of the upper byte of _refcount.
>
> This would conflict with s390 impact of pte_free_defer() work from Hugh Dickins
> https://lore.kernel.org/lkml/35e983f5-7ed3-b310-d949-9ae8b130cdab@google.com/
> https://lore.kernel.org/lkml/6dd63b39-e71f-2e8b-7e0-83e02f3bcb39@google.com/
>
> There he uses pt_frag_refcount, or rather pt_mm in the same union, to save
> the mm_struct for deferred pte_free().
>
> I still need to look closer into both of your patch series, but so far it
> seems that you have no hard functional requirement to switch from _refcount
> to pt_frag_refcount here, for s390.
>
> If this is correct, and you do not e.g. need this to make some other use
> of _refcount, I would suggest to drop this patch.

The goal of this preparation patch is to consolidate s390's usage of
struct page fields so that struct ptdesc can be smaller. Its not particularly
mandatory; leaving _refcount in ptdesc only increases the struct by
8 bytes and can always be changed later.

However it is a little annoying since s390 is the only architecture
that egregiously uses space throughout struct page for their page
tables, rather than just the page table struct. For example, s390
gmap uses page->index which also aliases with pt_mm and
pt_frag_refcount. I'm not sure if/how gmap page tables interact
with s390 process page tables at all, but if it does that could
potentially cause problems with Hugh's patch as well :(

I can add _refcount to ptdesc if we would like, but I still
prefer if s390 could be simplified instead.

  reply	other threads:[~2023-06-01 20:44 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 21:29 [PATCH v3 00/34] Split ptdesc from struct page Vishal Moola (Oracle)
2023-05-31 21:29 ` [PATCH v3 01/34] mm: Add PAGE_TYPE_OP folio functions Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 02/34] s390: Use _pt_s390_gaddr for gmap address tracking Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 03/34] s390: Use pt_frag_refcount for pagetables Vishal Moola (Oracle)
2023-06-01 13:19   ` Gerald Schaefer
2023-06-01 20:43     ` Vishal Moola [this message]
2023-05-31 21:30 ` [PATCH v3 04/34] pgtable: Create struct ptdesc Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 05/34] mm: add utility functions for ptdesc Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 06/34] mm: Convert pmd_pgtable_page() to pmd_ptdesc() Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 07/34] mm: Convert ptlock_alloc() to use ptdescs Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 08/34] mm: Convert ptlock_ptr() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 09/34] mm: Convert pmd_ptlock_init() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 10/34] mm: Convert ptlock_init() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 11/34] mm: Convert pmd_ptlock_free() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 12/34] mm: Convert ptlock_free() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 13/34] mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor} Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 14/34] powerpc: Convert various functions to use ptdescs Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 15/34] x86: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 16/34] s390: Convert various gmap " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 17/34] s390: Convert various pgalloc " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 18/34] mm: Remove page table members from struct page Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 19/34] pgalloc: Convert various functions to use ptdescs Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 20/34] arm: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 21/34] arm64: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 22/34] csky: Convert __pte_free_tlb() " Vishal Moola (Oracle)
2023-06-01  4:36   ` Guo Ren
2023-05-31 21:30 ` [PATCH v3 23/34] hexagon: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 24/34] loongarch: Convert various functions " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 25/34] m68k: " Vishal Moola (Oracle)
2023-06-01  7:40   ` Geert Uytterhoeven
2023-06-01  8:20     ` Vishal Moola
2023-06-01 14:18   ` kernel test robot
2023-05-31 21:30 ` [PATCH v3 26/34] mips: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 27/34] nios2: Convert __pte_free_tlb() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 28/34] openrisc: " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 29/34] riscv: Convert alloc_{pmd, pte}_late() " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 30/34] sh: Convert pte_free_tlb() " Vishal Moola (Oracle)
2023-06-01  7:20   ` Geert Uytterhoeven
2023-06-01  7:28     ` John Paul Adrian Glaubitz
2023-06-01  7:42       ` Geert Uytterhoeven
2023-06-01  7:46         ` John Paul Adrian Glaubitz
2023-06-01  8:22       ` Vishal Moola
2023-06-08 10:12   ` John Paul Adrian Glaubitz
2023-05-31 21:30 ` [PATCH v3 31/34] sparc64: Convert various functions " Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 32/34] sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 33/34] um: Convert {pmd, pte}_free_tlb() to use ptdescs Vishal Moola (Oracle)
2023-05-31 21:30 ` [PATCH v3 34/34] mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers Vishal Moola (Oracle)

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=CAOzc2pyjLh_GV1PL7CPkkPGcASHULhir_rJgB+UhwzPgQZD8Bw@mail.gmail.com \
    --to=vishal.moola@gmail.com \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hughd@google.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=sparclinux@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).