linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "hch@infradead.org" <hch@infradead.org>
To: Atish Patra <Atish.Patra@wdc.com>
Cc: "hch@infradead.org" <hch@infradead.org>,
	"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Anup Patel <Anup.Patel@wdc.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alexios.zavras@intel.com" <alexios.zavras@intel.com>,
	"palmer@sifive.com" <palmer@sifive.com>,
	"paul.walmsley@sifive.com" <paul.walmsley@sifive.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"allison@lohutok.net" <allison@lohutok.net>
Subject: Re: [PATCH] RISC-V: Issue a local tlb flush if possible.
Date: Tue, 13 Aug 2019 07:30:27 -0700	[thread overview]
Message-ID: <20190813143027.GA31668@infradead.org> (raw)
In-Reply-To: <f58814e156b918531f058acfac944abef34f5fb1.camel@wdc.com>

On Tue, Aug 13, 2019 at 12:15:15AM +0000, Atish Patra wrote:
> I thought if it recieves an empty cpumask, then it should at least do a
> local flush is the expected behavior. Are you saying that we should
> just skip all and return ? 

How could we ever receive an empty cpu mask?  I think it could only
be empty without the current cpu.  At least that is my reading of
the callers and a few other implementations.

> > 	if (!cpumask || cpumask_test_cpu(cpu, cpumask) {
> > 		if ((start == 0 && size == -1) || size > PAGE_SIZE)
> > 			local_flush_tlb_all();
> > 		else if (size == PAGE_SIZE)
> > 			local_flush_tlb_page(start);
> > 		cpumask_clear_cpu(cpuid, cpumask);
> 
> This will modify the original cpumask which is not correct. clear part
> has to be done on hmask to avoid a copy.

Indeed.  But looking at the x86 tlbflush implementation it seems like we
could use cpumask_any_but() to avoid having to modify the passed in
cpumask.

  reply	other threads:[~2019-08-13 14:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-10  1:43 [PATCH] RISC-V: Issue a local tlb flush if possible Atish Patra
2019-08-10  3:30 ` Anup Patel
2019-08-10  5:28   ` Atish Patra
2019-08-10  6:37 ` Andreas Schwab
2019-08-10  9:21 ` Atish Patra
2019-08-12 14:56 ` Christoph Hellwig
2019-08-13  0:15   ` Atish Patra
2019-08-13 14:30     ` hch [this message]
2019-08-15 20:37       ` Atish Patra
2019-08-19 14:46         ` hch
2019-08-19 15:09           ` Anup Patel
2019-08-19 15:10             ` hch
2019-08-20  0:02               ` Atish Patra
2019-08-12 15:36 ` Troy Benjegerdes
2019-08-12 17:13   ` Atish Patra
2019-08-12 17:55   ` Christoph Hellwig
2019-08-13 18:25 ` Paul Walmsley
2019-08-14  1:49   ` Atish Patra

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=20190813143027.GA31668@infradead.org \
    --to=hch@infradead.org \
    --cc=Anup.Patel@wdc.com \
    --cc=Atish.Patra@wdc.com \
    --cc=alexios.zavras@intel.com \
    --cc=allison@lohutok.net \
    --cc=aou@eecs.berkeley.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=paul.walmsley@sifive.com \
    /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;
as well as URLs for NNTP newsgroup(s).