linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [next-20150119]regression (mm)?
Date: Tue, 20 Jan 2015 11:45:55 +0000	[thread overview]
Message-ID: <20150120114555.GA11502@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20150120001643.7D15AA8@black.fi.intel.com>

On Tue, Jan 20, 2015 at 02:16:43AM +0200, Kirill A. Shutemov wrote:
> Better option would be converting 2-lvl ARM configuration to
> <asm-generic/pgtable-nopmd.h>, but I'm not sure if it's possible.

Well, IMHO the folded approach in asm-generic was done the wrong way
which barred ARM from ever using it.

By that, I mean that the asm-generic stuff encapsulates a pgd into a pud,
and a pud into a pmd:

typedef struct { pgd_t pgd; } pud_t;
typedef struct { pud_t pud; } pmd_t;

This, I assert, is the wrong way around.  Think about it when you have a
real 4 level page table structure - a single pgd points to a set of puds.
So, one pgd encapsulates via a pointer a set of puds.  One pud does not
encapsulate a set of pgds.

What we have on ARM is slightly different: because of the sizes of page
tables, we have a pgd entry which is physically two page table pointers.
However, there are cases where we want to access these as two separate
pointers.

So, we define pgd_t to be an array of two u32's, and a pmd_t to be a
single entry.  This works fine, we set the masks, shifts and sizes
appropriately so that the pmd code is optimised away, but leaves us with
the ability to go down to the individual pgd_t entries when we need to
(eg, for section mappings, writing the pgd pointers for page tables,
etc.)

I think I also ran into problems with:

#define pmd_val(x)                              (pud_val((x).pud))
#define __pmd(x)                                ((pmd_t) { __pud(x) } )

too - but it's been a very long time since the nopmd.h stuff was
introduced, and I last looked at it.

In any case, what we have today is what has worked for well over a decade
(and pre-dates nopmd.h), and I'm really not interested today in trying to
rework tonnes of code to make use of nopmd.h - especially as it will most
likely require nopmd.h to be rewritten too, and we now have real 3 level
page table support (which I have no way to test.)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2015-01-20 11:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 16:42 [next-20150119]regression (mm)? Nishanth Menon
     [not found] ` <CANMBJr6DudDBSs+rM-e2QnC5ztxAYLuSvZ0khvx7OZdQpcu_3A@mail.gmail.com>
2015-01-19 17:04   ` Nishanth Menon
2015-01-19 17:19     ` Tyler Baker
2015-01-19 17:43 ` Felipe Balbi
2015-01-20  0:16   ` Kirill A. Shutemov
2015-01-20 11:45     ` Russell King - ARM Linux [this message]
2015-01-20 14:05       ` Kirill A. Shutemov
2015-01-20 14:50         ` Fabio Estevam
2015-01-20 15:10           ` Felipe Balbi
2015-01-20 23:26         ` Nishanth Menon
2015-01-21  9:23         ` Peter Ujfalusi
2015-01-21 10:29         ` Krzysztof Kozlowski
2015-01-23 17:27         ` Nishanth Menon
2015-01-23 17:39           ` Tyler Baker
2015-01-23 18:37             ` Nishanth Menon
2015-01-23 20:22               ` Kirill A. Shutemov
2015-01-23 22:05                 ` Nishanth Menon
2015-01-23 22:42                 ` Tyler Baker
2015-01-24  1:13                   ` Kirill A. Shutemov
2015-01-24  4:37                     ` Nishanth Menon
2015-01-26 12:00                       ` Kirill A. Shutemov
2015-01-26 22:38                         ` Tyler Baker

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=20150120114555.GA11502@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).