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: <20150401131907.GE17153@node.dhcp.inet.fi>
Date:	Wed, 1 Apr 2015 16:19:07 +0300
From:	"Kirill A. Shutemov" <kirill@...temov.name>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc:	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Dave Hansen <dave.hansen@...el.com>,
	Hugh Dickins <hughd@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Rik van Riel <riel@...hat.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Christoph Lameter <cl@...two.org>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Steve Capper <steve.capper@...aro.org>,
	Johannes Weiner <hannes@...xchg.org>,
	Michal Hocko <mhocko@...e.cz>,
	Jerome Marchand <jmarchan@...hat.com>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCHv4 19/24] thp, mm: use migration entries to freeze page
 counts on split

On Mon, Mar 30, 2015 at 09:15:47PM +0530, Aneesh Kumar K.V wrote:
> "Kirill A. Shutemov" <kirill@...temov.name> writes:
> 
> > On Mon, Mar 30, 2015 at 08:38:08PM +0530, Aneesh Kumar K.V wrote:
> >> ....
> >> ....
> >>  +static void freeze_page(struct anon_vma *anon_vma, struct page *page)
> >> > +{
> >> > +	struct anon_vma_chain *avc;
> >> > +	struct vm_area_struct *vma;
> >> > +	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
> >> 
> >> So this get called only with head page, We also do
> >> BUG_ON(PageTail(page)) in the caller.  But
> >> 
> >> 
> >> > +	unsigned long addr, haddr;
> >> > +	unsigned long mmun_start, mmun_end;
> >> > +	pgd_t *pgd;
> >> > +	pud_t *pud;
> >> > +	pmd_t *pmd;
> >> > +	pte_t *start_pte, *pte;
> >> > +	spinlock_t *ptl;
> >> ......
> >> 
> >> 
> >> > +
> >> > +static void unfreeze_page(struct anon_vma *anon_vma, struct page *page)
> >> > +{
> >> > +	struct anon_vma_chain *avc;
> >> > +	pgoff_t pgoff = page_to_pgoff(page);
> >> 
> >> Why ? Can this get called for tail pages ?
> >
> > It cannot. pgoff is offset of head page (and therefore whole compound
> > page) within rmapping.
> >
> 
> This we can use 
> 
> 	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
>         
> similar to what we do in freeze_page(). The difference between
> freeze/unfreeze confused me.

Fair enough. Will fix.

-- 
 Kirill A. Shutemov
--
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