linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: linux-kernel@vger.kernel.org
Cc: gorcunov@openvz.org, linux-mm@kvack.org
Subject: [rfc 0/3] Cleaning up soft-dirty bit usage
Date: Thu, 03 Apr 2014 22:48:44 +0400	[thread overview]
Message-ID: <20140403184844.260532690@openvz.org> (raw)

Hi! I've been trying to clean up soft-dirty bit usage. I can't cleanup
"ridiculous macros in pgtable-2level.h" completely because I need to
define _PAGE_FILE,_PAGE_PROTNONE,_PAGE_NUMA bits in sequence manner
like

#define _PAGE_BIT_FILE		(_PAGE_BIT_PRESENT + 1)	/* _PAGE_BIT_RW */
#define _PAGE_BIT_NUMA		(_PAGE_BIT_PRESENT + 2)	/* _PAGE_BIT_USER */
#define _PAGE_BIT_PROTNONE	(_PAGE_BIT_PRESENT + 3)	/* _PAGE_BIT_PWT */

which can't be done right now because numa code needs to save original
pte bits for example in __split_huge_page_map, if I'm not missing something
obvious.

Also if we ever redefine the bits above we will need to update PAT code
which uses _PAGE_GLOBAL + _PAGE_PRESENT to make pte_present return true
or false.

Another weird thing I found is the following sequence:

   mprotect_fixup
    change_protection (passes @prot_numa = 0 which finally ends up in)
      ...
      change_pte_range(..., prot_numa)

			if (!prot_numa) {
				...
			} else {
				... this seems to be dead code branch ...
			}

    is it intentional, and @prot_numa argument is supposed to be passed
    with prot_numa = 1 one day, or it's leftover from old times?

Note I've not yet tested the series building it now, hopefully finish
testing in a couple of hours.

Linus, by saying "define the bits we use when PAGE_PRESENT==0 separately
and explicitly" you meant complete rework of the bits, right? Not simply
group them in once place in a header?

	Cyrill

--
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>

             reply	other threads:[~2014-04-03 19:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 18:48 Cyrill Gorcunov [this message]
2014-04-03 18:48 ` [rfc 1/3] mm: pgtable -- Drop unneeded preprocessor ifdef Cyrill Gorcunov
2014-04-03 18:48 ` [rfc 2/3] mm: pgtable -- Require X86_64 for soft-dirty tracker Cyrill Gorcunov
2014-04-03 18:48 ` [rfc 3/3] mm: pgtable -- Use _PAGE_SOFT_DIRTY for swap entries Cyrill Gorcunov
2014-04-07 13:07 ` [rfc 0/3] Cleaning up soft-dirty bit usage Kirill A. Shutemov
2014-04-07 13:24   ` Cyrill Gorcunov

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=20140403184844.260532690@openvz.org \
    --to=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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).