All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Fenghua Yu <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	Glenn Williamson <glenn.p.williamson@intel.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, x86 <x86@kernel.org>,
	Christoph Lameter <cl@linux.com>
Subject: Re: [PATCH v2] X86-32: Allocate 256 bytes for pgd in PAE paging
Date: Wed, 17 Dec 2014 16:25:22 -0800	[thread overview]
Message-ID: <54921EF2.9070004@intel.com> (raw)
In-Reply-To: <1418852859-18852-1-git-send-email-fenghua.yu@intel.com>

On 12/17/2014 01:47 PM, Fenghua Yu wrote:
> +static inline pgd_t *_pgd_alloc(void)
> +{
> +#if defined(CONFIG_X86_PAE) && !defined(CONFIG_XEN)
> +	return kmalloc(sizeof(pgdval_t) * PTRS_PER_PGD, PGALLOC_GFP);
> +#else
> +	return (pgd_t *)__get_free_page(PGALLOC_GFP);
> +#endif
> +}

I'm looking at:

	"Figure 4-7. Formats of CR3 and Paging-Structure Entries with
	 PAE Paging"

in the SDM.  It makes it pretty clear that the lower 5 bits of cr3 are
ignored in PAE mode.  That means we have to be 32-byte (or greater)
aligned, right?  Does kmalloc() guarantee that?

IOW, do *ALL* of the sl*b allocators in all of their forms with all of
their debugging options guarantee 32-byte alignment when allocating
256-byte objects?

I know we at least try to align to a cacheline, which would be good
enough, but I'm fuzzy on what we *guarantee*.

  reply	other threads:[~2014-12-18  0:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 21:47 [PATCH v2] X86-32: Allocate 256 bytes for pgd in PAE paging Fenghua Yu
2014-12-18  0:25 ` Dave Hansen [this message]
2014-12-18 14:52   ` Christoph Lameter
2014-12-18 15:36     ` Dave Hansen
2014-12-18 17:25 ` H. Peter Anvin
2014-12-18 17:51   ` Yu, Fenghua
2014-12-18 18:00     ` H. Peter Anvin

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=54921EF2.9070004@intel.com \
    --to=dave.hansen@intel.com \
    --cc=cl@linux.com \
    --cc=fenghua.yu@intel.com \
    --cc=glenn.p.williamson@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --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.