All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sparclinux@vger.kernel.org
Subject: Re: tlb_batch_add_one()
Date: Fri, 31 Mar 2017 03:34:55 +0000	[thread overview]
Message-ID: <20170330.203455.460688401687414609.davem@davemloft.net> (raw)
In-Reply-To: <20170328.175226.210187301635964014.davem@davemloft.net>

From: Nitin Gupta <nitin.m.gupta@oracle.com>
Date: Thu, 30 Mar 2017 20:12:03 -0700

> On 3/30/17 7:57 PM, David Miller wrote:
>> From: Nitin Gupta <nitin.m.gupta@oracle.com>
>> Date: Thu, 30 Mar 2017 17:42:51 -0700
>> 
>>> diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c
>>> index 0a04811..bedf08b 100644
>>> --- a/arch/sparc/mm/tsb.c
>>> +++ b/arch/sparc/mm/tsb.c
>>> @@ -122,7 +122,7 @@ void flush_tsb_user(struct tlb_batch *tb)
>>>
>>>  	spin_lock_irqsave(&mm->context.lock, flags);
>>>
>>> -	if (tb->hugepage_shift < HPAGE_SHIFT) {
>>> +	if (tb->hugepage_shift < REAL_HPAGE_SHIFT) {
>>>  		base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
>>>  		nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
>>>  		if (tlb_type = cheetah_plus || tlb_type = hypervisor)
>>> @@ -155,7 +155,7 @@ void flush_tsb_user_page(struct mm_struct *mm,
>>> unsigned long vaddr,
>>>
>>>  	spin_lock_irqsave(&mm->context.lock, flags);
>>>
>>> -	if (hugepage_shift < HPAGE_SHIFT) {
>>> +	if (hugepage_shift < REAL_HPAGE_SHIFT) {
>>>  		base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
>>>  		nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
>>>  		if (tlb_type = cheetah_plus || tlb_type = hypervisor)
>>> -- 
>> 
>> I think if we do it like this, it will only flush one half of the huge
>> page.
>>
> 
> Flushing only half the 8M page is the intended behavior: after the
> initial allocation of 8M hugepage, the page is handled exactly as if two
> independent 4M hugepages were allocated (that happen to be physically
> contiguous). So, for each 4M chunk, flushing from TLB and TSB is done
> independently. For instance, in set_huge_pte_at() we added special case
> for (size = HPAGE_SIZE) to flush the "second half" of 8M page.
> Similarly in huge_ptep_get_and_clear() and in set_pmd_at().

Indeed, the set_pmd_at() code path does the same thing.

Ok so your patch is more correct.

Please submit it formally with a proper commit log message and
signoff, thanks!

      parent reply	other threads:[~2017-03-31  3:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  0:52 tlb_batch_add_one() David Miller
2017-03-30 20:22 ` tlb_batch_add_one() David Miller
2017-03-30 20:47 ` tlb_batch_add_one() Nitin Gupta
2017-03-30 21:25 ` tlb_batch_add_one() David Miller
2017-03-30 21:54 ` tlb_batch_add_one() David Miller
2017-03-30 22:12 ` tlb_batch_add_one() Nitin Gupta
2017-03-30 23:59 ` tlb_batch_add_one() Nitin Gupta
2017-03-31  0:42 ` tlb_batch_add_one() Nitin Gupta
2017-03-31  2:46 ` tlb_batch_add_one() Nitin Gupta
2017-03-31  2:57 ` tlb_batch_add_one() David Miller
2017-03-31  3:12 ` tlb_batch_add_one() Nitin Gupta
2017-03-31  3:34 ` David Miller [this message]

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=20170330.203455.460688401687414609.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=sparclinux@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.