public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/32s: Don't flush all TLBs when flushing one page
Date: Sat, 1 Feb 2020 08:06:29 -0600	[thread overview]
Message-ID: <20200201140629.GM22482@gate.crashing.org> (raw)
In-Reply-To: <248a3cf3-1b5e-a6e1-ceec-0e3904d1cf51@c-s.fr>

On Sat, Feb 01, 2020 at 08:27:03AM +0100, Christophe Leroy wrote:
> Le 31/01/2020 à 20:38, Segher Boessenkool a écrit :
> >On Fri, Jan 31, 2020 at 05:15:20PM +0100, Christophe Leroy wrote:
> >>Le 31/01/2020 à 16:51, Segher Boessenkool a écrit :
> >>>On Fri, Jan 31, 2020 at 03:37:34PM +0000, Christophe Leroy wrote:
> >>>>When the range is a single page, do a page flush instead.
> >>>
> >>>>+	start &= PAGE_MASK;
> >>>>+	end = (end - 1) | ~PAGE_MASK;
> >>>>  	if (!Hash) {
> >>>>-		_tlbia();
> >>>>+		if (end - start == PAGE_SIZE)
> >>>>+			_tlbie(start);
> >>>>+		else
> >>>>+			_tlbia();
> >>>>  		return;
> >>>>  	}
> >>>
> >>>For just one page, you get  end - start == 0  actually?
> >>
> >>Oops, good catch.
> >>
> >>Indeed you don't get PAGE_SIZE but (PAGE_SIZE - 1) for just one page.
> >
> >You have all low bits masked off in both start and end, so you get zero.
> >You could make the condion read "if (start == end)?
> 
> No, in end the low bits are set, that's a BIT OR with ~PAGE_MASK, so it 
> sets all low bits to 1.

Oh, wow, yes, I cannot read apparently.

Maybe there are some ROUND_DOWN and ROUND_UP macros you could use?


Segher

  reply	other threads:[~2020-02-01 14:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 15:37 [PATCH] powerpc/32s: Don't flush all TLBs when flushing one page Christophe Leroy
2020-01-31 15:51 ` Segher Boessenkool
2020-01-31 16:15   ` Christophe Leroy
2020-01-31 19:38     ` Segher Boessenkool
2020-02-01  7:27       ` Christophe Leroy
2020-02-01 14:06         ` Segher Boessenkool [this message]
2020-02-01 14:53           ` Christophe Leroy
2020-02-01 16:17             ` Segher Boessenkool

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=20200201140629.GM22482@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox