linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Li Wang <liwang@redhat.com>, Guenter Roeck <linux@roeck-us.net>,
	Janosch Frank <frankja@linux.vnet.ibm.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH 1/3] mm: introduce mm_[p4d|pud|pmd]_folded
Date: Wed, 31 Oct 2018 12:02:55 +0300	[thread overview]
Message-ID: <20181031090255.bvmp3jnsdaunhzn7@kshutemo-mobl1> (raw)
In-Reply-To: <1539621759-5967-2-git-send-email-schwidefsky@de.ibm.com>

On Mon, Oct 15, 2018 at 06:42:37PM +0200, Martin Schwidefsky wrote:
> Add three architecture overrideable function to test if the
> p4d, pud, or pmd layer of a page table is folded or not.
> 
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> ---
>  include/linux/mm.h | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 0416a7204be3..d1029972541c 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h

Shouldn't it be somewhere in asm-generic/pgtable*?

> @@ -105,6 +105,46 @@ extern int mmap_rnd_compat_bits __read_mostly;
>  #define mm_zero_struct_page(pp)  ((void)memset((pp), 0, sizeof(struct page)))
>  #endif
>  
> +/*
> + * On some architectures it depends on the mm if the p4d/pud or pmd
> + * layer of the page table hierarchy is folded or not.
> + */
> +#ifndef mm_p4d_folded
> +#define mm_p4d_folded(mm) mm_p4d_folded(mm)

Do we need to define it in generic header?

> +static inline bool mm_p4d_folded(struct mm_struct *mm)
> +{
> +#ifdef __PAGETABLE_P4D_FOLDED
> +	return 1;
> +#else
> +	return 0;
> +#endif

Maybe
	return __is_defined(__PAGETABLE_P4D_FOLDED);

?

-- 
 Kirill A. Shutemov

  reply	other threads:[~2018-10-31  9:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 16:42 [RFC][PATCH 0/3] pgtable bytes mis-accounting v2 Martin Schwidefsky
2018-10-15 16:42 ` [PATCH 1/3] mm: introduce mm_[p4d|pud|pmd]_folded Martin Schwidefsky
2018-10-31  9:02   ` Kirill A. Shutemov [this message]
2018-10-31  9:35     ` Martin Schwidefsky
2018-10-31  9:48       ` Kirill A. Shutemov
2018-10-15 16:42 ` [PATCH 2/3] mm: add mm_pxd_folded checks to pgtable_bytes accounting functions Martin Schwidefsky
2018-10-31  9:04   ` Kirill A. Shutemov
2018-10-15 16:42 ` [PATCH 3/3] s390/mm: fix mis-accounting of pgtable_bytes Martin Schwidefsky
     [not found]   ` <CAEemH2cHNFsiDqPF32K6TNn-XoXCRT0wP4ccAeah4bKHt=FKFA@mail.gmail.com>
2018-10-31  6:31     ` Martin Schwidefsky
     [not found]       ` <CAEemH2f2gW22PJYpVrh7p5zJyHOVRfVawJWD+kN3+8LmApePbw@mail.gmail.com>
2018-10-31  6:46         ` Martin Schwidefsky
2018-10-31  9:39           ` Martin Schwidefsky
2018-10-31 10:09       ` Heiko Carstens
2018-10-31 10:36         ` Kirill A. Shutemov
2018-11-27  7:34           ` Heiko Carstens
2018-11-27  8:05             ` Kirill A. Shutemov
2018-11-27  8:13               ` Heiko Carstens
2018-11-27 11:47             ` Guenter Roeck
2018-11-27 11:52               ` Heiko Carstens
2018-11-27 14:31             ` Martin Schwidefsky

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=20181031090255.bvmp3jnsdaunhzn7@kshutemo-mobl1 \
    --to=kirill@shutemov.name \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    --cc=liwang@redhat.com \
    --cc=schwidefsky@de.ibm.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 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).