All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Oscar Salvador <osalvador@suse.de>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	X86 ML <x86@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: linux-next: Tree for Apr 6 (arch/x86/mm/init_64.c)
Date: Tue, 6 Apr 2021 23:25:13 +0100	[thread overview]
Message-ID: <20210406222513.GV2531743@casper.infradead.org> (raw)
In-Reply-To: <YGy9DwRZ+dFKi9/c@localhost.localdomain>

On Tue, Apr 06, 2021 at 09:57:03PM +0200, Oscar Salvador wrote:
> On Tue, Apr 06, 2021 at 11:39:47AM -0700, Randy Dunlap wrote:
>  
> > > Looks like that compound "if" is too much for gcc 7.5.0 to handle:
> > > 
> > > 			} else if (IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP) &&
> > > 				   vmemmap_pmd_is_unused(addr, next)) {
> > > 					free_hugepage_table(pmd_page(*pmd),
> > > 							    altmap);
> > > 					spin_lock(&init_mm.page_table_lock);
> > > 					pmd_clear(pmd);
> > > 					spin_unlock(&init_mm.page_table_lock);
> > > 			}
> > > 
> > > 
> > 
> > This is what I am using for now:
> 
> Hi Randy
> 
> Yeah, that is what v4 was using [1].
> We decided to get rid of the ifdef for costimetic reasons but it seems
> it does not do the trick.
> 
> I will ask Andrew to squash that on top.

This is pretty ugly.  What I was doing was this:

+++ b/arch/x86/mm/init_64.c
@@ -862,6 +862,9 @@ static bool __meminit vmemmap_pmd_is_unused(unsigned long addr, unsigned long en
 
        return !memchr_inv((void *)start, PAGE_UNUSED, PMD_SIZE);
 }
+#else
+static inline bool vmemmap_pmd_is_unused(unsigned long addr, unsigned long end)
+{ return false; }
 #endif
 
 static void __meminit __vmemmap_use_sub_pmd(unsigned long start)
@@ -924,6 +927,9 @@ static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long
        if (!IS_ALIGNED(end, PMD_SIZE))
                unused_pmd_start = end;
 }
+#else
+static inline bool vmemmap_pmd_is_unused(unsigned long addr, unsigned long end)
+{ return false; }
 #endif
 
 /*

(whitespace damaged, but ...)

      reply	other threads:[~2021-04-06 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 12:31 linux-next: Tree for Apr 6 Stephen Rothwell
2021-04-06 18:32 ` linux-next: Tree for Apr 6 (arch/x86/mm/init_64.c) Randy Dunlap
2021-04-06 18:39   ` Randy Dunlap
2021-04-06 19:57     ` Oscar Salvador
2021-04-06 22:25       ` Matthew Wilcox [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=20210406222513.GV2531743@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=osalvador@suse.de \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.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 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.