linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [rfc 0/3] Cleaning up soft-dirty bit usage
Date: Mon, 7 Apr 2014 16:07:01 +0300	[thread overview]
Message-ID: <20140407130701.GA16677@node.dhcp.inet.fi> (raw)
In-Reply-To: <20140403184844.260532690@openvz.org>

On Thu, Apr 03, 2014 at 10:48:44PM +0400, Cyrill Gorcunov wrote:
> 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.

Sorry, I didn't get this. How __split_huge_page_map() does depend on pte
bits order?

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

I see one more user of change_protection() -- change_prot_numa(), which
has .prot_numa == 1.

-- 
 Kirill A. Shutemov

  parent reply	other threads:[~2014-04-07 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 18:48 [rfc 0/3] Cleaning up soft-dirty bit usage Cyrill Gorcunov
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 ` Kirill A. Shutemov [this message]
2014-04-07 13:24   ` [rfc 0/3] Cleaning up soft-dirty bit usage 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=20140407130701.GA16677@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=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).