All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
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 17:24:37 +0400	[thread overview]
Message-ID: <20140407132437.GH1444@moon> (raw)
In-Reply-To: <20140407130701.GA16677@node.dhcp.inet.fi>

On Mon, Apr 07, 2014 at 04:07:01PM +0300, Kirill A. Shutemov wrote:
> 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?

__split_huge_page_map
  ...
  for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) {
    ...
    here we modify with pte bits
    entry = pte_mknuma(entry); --> clean _PAGE_PRESENT and set _PAGE_NUMA

    pte bits must remain valid and meaningful, for example we might
    have set _PAGE_RW here

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

Yeah, thanks, managed to miss this.

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

WARNING: multiple messages have this Message-ID (diff)
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
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 17:24:37 +0400	[thread overview]
Message-ID: <20140407132437.GH1444@moon> (raw)
In-Reply-To: <20140407130701.GA16677@node.dhcp.inet.fi>

On Mon, Apr 07, 2014 at 04:07:01PM +0300, Kirill A. Shutemov wrote:
> 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?

__split_huge_page_map
  ...
  for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) {
    ...
    here we modify with pte bits
    entry = pte_mknuma(entry); --> clean _PAGE_PRESENT and set _PAGE_NUMA

    pte bits must remain valid and meaningful, for example we might
    have set _PAGE_RW here

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

Yeah, thanks, managed to miss this.

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

Thread overview: 11+ 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 ` Cyrill Gorcunov
2014-04-03 18:48 ` [rfc 1/3] mm: pgtable -- Drop unneeded preprocessor ifdef Cyrill Gorcunov
2014-04-03 18:48   ` 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   ` Cyrill Gorcunov
2014-04-03 18:48 ` [rfc 3/3] mm: pgtable -- Use _PAGE_SOFT_DIRTY for swap entries Cyrill Gorcunov
2014-04-03 18:48   ` 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 [this message]
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=20140407132437.GH1444@moon \
    --to=gorcunov@gmail.com \
    --cc=kirill@shutemov.name \
    --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 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.