From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-s390@vger.kernel.org
Subject: Re: enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c
Date: Mon, 05 Jan 2015 08:57:28 +0000 [thread overview]
Message-ID: <20150105095728.11b1981e@mschwide> (raw)
In-Reply-To: <20150102103136.GB4059@osiris>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]
On Fri, 2 Jan 2015 11:31:36 +0100
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> On Wed, Dec 31, 2014 at 12:56:59AM -0500, Mike Frysinger wrote:
> > i've configured my kernel to have:
> > CONFIG_KVM=y
> > CONFIG_NR_CPUS=2
> > CONFIG_SPLIT_PTLOCK_CPUS=4
> >
> > and that makes the build very unhappy:
> > CC arch/s390/mm/pgtable.o
> > arch/s390/mm/pgtable.c: In function ���__gmap_segment_gaddr���:
> > arch/s390/mm/pgtable.c:327:2: error: implicit declaration of function
> > ���pmd_to_page��� [-Werror=implicit-function-declaration]
> > page = pmd_to_page((pmd_t *) entry);
> > ^
> >
> > this is because include/linux/mm_types.h has:
> > #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
> > IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
> >
> > and include/linux/mm.h has:
> > #if USE_SPLIT_PMD_PTLOCKS
> > static struct page *pmd_to_page(pmd_t *pmd)
> > ...
> >
> > i did set NR_CPUS down on purpose (this system only has two cpus), but
> > apparently tweaking SPLIT_PTLOCK_CPUS isn't an option :). in mm/Kconfig:
> > config SPLIT_PTLOCK_CPUS
> > int
> > default "4"
> > -mike
>
> Thanks for reporting. The patch below should fix it (adding Martin to To:)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index f80d0194c9bc..4ee25aea7861 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1555,14 +1555,14 @@ static inline void pgtable_page_dtor(struct page *page)
> ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
> NULL: pte_offset_kernel(pmd, address))
>
> -#if USE_SPLIT_PMD_PTLOCKS
> -
> -static struct page *pmd_to_page(pmd_t *pmd)
> +static inline struct page *pmd_to_page(pmd_t *pmd)
> {
> unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1);
> return virt_to_page((void *)((unsigned long) pmd & mask));
> }
>
> +#if USE_SPLIT_PMD_PTLOCKS
> +
> static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd)
> {
> return ptlock_ptr(pmd_to_page(pmd));
That looks good, there is no reason why the pmd_to_page helper should be
conditional on the USE_SPLIT_PMD_PTLOCKS define.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next parent reply other threads:[~2015-01-05 8:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150102103136.GB4059@osiris>
2015-01-05 8:57 ` Martin Schwidefsky [this message]
2014-12-31 5:56 enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c Mike Frysinger
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=20150105095728.11b1981e@mschwide \
--to=schwidefsky@de.ibm.com \
--cc=linux-s390@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox