linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, linux-next@vger.kernel.org,
	sfr@canb.auug.org.au, mhocko@suse.cz,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: mmotm 2015-01-22-15-04: qemu failures due to 'mm: account pmd page tables to the process'
Date: Tue, 27 Jan 2015 22:16:42 -0800	[thread overview]
Message-ID: <54C87ECA.9040601@roeck-us.net> (raw)
In-Reply-To: <20150127132433.dbe4461d9caeecdb50f28b42@linux-foundation.org>

On 01/27/2015 01:24 PM, Andrew Morton wrote:
> On Tue, 27 Jan 2015 08:24:28 -0800 Guenter Roeck <linux@roeck-us.net> wrote:
>
>>> __PAGETABLE_PMD_FOLDED is defined during <asm/pgtable.h> which is not
>>> included into <linux/mm_types.h>. And we cannot include it here since
>>> many of <asm/pgtables> needs <linux/mm_types.h> to define struct page.
>>>
>>> I failed to come up with better solution rather than put nr_pmds into
>>> mm_struct unconditionally.
>>>
>>> One possible solution would be to expose number of page table levels
>>> architecture has via Kconfig, but that's ugly and requires changes to
>>> all architectures.
>>>
>> FWIW, I tried a number of approaches. Ultimately I gave up and concluded
>> that it has to be either this patch or, as you say here, we would have
>> to add something like PAGETABLE_PMD_FOLDED as a Kconfig option.
>
> It's certainly a big mess.  Yes, I expect that moving
> __PAGETABLE_PMD_FOLDED and probably PAGETABLE_LEVELS into Kconfig logic
> would be a good fix.
>
> Adding 8 bytes to the mm_struct (sometimes) isn't a huge issue, but
> it does make the kernel just a little bit worse.
>
> Has anyone taken a look at what the Kconfig approach would look like?
>

We would need something like

config PAGETABLE_PMD_FOLDED (or maybe PAGETABLE_NOPMD)
	def_bool y

for arc, arm64, avr32, cris, hexagon, metag, mips, mn10300, nios2, openrisc,
powerpc, score, sh, tile, um, unicore32, x86, xtensa, arm, m32r, and
microblaze. In several cases it would depend on secondary options,
such as CONFIG_ARM64_PGTABLE_LEVELS for arm64 or PAGETABLE_LEVELS for x86
and sh. PAGETABLE_LEVELS is not a configuration option (yet), so, yes,
that would have to be converted to a configuration option as well.

Overall a lot of complexity. Not really sure if that is worth the gain.
We would have to touch more than 20 Kconfig files plus about 20
source and include files which currently use _PAGETABLE_PMD_FOLDED.

> Possibly another fix for this would be to move mm_struct into its own
> header file, or something along those lines?
>

I suspect that might be just as messy. We would have to find all files
which actually need mm_struct and make sure that the new mm_struct.h
is included.

Not sure which approach is better. Sure, the 8 (or 4) bytes are annoying,
but I am not sure if the situation is bad enough to really bother.

Ultimately it seems there may be other variables in mm_struct which
could be made optional with much less effort, such as uprobes_state
or mmap_legacy_base.

Guenter

  reply	other threads:[~2015-01-28  6:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 23:05 mmotm 2015-01-22-15-04 uploaded akpm
2015-01-23  5:04 ` mmotm 2015-01-22-15-04: qemu failures due to 'mm: account pmd page tables to the process' Guenter Roeck
2015-01-23 11:13   ` Kirill A. Shutemov
2015-01-23 15:07     ` Guenter Roeck
2015-01-23 21:55       ` Andrew Morton
2015-01-24  2:44         ` Guenter Roeck
2015-01-24  3:05           ` Guenter Roeck
2015-01-24  5:52         ` Guenter Roeck
2015-01-26 12:29           ` Kirill A. Shutemov
2015-01-26 14:03             ` Guenter Roeck
2015-01-26 14:17               ` Guenter Roeck
2015-01-27 16:16               ` Kirill A. Shutemov
2015-01-27 16:24                 ` Guenter Roeck
2015-01-27 21:24                   ` Andrew Morton
2015-01-28  6:16                     ` Guenter Roeck [this message]
2015-01-23  5:08 ` mmotm 2015-01-22-15-04: qemu failure due to 'mm: memcontrol: remove unnecessary soft limit tree node test' Guenter Roeck
2015-01-23 14:18   ` Johannes Weiner
2015-01-23 15:17     ` Christoph Lameter
2015-01-23 16:02       ` Johannes Weiner
2015-01-23 16:59         ` Guenter Roeck
2015-01-23 17:36           ` Johannes Weiner
2015-01-23 17:38             ` Johannes Weiner
2015-01-24  2:02             ` Guenter Roeck
2015-01-27 17:24       ` Michal Hocko
2015-01-28 15:03         ` Christoph Lameter
2015-01-23 15:46     ` Guenter Roeck
2015-01-23 16:03       ` Johannes Weiner
2015-01-23 20:20     ` Christoph Lameter
2015-01-23 20:33       ` Guenter Roeck
2015-01-23 21:09         ` Christoph Lameter
2015-01-24  7:16           ` Johannes Weiner
2015-01-25 21:36             ` Valdis.Kletnieks
2015-01-26 13:37               ` Johannes Weiner

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=54C87ECA.9040601@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).