[CRIU] ppc64le soft dirty tracking on 4.14

Andrei Vagin avagin at virtuozzo.com
Thu Oct 5 02:40:29 MSK 2017


On Wed, Oct 04, 2017 at 08:41:22AM +0200, Laurent Dufour wrote:
> On 04/10/2017 01:01, Andrei Vagin wrote:
> > On Mon, Sep 25, 2017 at 06:08:26PM +0200, Adrian Reber wrote:
> >> Hello Laurent,
> >>
> >> I had a closer look and soft dirty tracking works correctly. I was just
> >> confused by the page size. The file was 65536 and not the expected
> >> 4096.
> >>
> >> CRIU still cannot detect if CONFIG_MEM_SOFT_DIRTY is enabled or not.
> >> The check always returns true and the criu pre-dump command is always
> >> successful. In the case where CONFIG_MEM_SOFT_DIRTY=n CRIU still does
> >> pre-dumps but it seems to always dump the complete memory.
> 
> I don't think this is a good idea to change the value of _PAGE_SOFT_DIRTY
> based on CONFIG_MEM_SOFT_DIRTY.
> 
> If processings are done on the soft dirty bit while CONFIG_MEM_SOFT_DIRTY
> is not set, this is a bug.

I'm not sure that it is a good idea too. But in this case, this problem is
more generic, because this way is already used for x86:

#ifdef CONFIG_MEM_SOFT_DIRTY
#define _PAGE_SOFT_DIRTY        (_AT(pteval_t, 1) << _PAGE_BIT_SOFT_DIRTY)
#else
#define _PAGE_SOFT_DIRTY        (_AT(pteval_t, 0))
#endif

And it is used even for powerpc to handle _PAGE_SWP_SOFT_DIRTY

#ifdef CONFIG_MEM_SOFT_DIRTY
#define _PAGE_SWP_SOFT_DIRTY   (1UL << (SWP_TYPE_BITS + _PAGE_BIT_SWAP_TYPE))
#else
#define _PAGE_SWP_SOFT_DIRTY    0UL
#endif /* CONFIG_MEM_SOFT_DIRTY */

Thanks,
Andrei


More information about the CRIU mailing list