linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,
	"\\\"Kirill A. Shutemov\\\"" <kirill@shutemov.name>,
	Mel Gorman <mgorman@techsingularity.net>,
	Hugh Dickins <hughd@google.com>,
	Johannes Weiner <jweiner@redhat.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH 1/2] mm: thp: introduce thp_mmu_gather to pin tail pages during MMU gather
Date: Mon, 7 Dec 2015 15:44:45 +0100	[thread overview]
Message-ID: <20151207144445.GG29105@redhat.com> (raw)
In-Reply-To: <87poyl5mlo.fsf@linux.vnet.ibm.com>

On Sat, Dec 05, 2015 at 01:54:51PM +0530, Aneesh Kumar K.V wrote:
> If we can update mmu_gather to track the page size of the pages, that
> will also help some archs to better implement tlb_flush(struct
> mmu_gather *). Right now arch/powerpc/mm/tlb_nohash.c does flush the tlb
> mapping for the entire mm_struct. 
> 
> we can also make sure that we do a force flush when we are trying to
> gather pages of different size. So one instance of mmu_gather will end
> up gathering pages of specific size only ?

Tracking the TLB flush of multiple page sizes won't bring down the
complexity of the fix though, in fact the multiple page sizes are
arch-knowledge so such improvement would need to break the arch API
of the MMU gather.

THP is a common code abstraction, so the fix is self contained into
the common code and it can't take more than one bit to encode the
flush size because THP supports only one page size.

To achieve the multiple TLB flush size we could use an array of
unsigned long long physaddr where the bits below PAGE_SHIFT are the
page order. That would however require a pfn_to_page then to free the
page, so it's probably better to have the page struct and a order in
two different fields and double up the array size of the MMU
gather. Then we could as well look if we can go cross-mm so that it's
usable for the rmap-walk too, which is what I was looking into when I
found the THP SMP TLB flushing theoretical race.

In my view this is even more complicated from an implementation
standpoint because it isn't self contained in the common code. So I
doubt it's worth mixing the optimization in arch code for hugetlbfs
with the THP race fix that is all common code knowledge and it's
actually a fix (albeit purely theoretical) and not an optimization.

Thanks,
Andrea

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-12-07 14:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 13:00 [PATCH 0/2] THP " Andrea Arcangeli
2015-11-19 13:00 ` [PATCH 1/2] mm: thp: introduce thp_mmu_gather to pin tail pages during " Andrea Arcangeli
2015-11-20  0:22   ` Andrew Morton
2015-11-23 16:03     ` Andrea Arcangeli
2015-12-05  8:24       ` Aneesh Kumar K.V
2015-12-07 14:44         ` Andrea Arcangeli [this message]
2015-12-07  9:30   ` Aneesh Kumar K.V
2015-12-07 15:11     ` Andrea Arcangeli
2015-11-19 13:00 ` [PATCH 2/2] mm: thp: put_huge_zero_page() with " Andrea Arcangeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151207144445.GG29105@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave.hansen@intel.com \
    --cc=hughd@google.com \
    --cc=jweiner@redhat.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox