lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALvZod6ReV=vTWZu_k2p9p3ZWOLM1z4SZ-kwoTv_a73iYFZj0g@mail.gmail.com>
Date:   Wed, 23 Dec 2020 14:54:02 -0800
From:   Shakeel Butt <shakeelb@...gle.com>
To:     SeongJae Park <sjpark@...zon.com>
Cc:     SeongJae Park <sjpark@...zon.de>, Jonathan.Cameron@...wei.com,
        Andrea Arcangeli <aarcange@...hat.com>, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, amit@...nel.org,
        benh@...nel.crashing.org, brendan.d.gregg@...il.com,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Qian Cai <cai@....pw>,
        Colin Ian King <colin.king@...onical.com>,
        Jonathan Corbet <corbet@....net>,
        David Hildenbrand <david@...hat.com>, dwmw@...zon.com,
        Marco Elver <elver@...gle.com>, "Du, Fan" <fan.du@...el.com>,
        foersleo@...zon.de, Greg Thelen <gthelen@...gle.com>,
        Ian Rogers <irogers@...gle.com>, jolsa@...hat.com,
        "Kirill A. Shutemov" <kirill@...temov.name>,
        Mark Rutland <mark.rutland@....com>,
        Mel Gorman <mgorman@...e.de>, Minchan Kim <minchan@...nel.org>,
        Ingo Molnar <mingo@...hat.com>, namhyung@...nel.org,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Rik van Riel <riel@...riel.com>,
        David Rientjes <rientjes@...gle.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mike Rapoport <rppt@...nel.org>, sblbir@...zon.com,
        Shuah Khan <shuah@...nel.org>, sj38.park@...il.com,
        snu@...zon.de, Vlastimil Babka <vbabka@...e.cz>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Yang Shi <yang.shi@...ux.alibaba.com>,
        Huang Ying <ying.huang@...el.com>, zgf574564920@...il.com,
        linux-damon@...zon.com, Linux MM <linux-mm@...ck.org>,
        linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v23 05/15] mm/damon: Implement primitives for the virtual
 memory address spaces

On Wed, Dec 23, 2020 at 8:47 AM SeongJae Park <sjpark@...zon.com> wrote:
>
[snip]
> > [snip]
> > > +
> > > +static bool damon_va_young(struct mm_struct *mm, unsigned long addr,
> > > +                       unsigned long *page_sz)
> > > +{
> > > +       pte_t *pte = NULL;
> > > +       pmd_t *pmd = NULL;
> > > +       spinlock_t *ptl;
> > > +       bool young = false;
> > > +
> > > +       if (follow_pte_pmd(mm, addr, NULL, &pte, &pmd, &ptl))
> > > +               return false;
> > > +
> > > +       *page_sz = PAGE_SIZE;
> > > +       if (pte) {
> > > +               young = pte_young(*pte);
> > > +               if (!young)
> > > +                       young = !page_is_idle(pte_page(*pte));
> > > +               pte_unmap_unlock(pte, ptl);
> > > +               return young;
> > > +       }
> > > +
> > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> > > +       young = pmd_young(*pmd);
> > > +       if (!young)
> > > +               young = !page_is_idle(pmd_page(*pmd));
> > > +       spin_unlock(ptl);
> > > +       *page_sz = ((1UL) << HPAGE_PMD_SHIFT);
> > > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
> > > +
> > > +       return young;
> >
> > You need mmu_notifier_test_young() here. Hmm I remember mentioning
> > this in some previous version as well.
>
> Your question and my answer was as below:
>
>     > Don't you need mmu_notifier_clear_young() here?
>
>     I think we don't need it here because we only read the Accessed bit and PG_Idle
>     if Accessed bit was not set.
>
> I should notice that you mean 'test_young()' but didn't, sorry.  I will add it
> in the next version.
>

I should have said mmu_notifier_test_young() instead of
mmu_notifier_clear_young().

> >
> > BTW have you tested this on a VM?
>
> Yes.  Indeed, I'm testing this on a QEMU/KVM environment.  You can get more
> detail at: https://damonitor.github.io/doc/html/latest/vm/damon/eval.html#setup
>

Hmm without mmu_notifier_test_young() you should be missing the kvm
mmu access updates. Can you please recheck if your eval is correctly
seeing the memory accesses from the VM?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ