From: Dave Hansen <dave.hansen@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, linux-mm@kvack.org
Cc: linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org,
mhocko@suse.com, mingo@kernel.org, labbott@fedoraproject.org,
catalin.marinas@arm.com, will.deacon@arm.com,
mark.rutland@arm.com, zhongjiang@huawei.com,
guohanjun@huawei.com, tanxiaojun@huawei.com
Subject: Re: [PATCH] mm: vmalloc: make vmalloc_to_page() deal with PMD/PUD mappings
Date: Fri, 2 Jun 2017 07:29:42 -0700 [thread overview]
Message-ID: <e98368d8-b1bc-5804-2115-370ec7109e9b@intel.com> (raw)
In-Reply-To: <20170602112720.28948-1-ard.biesheuvel@linaro.org>
On 06/02/2017 04:27 AM, Ard Biesheuvel wrote:
> +static struct page *vmalloc_to_pud_page(unsigned long addr, pud_t *pud)
> +{
> + struct page *page = NULL;
> +#ifdef CONFIG_HUGETLB_PAGE
Do we really want this based on hugetlbfs? Won't this be dead code on x86?
Also, don't we discourage #ifdefs in .c files?
> + pte_t pte = huge_ptep_get((pte_t *)pud);
> +
> + if (pte_present(pte))
> + page = pud_page(*pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
x86 has pmd/pud_page(). Seems a bit silly to open-code it here.
> +#else
> + VIRTUAL_BUG_ON(1);
> +#endif
> + return page;
> +}
So if somebody manages to call this function on a huge page table entry,
but doesn't have hugetlbfs configured on, we kill the machine?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-06-02 14:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 11:27 Ard Biesheuvel
2017-06-02 14:29 ` Dave Hansen [this message]
2017-06-02 15:11 ` Ard Biesheuvel
2017-06-02 16:03 ` Dave Hansen
2017-06-02 16:21 ` Ard Biesheuvel
2017-06-02 18:18 ` Dave Hansen
2017-06-05 12:35 ` Ard Biesheuvel
2017-06-02 16:34 ` kbuild test robot
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=e98368d8-b1bc-5804-2115-370ec7109e9b@intel.com \
--to=dave.hansen@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=guohanjun@huawei.com \
--cc=labbott@fedoraproject.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=tanxiaojun@huawei.com \
--cc=will.deacon@arm.com \
--cc=zhongjiang@huawei.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