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] [day] [month] [year] [list]
Message-Id: <1330718946-19490-1-git-send-email-n-horiguchi@ah.jp.nec.com>
Date:	Fri,  2 Mar 2012 15:09:06 -0500
From:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To:	Hillf Danton <dhillf@...il.com>
Cc:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>, linux-mm@...ck.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] memcg: avoid THP split in task migration

On Fri, Mar 02, 2012 at 08:22:29PM +0800, Hillf Danton wrote:
> On Fri, Mar 2, 2012 at 8:31 AM, Naoya Horiguchi
> <n-horiguchi@...jp.nec.com> wrote:
...
> > --- linux-next-20120228.orig/mm/memcontrol.c
> > +++ linux-next-20120228/mm/memcontrol.c
> > @@ -5211,6 +5211,39 @@ static int is_target_pte_for_mc(struct vm_area_struct *vma,
> >    return ret;
> > }
> >
> > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> > +/*
> > + * We don't consider swapping or file mapped pages because THP does not
> > + * support them for now.
> > + * Caller should make sure that pmd_trans_huge(pmd) is true.
> > + */
> > +static int is_target_thp_for_mc(struct vm_area_struct *vma,
> > +        unsigned long addr, pmd_t pmd, union mc_target *target)
> > +{
> > +    struct page *page = NULL;
> > +    struct page_cgroup *pc;
> > +    int ret = 0;
> > +
>
> Need to check move_anon() ?

Right, we need it and page_mapcount check to be consistent with non thp code.

BTH it is maybe a bit off-topic, but I feel strange the following:

  static struct page *mc_handle_present_pte(struct vm_area_struct *vma,
                                            unsigned long addr, pte_t ptent)
  {
          ...
          if (PageAnon(page)) {
                  /* we don't move shared anon */
                  if (!move_anon() || page_mapcount(page) > 2)
                          return NULL;

Here page_mapcount(page) > 2 means that a given page is shared among more
than _three_ users. Documentation/cgroups/memory.txt sec.8.2 says that

  "(for file pages) mapcount of the page is ignored(the page can be
    moved even if page_mapcount(page) > 1)."

It implies that we do not move charge for anonymous page if mapcount > 1.
So I think the above mapcount check should be "> 1."
I'll post fix patch separately if it's correct.

> Other than that,
> Acked-by: Hillf Danton <dhillf@...il.com>

Thank you!

It's small fix, but I'll resend whole renewed patchset for Andrew to handle
it easier.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ