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]
Date:   Thu, 20 Aug 2020 16:28:05 +0200
From:   SeongJae Park <sjpark@...zon.com>
To:     Shakeel Butt <shakeelb@...gle.com>
CC:     SeongJae Park <sjpark@...zon.com>, <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>,
        "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@....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>, <rppt@...nel.org>,
        <sblbir@...zon.com>, <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: [RFC v7 06/10] mm/damon: Implement callbacks for physical memory monitoring

On Thu, 20 Aug 2020 06:26:49 -0700 Shakeel Butt <shakeelb@...gle.com> wrote:

> On Thu, Aug 20, 2020 at 12:17 AM SeongJae Park <sjpark@...zon.com> wrote:
> >
> > On Wed, 19 Aug 2020 17:26:15 -0700 Shakeel Butt <shakeelb@...gle.com> wrote:
> >
> > > On Tue, Aug 18, 2020 at 12:27 AM SeongJae Park <sjpark@...zon.com> wrote:
> > > >
> > > > From: SeongJae Park <sjpark@...zon.de>
> > > >
> > > > This commit implements the four callbacks (->init_target_regions,
> > > > ->update_target_regions, ->prepare_access_check, and ->check_accesses)
> > > > for the basic access monitoring of the physical memory address space.
> > > > By setting the callback pointers to point those, users can easily
> > > > monitor the accesses to the physical memory.
> > > >
> > > > Internally, it uses the PTE Accessed bit, as similar to that of the
> > > > virtual memory support.  Also, it supports only user memory pages, as
> > > > idle page tracking also does, for the same reason.  If the monitoring
> > > > target physical memory address range contains non-user memory pages,
> > > > access check of the pages will do nothing but simply treat the pages as
> > > > not accessed.
> > > >
> > > > Users who want to use other access check primitives and/or monitor the
> > > > non-user memory regions could implement and use their own callbacks.
> > > >
> > > > Signed-off-by: SeongJae Park <sjpark@...zon.de>
> > > [snip]
> > > > +static void damon_phys_mkold(unsigned long paddr)
> > > > +{
> > > > +       struct page *page = damon_phys_get_page(PHYS_PFN(paddr));
> > > > +       struct rmap_walk_control rwc = {
> > > > +               .rmap_one = damon_page_mkold,
> > > > +               .anon_lock = page_lock_anon_vma_read,
> > > > +       };
> > > > +       bool need_lock;
> > > > +
> > > > +       if (!page)
> > > > +               return;
> > > > +
> > > > +       if (!page_mapped(page) || !page_rmapping(page))
> > > > +               return;
> > >
> > > I don't think you want to skip the unmapped pages. The point of
> > > physical address space monitoring was to include the monitoring of
> > > unmapped pages, so, skipping them invalidates the underlying
> > > motivation.
> >
> > I think my answer to your other mail[1] could be an answer to this.  Let me
> > quote some from it:
> >
> > ```
> > Technically speaking, this patchset introduces an implementation of DAMON's low
> > level primitives for physical address space of LRU-listed pages.  In other
> > words, it is not designed for cgroups case.  Also, please note that this
> > patchset is only RFC, because it aims to only show the future plan of DAMON and
> > get opinions about the concept before being serious.  It will be serious only
> > after the DAMON patchset is merged.  Maybe I didn' made this point clear in the
> > CV, sorry.  I will state this clearly in the next spin.
> > ```
> 
> The unmapped pages are also LRU pages.

Sorry, I missed the detail.  So, the description should be updated to:

    This patchset introduces an implementation of DAMON's low level primitives
    for physical addressspace of _mapped_ LRU pages.

> Let's forget about the cgroups
> support for a moment, the only reason to use DAMON's physical address
> space monitoring is also to track the accesses of unmapped pages
> otherwise virtual address space monitoring already does the monitoring
> for mapped pages.

Well, I didn't intended the use case...  I just wanted to let people see the
data accesses on physical address space without tracking every mappings of the
pages.

Anyway, ok, we could consider supporting unmapped pages, but I'm unsure why and
how much it is necessary.  After all, who could access unmapped pages?  Could
you give me more details on the needs for access monitoring of the unmapped
pages?


Thanks,
SeongJae Park

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ