mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Matthew Wilcox <willy@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	akpm@linux-foundation.org, hpa@zytor.com, mingo@elte.hu,
	tglx@linutronix.de, linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: + x86-add-support-for-pud-sized-transparent-hugepages-checkpatch-fixes.patch added to -mm tree
Date: Thu, 10 Mar 2016 00:08:58 +0100	[thread overview]
Message-ID: <20160309230858.GS14882@redhat.com> (raw)
In-Reply-To: <20160309200345.GA26114@linux.intel.com>

On Wed, Mar 09, 2016 at 03:03:45PM -0500, Matthew Wilcox wrote:
> On Wed, Mar 09, 2016 at 01:45:40PM -0500, Matthew Wilcox wrote:
> > > In fact even before starting to fix the comment, I would recommend to
> > > try again to call native_local_pmdp_get_and_clear and
> > > native_local_ptep_get_and_clear to verify if it still breaks, just in
> > > case the include ordering got fixed by accident in the meanwhile (that
> > > was a comment in 2.6.25 when arch/x86/include/asm didn't even exist
> > > yet, it was still in include/asm-x86). If it would manage to build
> > > without the manual expansion, the comment could go and the duplication
> > > as well.
> > 
> > The ordering problem is still there.  native_local_ptep_get_and_clear()
> > is declared at line 726 of asm/pgtable.h and asm/pgtable_64.h is included
> > at line 466 of asm/pgtable.h.
> > 
> > I'll have a little play; see if I can resolve this ...
> 
> asm/pgtable.h:466
> # include <asm/pgtable_64.h>
> 
> asm/pgtable.h:726
> static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
> {
>         pte_t res = *ptep;
> 
>         /* Pure native function needs no input for mm, addr */
>         native_pte_clear(NULL, 0, ptep);
>         return res;
> }
> 
> asm/pgtable_64.h:47
> static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr,
>                                     pte_t *ptep)
> {
>         *ptep = native_make_pte(0);
> }
> 
> asm/pgtable_64.h:73
> static inline pte_t native_ptep_get_and_clear(pte_t *xp)
> {
> #ifdef CONFIG_SMP
>         return native_make_pte(xchg(&xp->pte, 0));
> #else
>         /* native_local_ptep_get_and_clear,
>            but duplicated because of cyclic dependency */
>         pte_t ret = *xp;
>         native_pte_clear(NULL, 0, xp);
>         return ret;
> #endif
> }
> 
> Why don't we just convert native_ptep_get_and_clear to work the same way that
> pgtable-2level and pgtable-3level work?  ie:
> 
> #ifdef CONFIG_SMP
> static inline pte_t native_ptep_get_and_clear(pte_t *xp)
> {
>         return native_make_pte(xchg(&xp->pte, 0));
> }
> #else
> #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
> #endif
> 
> Or perhaps better, centralise the non-SMP definitions:
> 
>  arch/x86/include/asm/pgtable-2level.h |  6 ------
>  arch/x86/include/asm/pgtable-3level.h |  7 +------
>  arch/x86/include/asm/pgtable.h        |  5 +++++
>  arch/x86/include/asm/pgtable_64.h     | 18 ++----------------
>  4 files changed, 8 insertions(+), 28 deletions(-)

Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>

      reply	other threads:[~2016-03-09 23:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56b13381.v0wS03ZQEKxwivVW%akpm@linux-foundation.org>
2016-02-03  7:48 ` Ingo Molnar
2016-03-04 20:30   ` Matthew Wilcox
2016-03-09 12:08     ` Ingo Molnar
2016-03-09 16:55       ` Matthew Wilcox
2016-03-10  9:37         ` Ingo Molnar
2016-03-10 14:39           ` Matthew Wilcox
2016-03-09 17:40     ` Andrea Arcangeli
2016-03-09 18:45       ` Matthew Wilcox
2016-03-09 20:03         ` Matthew Wilcox
2016-03-09 23:08           ` Andrea Arcangeli [this message]

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=20160309230858.GS14882@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=willy@linux.intel.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

Powered by JetHome