[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1381243620-hjcyg13o-mutt-n-horiguchi@ah.jp.nec.com>
Date: Tue, 08 Oct 2013 10:47:00 -0400
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Cyrill Gorcunov <gorcunov@...il.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Pavel Emelyanov <xemul@...allels.com>,
Andy Lutomirski <luto@...capital.net>,
Matt Mackall <mpm@...enic.com>,
Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...il.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Peter Zijlstra <peterz@...radead.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: Re: [patch 1/3] [PATCH] mm: migration -- Do not loose soft dirty bit
if page is in migration state
On Tue, Oct 08, 2013 at 06:40:30PM +0400, Cyrill Gorcunov wrote:
> On Tue, Oct 08, 2013 at 10:11:40AM -0400, Naoya Horiguchi wrote:
> > > Index: linux-2.6.git/mm/memory.c
> > > ===================================================================
> > > --- linux-2.6.git.orig/mm/memory.c
> > > +++ linux-2.6.git/mm/memory.c
> > > @@ -837,6 +837,8 @@ copy_one_pte(struct mm_struct *dst_mm, s
> > > */
> > > make_migration_entry_read(&entry);
> > > pte = swp_entry_to_pte(entry);
> > > + if (pte_swp_soft_dirty(*src_pte))
> > > + pte = pte_swp_mksoft_dirty(pte);
> > > set_pte_at(src_mm, addr, src_pte, pte);
> > > }
> > > }
> >
> > When we convert pte to swap_entry, we convert soft-dirty bit in
> > pte_to_swp_entry(). So I think that it's better to convert it back
> > in swp_entry_to_pte() when we do swap_entry-to-pte conversion.
>
> No, soft dirty bit lays _only_ inside pte entry in memory, iow
> swp_entry_t never has this bit, thus to be able to find soft dirty
> status in swp_entry_to_pte you need to extend this function and
> pass pte entry itself as an argument, which eventually will bring
> more massive patch and will be a way more confusing I think.
OK, you're right. Thanks for explanation.
> Or I misunderstood you?
No, I misread the code, sorry.
Naoya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists